HP-MPI User's Guide (11th Edition)
Introduction
MPI concepts
Chapter 1 7
number assigned to each member process from the sequence 0 through
(size-1), where size is the total number of processes in the
communicator.
To determine the number of processes in a communicator, use the
following syntax:
MPI_Comm_size (MPI_Comm comm, int *size);
where
comm Represents the communicator handle
size Represents the number of processes in the group of
comm
To determine the rank of each process in comm, use
MPI_Comm_rank(MPI_Comm comm, int *rank);
where
comm Represents the communicator handle
rank Represents an integer between zero and (size - 1)
A communicator is an argument to all communication routines. The C
code example, “communicator.c” on page 249 displays the use
MPI_Comm_dup, one of the communicator constructor functions, and
MPI_Comm_free, the function that marks a communication object for
deallocation.
Sending and receiving messages
There are two methods for sending and receiving data: blocking and
nonblocking.
In blocking communications, the sending process does not return until
the send buffer is available for reuse.
In nonblocking communications, the sending process returns
immediately, and may only have started the message transfer operation,
not necessarily completed it. The application may not safely reuse the
message buffer after a nonblocking routine returns until MPI_Wait
indicates that the message transfer has completed.
In nonblocking communications, the following sequence of events occurs:
1. The sending routine begins the message transfer and returns
immediately.