MPI Subroutine Synopses
The subroutines described here are those only used in the examples, not exhaustive. For the detail of MPI, please refer MPI standard Documents, or manuals of each implementation, such as MPICH or Open MPI.
- mpi_get_address(location,address,ierr)
- 
	    - type(*), dimension(..), asynchronous :: location: location of data
- integer(kind=mpi_address_kind), intent(out) :: address: byte address
- integer, optional, intent(out) :: ierr: error code
 location.
- mpi_bcast(buf,count,datatype,root,comm,ierr)
- 
	    - type(*), dimension(..) :: buf: starting location of data to be broadcasted
- integer, intent(in) :: count: number of data to be broadcasted
- type(mpi_datatype), intent(in) :: datatype: type of data to be broadcasted
- integer, intent(in) :: root: rank of the processor which broadcasts data
- type(mpi_comm), intent(in) :: comm: communicator
- integer, optional, intent(out) :: ierr: error code
 buffrom therootprocessor to all processors in the communicator, and all other processors in the communicator store the received data intobuf.
- mpi_comm_rank(comm,rank,ierr)
- 
	    - type(mpi_comm), intent(in) :: comm: communicator
- integer, intent(out) :: rank: processor rank
- integer, optional, intent(out) :: ierr: error code
 
- mpi_comm_size(comm,size,ierr)
- 
	    - type(mpi_comm), intent(in) :: comm: communicator
- integer, intent(out) :: size: number of processors
- integer, optional, intent(out) :: ierr: error code
 
- mpi_finalize(ierr)
- 
	    - integer, optional, intent(out) :: ierr: error code
 
- mpi_gather(sendbuf,sendcounts,sendtype,recvbuf,recvcounts,recvtype,root,comm,ierr)
- 
	    - type(*), dimension(..), 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
- type(mpi_datatype), intent(in) :: sendtype: type of data to be sent by each processor
- type(*), dimension(..) :: recvbuf: starting location of data to be received by the- rootprocessor
- integer, intent(in) :: recvcounts: number of data sent from each processor to be received by the- rootprocessor
- type(mpi_datatype), intent(in) :: recvtype: type of data to be received by the- rootprocessor
- integer, intent(in) :: root: rank of processor to which data are gathered
- type(mpi_comm), intent(in) :: comm: communicator
- integer, optional, intent(out) :: ierr: error code
 rootprocessor. The data sent by -th processor are stored to the location next to the location of the data sent by the -th processor.Sendcounts/sendtypeandrecvcounts/recvtypeshould be the same for all processors.
- mpi_gatherv(sendbuf,sendcounts,sendtype,recvbuf,recvcounts,displs,recvtype,root,comm,ierr)
- 
	    - type(*), dimension(..), 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
- type(mpi_datatype), intent(in) :: sendtype: type of data to be sent by each processor
- type(*), dimension(..) :: recvbuf: starting location of data to be received by the- rootprocessor
- integer, intent(in) :: recvcounts(*): number of data sent from each processor to be received by the- rootprocessor
- integer, intent(in) :: displs(*): location of data to be placed on the- rootprocessor
- type(mpi_datatype), intent(in) :: recvtype: type of data to be received by the- rootprocessor
- integer, intent(in) :: root: rank of processor to which data are gathered
- type(mpi_comm), intent(in) :: comm: communicator
- integer, optional, intent(out) :: ierr: error code
 Mpi_gathervextends the functionality ofmpi_gatherby allowing a varying count of data from each processor.Displsspecifies the location of data to be placed on therootprocessor.
- mpi_init(ierr)
- integer, optional, intent(out) :: ierr: error code
 
- mpi_irecv(buf,count,datatype,source,tag,comm,request,ierr)
- 
	    - type(*), dimension(..), asynchronous :: buf: starting location of data to be received
- integer, intent(in) :: count: number of data to be received
- type(mpi_datatype), intent(in) :: datatype: type of data to be received
- integer, intent(in) :: source: source processor rank
- integer, intent(in) :: tag: message tag
- type(mpi_comm), intent(in) :: comm: communicator
- type(mpi_request), intent(out) :: request: request tag to be used by- mpi_wait
- integer, optional, intent(out) :: ierr: error code
 mpi_recv.
- mpi_isend(buf,count,datatype,dest,tag,comm,request,ierr)
- 
	    - type(*), dimension(..), intent(in), asynchronous :: buf: starting location of data to be sent
