source: CIVL/examples/messagePassing/mp_proc_diffusion.cvh@ a054a5b

1.23 2.0 main test-branch
Last change on this file since a054a5b was 767f15e, checked in by Ziqing Luo <ziqing@…>, 12 years ago

the latest diffusion_1d program

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

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