MPI Subroutine Synopses
The subroutines described here are those only used in the examples,
not exhaustive.
- mpi_address(location,address,ierr)
- [void*], intent(in) :: location : location of data (any datatypes)
- integer, intent(out) :: address : byte address
- integer, intent(out) :: ierr : error code
Gets a byte address of location.
- mpi_bcast(buf,count,datatype,root,comm,ierr)
- datatype, intent(inout) :: buf : starting location of data to
be broadcasted
- integer, intent(in) :: count : number of data to be
broadcasted
- integer, intent(in) :: datatype : type of data to be
broadcasted
- integer, intent(in) :: root : rank of the processor which
broadcasts data
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: ierr : error code
The root processor broadcasts buf to all processors in the
communicator, and all other processors in the communicator store
the received data into buf.
- mpi_comm_rank(comm,rank,ierr)
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: rank : processor rank
- integer, intent(out) :: ierr : error code
Gets a rank of processor.
- mpi_comm_size(comm,size,ierr)
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: size : number of processors
- integer, intent(out) :: ierr : error code
Gets the number of processors in the communicator.
- mpi_finalize(ierr)
- integer, intent(out) :: ierr : error code
Finalizes MPI. MPI subroutines should be called before this
statement.
- mpi_gather(sendbuf,sendcounts,sendtype,recvbuf,recvcounts,recvtype,root,comm,ierr)
- sendtype, intent(in) :: sendbuf : starting location of data to
be sent by each processor
- integer, intent(in) :: sendcounts : number of data to be sent
by each processor
- integer, intent(in) :: sendtype : type of data to be sent by
each processor
- recvtype, intent(out) :: recvbuf : starting location of data
to be received by the root processor
- integer, intent(in) :: recvcounts : number of data sent
from each processor to be received by the root processor
- integer, intent(in) :: recvtype : type of data to be received
by the root processor
- integer, intent(in) :: root : rank of processor to which data
are gathered
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: ierr : error code
Gathers the data sent by each processor to the root
processor. The data sent by Ip-th processor are stored to the
location next to the location of the data sent by the (Ip-1)-th
processor. Sendcounts/sendtype and recvcounts/recvtype
should be the same for all processors.
- mpi_init(ierr)
- integer, intent(out) :: ierr : error code
Initializes MPI. MPI subroutines should be called after this
statement.
- mpi_irecv(buf,count,datatype,source,tag,comm,request,ierr)
- datatype, intent(out) :: buf : starting location of data to be
received
- integer, intent(in) :: count : number of data to be
received
- integer, intent(in) :: datatype : type of data to be
received
- integer, intent(in) :: source : source processor rank
- integer, intent(in) :: tag : message tag
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: request : request tag to be used by mpi_wait
- integer, intent(out) :: ierr : error code
Non-blocking version of mpi_recv. Mpi_wait gets informations of the
received data [status(mpi_status_size)] after it confirms data reception.
- mpi_isend(buf,count,datatype,dest,tag,comm,request,ierr)
- datatype, intent(in) :: buf : starting location of data to be
sent
- integer, intent(in) :: count : number of data to be sent
- integer, intent(in) :: datatype : type of data to be sent
- integer, intent(in) :: dest : destination processor rank
- integer, intent(in) :: tag : message tag
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: request : request tag to be used by mpi_wait
- integer, intent(out) :: ierr : error code
Non-blocking version of mpi_send.
- mpi_recv(buf,count,datatype,source,tag,comm,status,ierr)
- datatype, intent(out) :: buf : starting location of data to be
received
- integer, intent(in) :: count : number of data to be
received
- integer, intent(in) :: datatype : type of data to be
received
- integer, intent(in) :: source : source processor rank
- integer, intent(in) :: tag : message tag
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: status(mpi_status_size) : information of
the received data
- integer, intent(out) :: ierr : error code
Receives the data sent from the source processor, and stores it
into buf. The corresponding mpi_send
should have the same message tag. Status(mpi_status_size)
records informations of the received data, such as the source
processor rank, the message tag, and the error code, etc.
- mpi_reduce(operand,result,count,datatype,operator,root,comm,ierr)
- datatype, intent(in) :: operand : operand
- datatype, intent(out) :: result : result
- integer, intent(in) :: count : size of operand/result
- integer, intent(in) :: datatype : type of operand/result
- integer, intent(in) :: operator : operator
- integer, intent(in) :: root : rank of the processor which gets
the result
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: ierr : error code
Operates operator on operands on each processor. An
operator can be the predefined reduction operation (mpi_sum,
mpi_max, mpi_min etc.) or a user defined operation.
- mpi_send(buf,count,datatype,dest,tag,comm,ierr)
- datatype, intent(in) :: buf : starting location of data to be
sent
- integer, intent(in) :: count : number of data to be sent
- integer, intent(in) :: datatype : type of data to be sent
- integer, intent(in) :: dest : destination processor rank
- integer, intent(in) :: tag : message tag
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: ierr : error code
Sends buf to the dest processor. The corresponding mpi_recv should have the same message tag.
- mpi_sendrecv(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf,recvcount,recvtype,source,recvtag,comm,status,ierr)
- sendtype, intent(in) :: sendbuf : starting location of data to
be sent
- integer, intent(in) :: sendcount : number of data to be
sent
- integer, intent(in) :: sendtype : type of data to be sent
- integer, intent(in) :: dest : destination processor rank
- integer, intent(in) :: sendtag : message tag
- recvtype, intent(out) :: recvbuf : starting location of data
to be received
- integer, intent(in) :: recvcount : number of data to be
received
- integer, intent(in) :: recvdatatype : type of data to be
received
- integer, intent(in) :: source : source processor rank
- integer, intent(in) :: recvtag : message tag
- integer, intent(in) :: comm : communicator
- integer, intent(out) :: status(mpi_status_size) : information of
the received data
- integer, intent(out) :: ierr : error code
Combination of mpi_send and mpi_recv.
- mpi_type_commit(newtype,ierr)
- integer, intent(in) :: newtype : derivative type to be
committed
- integer, intent(out) :: ierr : error code
Commits newtype. Newtype is available after committing.
- mpi_type_struct((count,sizes,displacements,types,newtype,ierr)
- integer, intent(in) :: count : number of elements of newtype
- integer, intent(in) :: sizes(count) : size of each element of
newtype
- integer, intent(in) :: displacements(count) : displacement of
each element of newtype
- integer, intent(in) :: types(count) : datatype of each element
of newtype
- integer, intent(out) :: newtype : new data type
- integer, intent(out) :: ierr : error code
Constructs a derivative type of the group of data defined by
count, sizes, displacements, types.
- mpi_wait(request,status,ierr)
- integer, intent(inout) :: request tag
- integer, intent(out) :: status(mpi_status_size) : informations of
the data received by the corresponding non-blocking
subroutine.
- integer, intent(out) :: ierr : error code
Waits until the corresponding non-blocking subroutine having the
same request tag ends.
Written by "Ryusuke NUMATA" <rnumata at umd.edu>
http://www.glue.umd.edu/~rnumata/
Last modified: $Date: 2008-10-07 13:33:31 -0400 (Tue, 07 Oct 2008) $