MPI Function Reference<< Basic Message Passing | Table of Contents | >>
Preliminaries
int MPI_Init( int *argc, char **argv[] ) Initializes the MPI environment. This routine must be the first MPI function called by each process in the virtual computer.
(:endfnct:) (:begfnct mpi_finalize:) int MPI_Finalize() Terminates the MPI environment and should be called by at the end of the program by every process in the virtual computer. (:endfnct:) (:begfnct mpi_rank:) int MPI_Comm_rank( MPI_Comm comm, int *pid ) Used by a process to determine its rank or process id number within a communicator.
(:endfnct:) (:begfnct mpi_size:) int MPI_Comm_size( MPI_Comm comm, int *size ) Used by a process to determine the total number of processes associated with a given communicator.
(:endfnct:) (:begfnct mpi_barrier:) int MPI_Barrier( MPI_Comm comm ) Blocks all processes in the given communicator group until all processes have executed the function call. (:endfnct:) (:begfnct mpi_wtime:) double MPI_Wtime() Returns the elapsed time, in seconds, from some point in the past. (:endfnct:) Message Passing
int MPI_Bcast( void *buf, int count, MPI_Datatype datatype,
(:endfnct:) (:begfnct mpi_send:) int MPI_Send( void *buf, int count, MPI_Datatype datatype,
(:endfnct:) (:begfnct mpi_recv:) int MPI_Recv( void *buf, int count, MPI_Datatype datatype,
(:endfnct:) (:begfnct mpi_reduce:) int MPI_Reduce( void *sendbuf, void *recvbuf, int count, (:endfnct:) (:begfnct mpi_probe:) int MPI_Probe( int srcPid, int tag, MPI_Comm comm, MPI_Status *status ); Blocks and waits for a message with the given data
(:endfnct:) (:begfnct mpi_getcount:) int MPI_Get_count( MPI_Status *status, MPI_Datatype datatype, int *count ) Determines the number of data items contained in a message just received or the next message to be received. This function is used with either MPI_Recv() or MPI_Probe().
The following code segment illustrates the use of this function (:source lang=cpp:)MPI_Status msgStatus; int numItems; MPI_Probe( ROOT_PROC, DATA_TAG, MPI_COMM_WORLD, &msgStatus ); MPI_Get_count( &msgStatus, MPI_DOUBLE, &numItems ); MPI Data Types
MPI_Comm Indicates the process communicator group. The most common entry for a parameter of this type is (:begfnct mpi_datatype:) MPI_Datatype Indicates the type of data being transmitted using one of the MPI message passing routines. An MPI_CHAR MPI_DOUBLE MPI_FLOAT MPI_INT MPI_LONG MPI_LONG_DOUBLE MPI_LONG_LONG MPI_SHORT MPI_UNSIGNED_CHAR MPI_UNSIGNED_INT MPI_UNSIGNED_LONG MPI_UNSIGNED_SHORT MPI_UNSIGNED_LONG_LONG (:endfnct:) (:begfnct mpi_op:) MPI_OP Specifies the type of reduce operation to be performed by the MPI_Reduce() function. Legal values for this data type include
(:endfnct:)
|