This defines the organization of the message sending buffers.
This defines the organization of the message sending buffers. There is an array of buffer pointers, with an entry for each node. Only the nodes this node sends to actually point to a real buffer. The others just have the array entry set to NULL. This is so that selecting the proper buffer for a message means just using the destination node as an array index.The SendMsg routine will put its message into the buffer the array currently points to. If that fills it, the buffer is sent with MPI_Isend, the buffer pointer moved to the busy buffer list (ring buffer?) and a new buffer gotten from the free buffer list. If no free ones are left, MPI_Wait is called on the requests in the busy buffer list, to clear any pending sends and thus free the buffers.
The buffer encapsulates both the information to be sent (in PACKET), and information about the status of the send. Note trickiness with request: MPI says it's an opaque type that can be assigned & compared. Requests array has to be in order of buffers for MPI_Waitsome and send/busy/free scheme to work...
Alphabetic index HTML hierarchy of classes or Java