source: CIVL/examples/messagePassing/mp_proc.cvh@ 5feb8e1

1.23 2.0 main test-branch
Last change on this file since 5feb8e1 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
RevLine 
[0be7a7ea]1 void send(void *buf, int count, int dest, int tag) {
[2fa36af]2 $atomic{
[0be7a7ea]3 $message out = $message_pack(rank, dest, tag, buf, count*sizeof(double));
[2fa36af]4 $comm_enqueue(&MPI_COMM_WORLD, out);}
[0be7a7ea]5 }
6
7 void recv(void *buf, int count, int source, int tag) {
[2fa36af]8 $atomic{
[0be7a7ea]9 $message in = $comm_dequeue(&MPI_COMM_WORLD, source, rank, tag);
[2fa36af]10 $message_unpack(in, buf, count*sizeof(double));}
[0be7a7ea]11 }
12
13 $when (__start);
Note: See TracBrowser for help on using the repository browser.