source: CIVL/examples/messagePassing/mp_proc.cvh@ f2ab81f

1.23 2.0 main test-branch
Last change on this file since f2ab81f was 2fa36af, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

make examples atomic

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@392 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 405 bytes
Line 
1 void send(void *buf, int count, int dest, int tag) {
2 $atomic{
3 $message out = $message_pack(rank, dest, tag, buf, count*sizeof(double));
4 $comm_enqueue(&MPI_COMM_WORLD, out);}
5 }
6
7 void recv(void *buf, int count, int source, int tag) {
8 $atomic{
9 $message in = $comm_dequeue(&MPI_COMM_WORLD, source, rank, tag);
10 $message_unpack(in, buf, count*sizeof(double));}
11 }
12
13 $when (__start);
Note: See TracBrowser for help on using the repository browser.