- integer, intent(in) :: count: number of data to be sent
- type(mpi_datatype), intent(in) :: datatype: type of data to be sent
- integer, intent(in) :: dest: destination processor rank
- integer, intent(in) :: tag: message tag
- type(mpi_comm), intent(in) :: comm: communicator
- type(mpi_request), intent(out) :: request: request tag to be used by- mpi_wait
- integer, optional, intent(out) :: ierr: error code
 mpi_send.
- mpi_recv(buf,count,datatype,source,tag,comm,status,ierr)
- 
	    - type(*), dimension(..) :: buf: starting location of data to be received
- integer, intent(in) :: count: number of data to be received
- type(mpi_dataype), intent(in) :: datatype: type of data to be received
- integer, intent(in) :: source: source processor rank
- integer, intent(in) :: tag: message tag
- type(mpi_comm), intent(in) :: comm: communicator
- type(mpi_status) :: status: information of the received data
- integer, optional, intent(out) :: ierr: error code
 sourceprocessor, and stores it intobuf. The correspondingmpi_sendshould have the same messagetag.Statusrecords information of the received data, such as the source processor rank, the message tag, and the error code, etc.
- mpi_reduce(sendbuf,recvbuf,count,datatype,operator,root,comm,ierr)
- 
	    - type(*), dimension(..), intent(in) :: sendbuf: starting location of operand
- type(*), dimension(..) :: recvbuf: starting location of result
- integer, intent(in) :: count: size of- sendbuf/- recvbuf
- type(mpi_datatype), intent(in) :: datatype: type of- sendbuf/- recvbuf
- type(mpi_op), intent(in) :: operator: operator
- integer, intent(in) :: root: rank of the processor which gets the result
- type(mpi_comm), intent(in) :: comm: communicator
- integer, optional, intent(out) :: ierr: error code
 sendbufof each processor using the operation specified byoperator, and returns the combined value inrecvbufof therootprocessor. Theoperatorcan be the predefined reduction operation (mpi_sum,mpi_max,mpi_minetc.) or a user defined operation.
- mpi_send(buf,count,datatype,dest,tag,comm,ierr)
- 
	    - type(*), dimension(..), intent(in) :: buf: starting location of data to be sent
- integer, intent(in) :: count: number of data to be sent
- type(mpi_datatype), intent(in) :: datatype: type of data to be sent
- integer, intent(in) :: dest: destination processor rank
- integer, intent(in) :: tag: message tag
- type(mpi_comm), intent(in) :: comm: communicator
- integer, optional, intent(out) :: ierr: error code
 bufto thedestprocessor. The correspondingmpi_recvshould have the same messagetag.
- mpi_sendrecv(sendbuf,sendcount,sendtype,dest,sendtag,recvbuf,recvcount,recvtype,source,recvtag,comm,status,ierr)
- 
	    - type(*), dimension(..), intent(in) :: sendbuf: starting location of data to be sent
- integer, intent(in) :: sendcount: number of data to be sent
- type(mpi_datatype), intent(in) :: sendtype: type of data to be sent
- integer, intent(in) :: dest: destination processor rank
- integer, intent(in) :: sendtag: message tag
- type(*), dimension(..) :: recvbuf: starting location of data to be received
- integer, intent(in) :: recvcount: number of data to be received
- type(mpi_datatype), intent(in) :: recvtype: type of data to be received
- integer, intent(in) :: source: source processor rank
- integer, intent(in) :: recvtag: message tag
- type(mpi_comm), intent(in) :: comm: communicator
- type(mpi_status) :: status: information of the received data
- integer, optional, intent(out) :: ierr: error code
 mpi_sendandmpi_recv.
- mpi_type_commit(newtype,ierr)
- 
	    - type(mpi_datatype), intent(in) :: newtype: derivative type to be committed
- integer, optional, intent(out) :: ierr: error code
 newtype.Newtypeis available after committing.
- mpi_type_create_struct(count,sizes,displacements,types,newtype,ierr)
- 
	    - integer, intent(in) :: count: number of elements of the new type
- integer, intent(in) :: sizes(count): size of each element of the new type
- integer(kind=mpi_address_kind), intent(in) :: displacements(count): displacement of each element of the new type
- type(mpi_datatype), intent(in) :: types(count): datatype of each element of the new type
- type(mpi_datatype), intent(out) :: newtype: new data type
- integer, optional, intent(out) :: ierr: error code
 count,sizes,displacements,types.
- mpi_wait(request,status,ierr)
- 
	    - type(mpi_request), intent(inout) :: request: tag
- type(mpi_status) :: status: information on the completed operation.
- integer, optional, intent(out) :: ierr: error code
 
