next up previous

7.3 Asynchronous Message Passing

isend() and irecv() are the asynchronous send and receive system calls. An asynchronous send or receive does not block. It returns a unique message id, which can be used later to check for completion of the message. To check on the completion of an asynchronous call, use the asynchronous msgdone() call, or the synchronous msgwait() call. Because the iPSC system has a limited number of message ids, it is a good practice to release ids that are no longer needed. msgwait(), msgdone() or msgcancel() can be used for this.

Example
The following code asynchronously sends the value of pi in a message of type 1 to process 0 on node 2.

double pi;
long msgid;
pi = 3.14159;
msgid = isend(1, &pi, sizeof(double), 2, 0);
...
...
msgwait(msgid);