| [b482f11] | 1 | void send(void *buf, int count, int dest, int tag, $comm comm) {
|
|---|
| [0be7a7ea] | 2 | $message out = $message_pack(rank, dest, tag, buf, count*sizeof(double));
|
|---|
| [b482f11] | 3 | $comm_enqueue(comm, out);
|
|---|
| [0be7a7ea] | 4 | }
|
|---|
| 5 |
|
|---|
| [b482f11] | 6 | void recv(void *buf, int count, int source, int tag, $comm comm) {
|
|---|
| 7 | $message in = $comm_dequeue(comm, source, tag);
|
|---|
| [c46e702] | 8 | $message_unpack(in, buf, count*sizeof(double));
|
|---|
| [0be7a7ea] | 9 | }
|
|---|
| 10 |
|
|---|
| [08f1543] | 11 | void sendrecv(void *sendbuf, int sendcount, int dest, int sendtag,
|
|---|
| 12 | void *recvbuf, int recvcount, int source, int recvtag, $comm comm) {
|
|---|
| 13 | $message out = $message_pack(rank, dest, sendtag, sendbuf, sendcount*sizeof(double));
|
|---|
| 14 | $message in;
|
|---|
| [fc1850d] | 15 | _Bool probe = $comm_probe(comm, source, recvtag);
|
|---|
| [08f1543] | 16 |
|
|---|
| 17 | $choose {
|
|---|
| 18 | $when (1){
|
|---|
| 19 | $comm_enqueue(comm, out);
|
|---|
| 20 | in = $comm_dequeue(comm, source, recvtag);
|
|---|
| 21 | }
|
|---|
| [fc1850d] | 22 | $when (probe){
|
|---|
| [08f1543] | 23 | in = $comm_dequeue(comm, source, recvtag);
|
|---|
| 24 | $comm_enqueue(comm, out);
|
|---|
| 25 | }
|
|---|
| 26 | }
|
|---|
| 27 | $message_unpack(in, recvbuf, recvcount*sizeof(double));
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| [0be7a7ea] | 30 | $when (__start);
|
|---|