next up previous contents
Next: Sending Up: Sending and Receiving Messages Previous: Sending and Receiving Messages   Contents

Message Buffer Memory Model

AUTOPACK assumes the responsibility for memory allocation for all outgoing and incoming messages. This model of allocation allows the library to do several things more efficiently. Although the user is unaware of it, the library allocates messages going to the same destination contiguously in memory. Thus, when the time comes to send a package, no memory-to-memory copying is necessary; it simply sends a contiguous block of these messages. On the receive side, a package is stored in memory and pointers to the individual messages within are returned to the user rather than requiring a copy operation to dispense each message. For both sending and receiving, the underlying memory allocation is done in large blocks for efficiency.

Note: This model is best suited for dynamic situations where the message must be constructed before it is sent. For example, the user might want to allocate a struct, fill in its fields, send it, then delete it. It is not the most appropriate for situations where the data to be sent already exists in memory. For example, if the sender has a large array and wants to sent its contents to an existing array on the destination. In that case, standard MPI calls are the most efficient way to accomplish the communication. In the case where the data already exists in memory, but is small, the user must evaluate the tradeoff between the overhead of sending a small message versus the overhead of copying the message from its current place in memory to a buffer allocated by AUTOPACK . If there are many messages the latter is likely to be more efficient.


next up previous contents
Next: Sending Up: Sending and Receiving Messages Previous: Sending and Receiving Messages   Contents
Raymond Loy 2000-05-12