MPI Glossary


This document describes some of the routines available in the MPI library. This version of the document assumes that the user's program is written in FORTRAN77 or FORTRAN90.

TABLE OF CONTENTS


Notes

Process versus processor. We think of parallel processing as involving separate computers working together, with each computer having one, or sometimes a few processors. However, in MPI, the important item is a process. We may think of a process as one thread of execution, typically corresponding to a particular processor. However, it is possible for a single processor to be in charge of multiple processes; this is handy, for instance, just in practicing the use of MPI when you only have one computer. The important thing about a process is that it has its own process id, its own local memory, its own copy of the common program and a pointer to where it is in that program, and its own set of communication channels to other processes.


MPI Datatypes

The MPI datatypes are, in some sense, just integers that indicate to various MPI routines what data you are sending. In some implementations of MPI, it is possible to use the name of a different datatype with the same number of bytes, or to pass a datatype of MPI_BYTE, say, and multiply the count by the appropriate value.

It may also be possible to use either the C name or FORTRAN name for a given piece of data.

Neither practice is explicitly allowed by the standard; although you might be able to get away with them in some implementations, they are not recommended!

The built-in MPI datatypes usable by FORTRAN programs are as follows:
MPI DatatypeFortran Type
MPI_BYTE 
MPI_CHARACTERcharacter
MPI_COMPLEXcomplex
MPI_DOUBLE_PRECISIONdouble precision
MPI_INTEGERinteger
MPI_LOGICALlogical
MPI_PACKED(see MPI_Pack)
MPI_REALreal
MPI_2DOUBLE_PRECISIONa pair of double precision values
MPI_2INTEGERa pair of integers
MPI_2REALa pair of real values

The "paired" datatypes MPI_2DOUBLEPRECISION, MPI_2INTEGER and MPI_2REAL are necessary when using the MPI_MAXLOC or MPI_MINLOC reduction operations with MPI_Reduce.

Users may create additional datatypes, for example, by using MPI_Type_vector.


MPI Error Codes

Almost every MPI routine returns an error code, and almost nobody looks at them. However, if you wish to check the value of an error return code, MPI has some predefined values that can help you in handling the condition: The built-in MPI datatypes are as follows:
MPI Error CodeMeaning
MPI_SUCCESSno error was detected;
MPI_ERR_ARG 
MPI_ERR_BUFFER 
MPI_ERR_COMMa communicator argument was illegal;
MPI_ERR_COUNTa count argument was illegal;
MPI_ERR_DIMSa dims (dimensions) argument was illegal;
MPI_ERR_GROUPa group argument was illegal;
MPI_ERR_IN_STATUS 
MPI_ERR_INTERNan internal MPI error occurred;
MPI_ERR_LASTCODE 
MPI_ERR_OPan op (reduction operation) argument was illegal;
MPI_ERR_OTHER 
MPI_ERR_RANKa rank argument was illegal;
MPI_ERR_REQUESTa request argument was illegal;
MPI_ERR_ROOT 
MPI_ERR_TAGa tag argument was illegal;
MPI_ERR_TOPOLOGY 
MPI_ERR_TRUNCATE 
MPI_ERR_TYPEa datatype argument was illegal;
MPI_ERR_UNKNOWNan error of unknown type occurred;
MPI_PENDING 


MPI Symbolic Constants

NameUsage
MPI_ANY_SOURCEindicates that the receiving process will accept input from any source;
MPI_ANY_TAGindicates that the receiving process will accept input messages with any tag;
MPI_COMM_NULLthe null communicator, including no processes;
MPI_COMM_WORLDthe communicator of all processes;
MPI_CONGRUENTindicates two communicators or groups have the same processes and ranks but different contexts;
MPI_DATATYPE_NULLthe null datatype;
MPI_DUP_FNduplicates a communicator by copying each attribute;
MPI_ERRHANDLER_NULLthe null error handler;
MPI_GROUP_EMPTYthe empty group;
MPI_GROUP_NULLthe null group;
MPI_IDENTindicates that two communicators or groups are identical;
MPI_KEYVAL_INVALIDthe value assigned to uninitialized attributes;
MPI_NULL_COPY_FNindicates that no special action should be taken to copy attributes;
MPI_NULL_DELETE_FNindicates that no special action should be taken to delete attributes;
MPI_OP_NULLthe null reduction operation;
MPI_PROC_NULLthe null process;
MPI_REQUEST_NULLthe null request;
MPI_SIMILARindicates that two communicators or groups have the same underlying processes, but different ranks;
MPI_SOURCEthe index within the stat array of the message source;
MPI_STATUS_SIZEthe required dimension of the stat array;
MPI_TAGthe index within the stat array of the message tag;
MPI_UNDEFINEDindicates that a value has not been defined for this quantity;
MPI_UNEQUALindicates two communicators or groups are not similar;


MPI Operations

There are a set of predefined symbolic constants used to indicate that the MPI processes should cooperate in a specific computation. These constants are used as a flag to routines such as MPI_Reduce. New reduction operations can be defined by calling MPI_Op_create.
NameUsage
MPI_BANDthe bitwise AND of a set of data;
MPI_BORthe bitwise OR of a set of data;
MPI_BXORthe bitwise exclusive OR of a set of data;
MPI_LANDthe logical AND of a set of data;
MPI_LORthe logical OR of a set of data;
MPI_LXORthe logical exclusive OR of a set of data;
MPI_MAXthe maximum entry in a set of data;
MPI_MAXLOCthe maximum entry AND the process on which it occurred;
MPI_MINthe minimum entry in a set of data;
MPI_MINLOCthe minimum entry AND the process on which it occurred;
MPI_PRODthe product of a set of data;
MPI_SUMdetermines the sum of a set of data;

Note that MPI_MAXLOC and MPI_MINLOC return a pair of values; the second one is always a process ID, but the type of the first one depends on the type of the input vector. To avoid problems, the process ID is converted to the same type as the input vector. Thus, a if the minimum entry of a real vector as value 43.2 and occurs on process 17, the values returned are the real pair (43.2,17.0). The appropriate datatype is a special MPI datatype of MPI_2DOUBLE_PRECISION, MPI_2INTEGER, or MPI_2REAL.


MPI Library Routines


MPI_Abort

Call:
subroutine MPI_Abort ( communicator, ierr )
Purpose:
MPI_Abort shuts down all the processes in a given communicator and returns an error code to the invoking environment.
Discussion:
The behavior of this routine is actually implementation-dependent. It may simply shut down all processes and terminate execution with the error code.
Arguments:
Input, integer communicator:
The communicator whose processes are to be shut down.
Input, integer ierr:
The error code to be returned.


MPI_Address

Call:
subroutine MPI_Address ( data, address )
Purpose:
MPI_Address returns the address of an item of data.
Discussion:
One use for this routine might be to determine the addresses or displacements of various quantities, as required by MPI_Type_hindexed or MPI_Type_hvector.
Arguments:
Input, integer data:
An item of data.
Output, integer address:
The address of the item. Note that addresses are determined in terms of bytes.


MPI_Allgather

Call:
subroutine MPI_Allgather ( send_data, send_count, send_datatype, recv_data, recv_count, recv_datatype, communicator, ierr )
Purpose:
MPI_Allgather gathers data from all the processes in a communicator, given each process a copy of the total information.
Discussion:
Each of the processes is assumed to have a set of data. This call collects a copy of each set of data into a single big vector, which is given to every process.
The data is stored in process rank order; that is, the data from process 0 is stored first, followed by that from process 1, and so on.
To only gather the data onto one process, see MPI_Gather.
Arguments:
Input, send_datatype send_data(send_count):
the data residing on the local process.
Input, integer send_count:
The number of items in send_data.
Input, integer send_datatype:
The type of the information in send_data. The value of send_type should be a standard MPI datatype or else a derived datatype.
Output, recv_datatype recv_data(*):
is the array used to receive the gathered data. Note that the actual dimension required for recv_data is num_procs * send_count.
Input, integer recv_count:
The number of items expected from each process. Normally, this would be the same as send_count.
Input, integer recv_datatype:
The type of the information in recv_data. Normally, this would be the same as send_datatype.
Input, integer communicator:
The communicator that includes all the processes.
Output, integer ierr:
The error status.


MPI_Allgatherv

Call:
subroutine MPI_Allgatherv ( send_data, send_count, send_datatype, recv_data, recv_count, displs, recv_datatype, communicator, ierr )
Purpose:
MPI_Allgatherv gathers data from all the processes in a communicator, given each process a copy of the total information. This routine does not assume that each process starts out with the same amount of data.
Discussion:
Each of the processes is assumed to have a set of data, of a size that may vary from process to process. This call collects a copy of each set of data into a single big vector, which is given to every process.
The data is stored in process rank order; that is, the data from process 0 is stored first, followed by that from process 1, and so on.
Arguments:
Input, send_datatype send_data(send_count):
the data residing on the local process.
Input, integer send_count:
The number of items in send_data.
Input, integer send_datatype:
The type of the information in send_data. The value of send_type should be a standard MPI datatype or else a derived datatype.
Output, recv_datatype recv_data(*):
is the array used to receive the gathered data. Note that the actual dimension required for recv_data is num_procs * send_count.
Input, integer recv_count(num_procs):
The number of items expected from each process.
Input, integer displs(num_procs):
displs(i) is the index in recv_data where the first item from process i should be stored. Note that we use 0-based indexing here, so a FORTRAN programmer should think of these as offsets from 1, the location of the first entry of recv_data.
Input, integer recv_datatype:
The type of the information in recv_data. Normally, this would be the same as send_datatype.
Input, integer communicator:
The communicator that includes all the processes.
Output, integer ierr:
The error status.


MPI_Allreduce

Call:
subroutine MPI_Allreduce ( local_data, global_data, count, datatype, operation, communicator, ierr )
Purpose:
MPI_Allreduce carries out a reduction operation (such as sum, maximum, or product), with all processes receiving the result.
Discussion:
The first two arguments must not overlap or share memory in any way.
Compare this routine with MPI_Reduce, in which only one process receives the final result.
Note that this routine essentially synchronizes the processes within its communicator. No process can exit from this call until all processes have entered the call.
Arguments:
Input, datatype local_data(count):
A scalar or vector, whose type and size will be specified. The value of local_data at every process is to be used as part of a reduction operation.
Output, datatype global_data:
The value of global_data is to be determined by applying the indicated reduction operation to the values of local_data collected from the processes. Note that the value of global_data will be available to all processes in the communicator.
Input, integer count:
The number of items within local_data.
Input, integer datatype:
The type of the information in local_data and global_data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer operation:
specifies the reduction operation to be carried out, and should have a value of one of the predefined MPI operations.
Input, integer communicator:
The communicator, containing the processes within which the reduction computation is to be carried out.
Output, integer ierr:
The error status.


MPI_Alltoall

Call:
subroutine MPI_Alltoall ( send_buf, send_count, send_datatype, recv_buf, recv_count, recv_datatype, communicator, ierr )
Purpose:
MPI_Alltoall sends a distinct message from every process to every other process.
Discussion:
Each process has a send buffer containing all the data to be sent. The first chunk is sent to the first process and so on. The data received from the first process is stored in the first chunk of the receive buffer, and so on.
Arguments:
Input, datatype send_buf(send_count*num_procs):
The data to be sent.
Input, integer send_count:
The number of items to be sent to a single process.
Input, integer send_datatype:
The type of the information in send_buf.
Output, datatype recv_buf(recv_count*num_procs):
the data received.
Input, integer recv_count;
the number of items to be received from a single process.
Input, integer recv_datatype:
The type of the information in recv_buf.
Input, integer communicator:
The communicator containing the processes.
Output, integer ierr:
The error status.


MPI_Alltoallv

Call:
subroutine MPI_Alltoallv ( send_buf, send_counts, send_displs, send_datatype, recv_buf, recv_counts, recv_displs, recv_datatype, communicator, ierr )
Purpose:
MPI_Alltoallv sends a distinct message from every process to every other process. The messages can vary in size and displacement.
Discussion:
Each process has a send buffer containing all the data to be sent. Each message are defined by a displacement from the first index of the buffer, and a size. The data received is similarly given a specific displacement for storage in the receive buffer.
Arguments:
Input, datatype send_buf(*):
The data to be sent.
Input, integer send_counts(num_procs):
The number of items to be sent to each single process.
Input, integer send_displs(num_procs):
The displacement for each message, that is, the number of positions past the first entry of send_buf, at which the message starts.
Input, integer send_datatype:
The type of the information in send_buf.
Output, datatype recv_buf(*):
the data received.
Input, integer recv_counts(num_procs);
the number of items to be received from each process.
Input, integer recv_displs(num_procs):
The displacement for each message, that is, the number of positions past the first entry of recv_buf, at which the message is to be stored.
Input, integer recv_datatype:
The type of the information in recv_buf.
Input, integer communicator:
The communicator containing the processes.
Output, integer ierr:
The error status.


MPI_Attr_delete

Call:
subroutine MPI_Attr_delete ( communicator, keyval, ierr )
Purpose:
MPI_Attr_delete deletes an attribute that had been associated with a communicator.
Arguments:
Input, integer communicator:
The identifier of the communicator.
Input, integer keyval:
The key for the attribute, that was returned from a call to MPI_Keyval_create.
Output, integer ierr:
The error status.


MPI_Attr_get

Call:
subroutine MPI_Attr_get ( communicator, keyval, attribute_val, flag, ierr )
Purpose:
MPI_Attr_get retrieves an attribute value by key.
Discussion:
An attribute is assigned a value by a call to MPI_Attr_put.
Arguments:
Input, integer communicator:
The identifier of the communicator.
Input, integer keyval:
The key for the attribute.
Output, integer attribute_val:
The value of the attribute (if there was one).
Output, logical flag:
FALSE if there was no value assigned to the attribute; TRUE if the attribute had a value.
Output, integer ierr:
The error status.


MPI_Attr_put

Call:
subroutine MPI_Attr_put ( communicator, keyval, attribute_val, ierr )
Purpose:
MPI_Attr_put stores an attribute value by key.
Arguments:
Input, integer communicator:
The identifier of the communicator.
Input, integer keyval:
The key for the attribute.
Input, integer attribute_val:
The value to be assigned the attribute.
Output, integer ierr:
The error status.


MPI_Barrier

Call:
subroutine MPI_Barrier ( communicator, ierr )
Purpose:
MPI_Barrier forces all processes within the communicator to wait until they have all reached the barrier.
Discussion:
One use of MPI_Barrier is to reliably time a portion of your code.
Arguments:
Input, integer communicator:
The communicator containing the processes which are to "meet" at the barrier.
Output, integer ierr:
The error status.


MPI_Bcast

Call:
subroutine MPI_Bcast ( data, count, datatype, sender, communicator, ierr )
Purpose:
MPI_Bcast broadcasts data from one process to all others within a communicator.
Discussion:
It is not possible to receive a broadcast message by calling other routines, such as MPI_Recv.
Messages send by a broadcast do not have a tag; if several messages are transmitted in this way, they are simply received in the order sent.
This is a collective communication, so all the processes in the communicator must issue and participate in the command.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to all other processes within the communicator.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer sender;
The "id" of the process that is to send the value of data; the value of sender must be the rank of the process within the specified communicator.
Input, integer communicator:
The communicator within which the data is to be broadcast. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer ierr:
The error status.


MPI_Bsend

Call:
subroutine MPI_Bsend ( data, count, datatype, receiver, tag, communicator, ierr )
Purpose:
MPI_Bsend sends data from one process to another within a communicator, using buffering.
Discussion:
MPI_Send and other data transmittal routines may fail if a process is not ready to receive the data (and if there is no system buffer to hold the message). By using this routine, the user guarantees that data can be sent without error, being stored in a user-supplied buffer area until a process is ready to receive it. The user-supplied buffer area must be set up with a call to MPI_Buffer_attach. The process receiving the data should call MPI_Recv . Notice that the calling sequence here is identical to that for MPI_Send; the difference is behind the scenes, in the existence of the user buffer!
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer receiver;
The "id" of the process that is to receive the value of data; the value of receiver must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator.
Input, integer tag;
The "tag" for the message. The sender and receiver need to agree on the meaning of tags, or to ignore them.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer ierr:
The error status.


MPI_Buffer_attach

Call:
subroutine MPI_Buffer_attach ( buffer, size, ierr )
Purpose:
MPI_Buffer_attach sets up a buffer for data transmission via MPI_Bsend.
Discussion:
A process that calls MPI_Bsend one or more times must first have called this routine to set up a buffer. The buffer must be sufficiently large to hold, at one time, all the data that has been sent but not ret received.
Arguments:
Input, mpi_type buffer(*):
an array of sufficient size to store all the data that could have been sent by this process, but not yet received by another process, at any time during execution.
Input, integer size:
The total size of buffer measured in bytes. Typically, real and integer data will require 4 bytes per item, and double precision data 8 bytes. Thus, if you mean to have no more than 1,000 real values "in the air" at one time, then size should be specified as 4,000!
Output, integer ierr:
The error status.


MPI_Buffer_detach

Call:
subroutine MPI_Buffer_detach ( buffer, size, ierr )
Purpose:
MPI_Buffer_detach frees up the memory associated with a buffer that had been set up by a call to MPI_Buffer_attach.
Discussion:
The memory we are freeing here is simply internal MPI memory, not the memory represented by buffer itself. If you're using FORTRAN 90, you can make buffer allocatable, and deallocate it after calling this routine.
Arguments:
Input, mpi_type buffer(*):
the buffer array.
Input, integer size:
The total size of buffer measured in bytes.
Output, integer ierr:
The error status.


MPI_Cancel

Call:
subroutine MPI_Cancel ( request, ierr )
Purpose:
MPI_Cancel marks the operation associated with a request for cancellation.
Arguments:
Input, integer request:
the ID of the request to be cancelled.
Output, integer ierr:
The error status.


MPI_Cart_coords

Call:
subroutine MPI_Cart_coords ( communicator, rank, maxdims, coords, ierr )
Purpose:
MPI_Cart_coords returns the Cartesian "coordinates" of any process given its rank.
Comments:
To get the rank, you might first call MPI_Comm_rank. Using this routine, a process can inquire about its own coordinates. By inputting the rank of another process, a calling process can find out the coordinates of other processes as well. Compare the routine MPI_Cart_get.
Arguments:
Input, integer communicator:
The communicator associated with the Cartesian topology.
Input, integer rank:
The rank or "id" of the process. Normally, the calling process would supply its own rank, but it can actually inquire about any process by giving the appropriate rank.
Input, integer maxdims:
The maximum number of Cartesian dimensions; this simply has to be at least as big as ndims;
Output, integer coords(ndims):
contains the coordinates of this process in the Cartesian topology;
Output, integer ierr:
The error status.


MPI_Cart_create

Call:
subroutine MPI_Cart_create ( old_communicator, ndims, dims, periodic, reorder, new_communicator, ierr )
Purpose:
MPI_Cart_create creates a communicator for a Cartesian topology.
Comments:
This routine is used when the processes need to be arranged in a Cartesian grid (whether 1D, 2D, 3D or higher dimension). Other routines then make it easy to pass data to neighboring processes
Arguments:
Input, integer old_communicator:
The communicator, containing the processes that will form the new communicator.
Input, integer ndims:
The number of dimensions in the Cartesian topology.
Input, integer dims(ndims):
The number of processes in each Cartesian direction.
Input, logical periodic(ndims):
In each dimension, the corresponding entry of periodic is true if the last and first processes should also be connected; in 1D, for instance, this allows a line of processes to become connected like a circle.
Input, logical reorder:
Is true if MPI is free to reorder the processes from the default ordering that would normally be used. It's usually safe to choose this option.
Output, integer new_communicator:
The new communicator that should be used when the corresponding processes are to be thought of as a Cartesian grid.
Output, integer ierr:
The error status.


MPI_Cart_get

Call:
subroutine MPI_Cart_get ( communicator, maxdims, dims, periodic, coords, ierr )
Purpose:
MPI_Cart_get returns the "coordinates" of the calling process within the Cartesian topology.
Comments:
In a Cartesian topology, it is less useful to have the rank of a process, and more useful to have its Cartesian coordinates. Note that this routine can only supply information to the calling process about itself. To find out the coordinates of a different process, you might want to use MPI_Cart_coords.
Arguments:
Input, integer communicator:
The communicator associated with the Cartesian topology.
Input, integer maxdims:
The maximum number of Cartesian dimensions; this simply has to be at least as big as ndims;
Output, integer dims(ndims):
the dimensions of the Cartesian topology;
Output, logical periodic(ndims):
is true for each dimension in which the Cartesian topology is to be periodic;
Output, integer coords(ndims):
contains the coordinates of this process in the Cartesian topology;
Output, integer ierr:
The error status.


MPI_Cart_rank

Call:
subroutine MPI_Cart_rank ( communicator, coords, rank, ierr )
Purpose:
MPI_Cart_rank returns the rank of the calling process within the Cartesian topology.
Arguments:
Input, integer coords(ndims):
The grid coordinates of the process.
Output, integer rank:
The rank of the process
Output, integer ierr:
The error status.


MPI_Cart_shift

Call:
subroutine MPI_Cart_shift ( communicator, dim, shift, source, destination, ierr )
Purpose:
MPI_Cart_shift finds the destination and source for shifts in a Cartesian topology.
Comments:
In a Cartesian topology, a common operation is for every process to send data to a neighbor process, say the process to the left. This routine allows each process to determine destination, the process to which it will send data, and source, the process from which it may expect data.
Arguments:
Input, integer communicator:
The communicator associated with the Cartesian topology.
Input, integer dim:
The Cartesian dimension along which the shift will take place;
warning: zero-based arithmetic is used here! The first dimension is dimension 0 and so on!
Input, integer shift:
The size of the shift; in 1D, +1 means go one process to the right, -2 means go two processes to the left, and so on;
Output, integer source:
the identifier of the process which will send data to this process; if there is none (because of boundary conditions), then source will be set to MPI_PROC_NULL.
Output, integer destination:
the identifier of the process to which this process will send data; if there is none (because of boundary conditions), then destination will be set to MPI_PROC_NULL.
Output, integer ierr:
The error status.


MPI_Cart_sub

Call:
subroutine MPI_Cart_sub ( old_communicator, free_coords, new_communicator, ierr )
Purpose:
MPI_Cart_sub partitions a Cartesian grid into grids of lower dimension.
Comments:
This is one way to set up communicators for each row of a 2D array, for instance. The single call creates a communicator for each instance of a subgrid. The subgrids are indexed by the coordinates that are left free. Thus, to make a set of communicators for the rows, we say that the row index is free, and that the column index is fixed.
Arguments:
Input, integer old_communicator:
The communicator associated with the Cartesian topology.
Input, logical free_coords(ndims):
contains FALSE for each coordinate that is not free, and TRUE for each coordinate that is free;
Input, integer new_communicator:
The new communicator.
Output, integer ierr:
The error status.


MPI_Comm_compare

Call:
subroutine MPI_Comm_compare ( communicator1, communicator2, result, ierr )
Purpose:
MPI_Comm_compare compares two communicators.
Discussion:
The result of the comparison is:
Arguments:
Input, integer communicator1:
The first communicator.
Input, integer communicator2:
The second communicator.
Output, integer result:
The result of the comparison.
Output, integer ierr:
The error status.


MPI_Comm_create

Call:
subroutine MPI_Comm_create ( old_communicator, group, new_communicator, ierr )
Purpose:
MPI_Comm_create creates a new communicator from a given group of processes.
Discussion:
To create a new communicator from an old one, you must first find the identifier for the group of processes in the old communicator, then perform some operation such as exclusion to create a new group, and then you may call this routine with the identifier for the new group, to get the identifier for the new communicator.
Arguments:
Input, integer old_communicator:
The communicator shared by the processes.
Input, integer group:
The identifier for the group of processes that will form the new communicator.
Input, integer new_communicator:
The new communicator formed by the group of processes.
Output, integer ierr:
The error status.


MPI_Comm_dup

Call:
subroutine MPI_Comm_dup ( old_communicator, new_communicator, ierr )
Purpose:
MPI_Comm_dup makes a new communicator which has the same attributes as an already existing communicator.
Arguments:
Input, integer old_communicator:
The identifier of the already existing communicator.
Output, integer new_communicator:
The identifier of the new communicator.
Output, integer ierr:
The error status.


MPI_Comm_free

Call:
subroutine MPI_Comm_free ( communicator, ierr )
Purpose:
MPI_Comm_free "frees" a communicator, that is, ends the association between a group of processes and a communicator identifier.
Arguments:
Input, integer communicator:
The identifier of the communicator.
Output, integer ierr:
The error status.


MPI_Comm_group

Call:
subroutine MPI_Comm_group ( communicator, group, ierr )
Purpose:
MPI_Comm_group creates a communicator for a given group of processes.
Arguments:
Output, integer communicator:
The communicator created by this call.
Input, integer group:
The identifier for the group, which must have been created by a call to a routine such as MPI_Group_excl or MPI_Group_incl.
Output, integer ierr:
The error status.


MPI_Comm_rank

Call:
subroutine MPI_Comm_rank ( communicator, id, ierr )
Purpose:
MPI_Comm_rank reports the rank of the calling process.
Arguments:
Input, integer communicator:
The communicator within which the rank is desired. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer id:
The rank of the calling process within the given communicator. Ranks start at 0.
Output, integer ierr:
The error status.


MPI_Comm_size

Call:
subroutine MPI_Comm_size ( communicator, num_procs, ierr )
Purpose:
MPI_Comm_size reports the number of processes in a communicator.
Arguments:
Input, integer communicator:
The communicator whose size (number of processes) is desired. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer num_procs:
The number of processes within the given communicator.
Output, integer ierr:
The error status.


MPI_Comm_split

Call:
subroutine MPI_Comm_split ( old_communicator, split_key, rank_key, new_communicator, ierr )
Purpose:
MPI_Comm_split splits up a communicator, creating a number of communicators with the same ID, but with different values of a "split key".
Discussion:
Normally, every time you creat a new communicator you think up a new name for it. But in some cases, you want to make a lot of communicators, and you don't even know beforehand how many. This can happen, for instance, if you have an M by N array of processes, and you want to make a communicator for each row. MPI_Comm_split essentially allows you to use the same communicator name for all the new communicators, with the value of the split key working as an index to keep track of which new communicator you really want.
MPI_Comm_split is a collective function, so all processes in the communicator must issue and participate in the command.
Arguments:
Input, integer old_communicator:
The communicator whose processes are to be split up into new communicators.
Input, integer split_key:
The key which acts as an index, determining which version of the new communicator to assign this process to. If a particular process is not to be associated with a new communicator, then set split_key to MPI_UNDEFINED in this case;
Input, integer rank_key:
The rank of this process in the old communicator.
Output, integer new_communicator:
The communicator created by this call, which actually represents many communicators of the same name, but with different values of split_key. Those processes for which split_key was set to MPI_UNDEFINED will have new_communicator returned as MPI_COMM_NULL.
Output, integer ierr:
The error status.


MPI_Dims_create

Call:
subroutine MPI_Dims_create ( num_procs, ndims, dims, ierr )
Purpose:
MPI_Dims_create is used to set up a balanced Cartesian grid with any number of dimensions.
Discussion:
This routine requires that the product of the dimensions in dims be exactly equal to num_procs. This means, for instance, that you wouldn't want to use a prime value for num_procs, and that many suitable decompositions will be ignored because they don't use all the processes. Thus, 17 processes might be divided into a 17*1*1*1 "grid" instead of the more balanced "2*2*2*2" grid that leaves 1 process left out.
Arguments:
Input, integer num_procs:
The number of processes.
Input, integer ndims:
The number of spatial dimensions.
Input/output, integer dims(ndims);
On input, if any entry of dims is set to a positive value, then the routine will not change it; in this way, the user can force some elements of dims to have a particular value. Only those entries whose values are 0 will be altered. Negative input values will cause an error.
On output, the cartesian dimensions, that is, a suitable arrangement of the processes. The entries of dims are set to be as close to each other in size as possible, and their product is equal to num_procs.
Output, integer ierr:
The error status.


MPI_Finalize

Call:
subroutine MPI_Finalize ( ierr )
Purpose:
MPI_Finalize shuts down the MPI library. It must be the last MPI routine called.
Arguments:
Output, integer ierr:
The error status.


MPI_Gather

Call:
subroutine MPI_Gather ( send_data, send_count, send_datatype, recv_data, recv_count, recv_datatype, root, communicator, ierr )
Purpose:
MPI_Gather gathers data from all the processes in a communicator.
Discussion:
Each of the processes is assumed to have a set of data. This call collects a copy of each set of data into a single big vector, on the root process.
The data is stored in process rank order; that is, the data from process 0 is stored first, followed by that from process 1, and so on.
This is a collective communication, so all processes must issue the command and participate.
The inverse operation is MPI_Scatter.
Arguments:
Input, send_datatype send_data(send_count):
the data residing on the local process which is to be sent to the root process.
Input, integer send_count:
The number of items in send_data.
Input, integer send_datatype:
The type of the information in send_data. The value of send_type should be a standard MPI datatype or else a derived datatype.
Output, recv_datatype recv_data(*):
is used on the root process, to receive the gathered data. Note that the actual dimension required for recv_data is num_procs * send_count.
Input, integer recv_count:
The number of items expected from each process. Normally, this would be the same as send_count.
Input, integer recv_datatype:
The type of the information in recv_data. Normally, this would be the same as send_datatype.
Input, integer root;
The process that is to receive the values of recv_data
Input, integer communicator:
The communicator that includes all the processes (including root).
Output, integer ierr:
The error status.


MPI_Gatherv

Call:
subroutine MPI_Gatherv ( send_data, send_count, send_datatype, recv_data, recv_counts, displs, recv_datatype, root, communicator, ierr )
Purpose:
MPI_Gatherv gathers messages of varying size from all the processes in a communicator.
Discussion:
Each of the processes is assumed to have a message for process root. These messages may be of varying size. This call collects a copy of each set of data into a single big vector, on the root process.
This is a collective communication, so all processes must issue the command and participate.
The inverse operation is MPI_Scatter.
Arguments:
Input, send_datatype send_data(send_count):
the data residing on the local process which is to be sent to the root process.
Input, integer send_count:
The number of items in send_data.
Input, integer send_datatype:
The type of the information in send_data. The value of send_type should be a standard MPI datatype or else a derived datatype.
Output, recv_datatype recv_data(*):
is used on the root process, to receive the gathered data.
Input, integer recv_counts(num_procs):
The number of items expected from each process. Note that this quantity can vary from one process to the next.
Input, integer displs(num_procs):
The displacements for each message, measure from the first entry of recv_data. The message from process I should be stored starting in location recv_data(1+displ(I)).
Input, integer recv_datatype:
The type of the information in recv_data. Normally, this would be the same as send_datatype.
Input, integer root;
The process that is to receive the values of recv_data
Input, integer communicator:
The communicator that includes all the processes (including root).
Output, integer ierr:
The error status.


MPI_Get_count

Call:
subroutine MPI_Get_count ( status, datatype, count, ierr )
Purpose:
MPI_Get_count reports the actual number of items transmitted in a communication.
Arguments:
Input, integer status(MPI_STATUS_SIZE):
the status vector returned from the communication call.
Input, integer datatype:
The type of the information that was transferred
Output, integer count;
the number of items of the given datatype that were transferred.
Output, integer ierr:
The error status.


MPI_Group_compare

Call:
subroutine MPI_Group_compare ( group1, group2, result, ierr )
Purpose:
MPI_Group_compare compares two groups.
Discussion:
The result of the comparison is:
Arguments:
Input, integer group1:
the identifier of group1;
Input, integer group2:
the identifier of group2.
Output, integer result:
the result of the comparison.
Output, integer ierr:
The error status.


MPI_Group_difference

Call:
subroutine MPI_Group_difference ( group1, group2, new_group, ierr )
Purpose:
MPI_Group_difference creates a new group of processes from those which are in group1 but not in group2.
Arguments:
Input, integer group1:
the identifier of group1;
Input, integer group2:
the identifier of group2.
Output, integer new_group:
the processes of a new group, comprising all the processes that are in group1 but not in group2;
Output, integer ierr:
The error status.


MPI_Group_excl

Call:
subroutine MPI_Group_excl ( old_group, n, exclude, new_group, ierr )
Purpose:
MPI_Group_excl creates a new group of processes from an old group by exclusion.
Arguments:
Input, integer old_group:
The identifier of the old group, which may have been reported by MPI_Comm_group.
Input, integer n:
The number of processes in the old group that are to be excluded in the new group.
Input, integer exclude(n):
The processes of the old group that are to be excluded from the new group.
Output, integer new_group:
The identifier for the new group.
Output, integer ierr:
The error status.


MPI_Group_free

Call:
subroutine MPI_Group_free ( group, ierr )
Purpose:
MPI_Group_free "frees" a group, that is, ends the association between a set of processes and a group identifier.
Arguments:
Input, integer group:
The identifier of the group.
Output, integer ierr:
The error status.


MPI_Group_incl

Call:
subroutine MPI_Group_incl ( old_group, n, include, new_group, ierr )
Purpose:
MPI_Group_incl creates a new group of processes from an old group by inclusion.
Arguments:
Input, integer old_group:
The identifier of the old group, which may have been reported by MPI_Comm_group.
Input, integer n:
The number of processes in the old group that are to be included in the new group.
Input, integer include(n):
The processes of the old group that are to be included in the new group.
Output, integer new_group:
The identifier for the new group.
Output, integer ierr:
The error status.


MPI_Group_intersection

Call:
subroutine MPI_Group_intersection ( group1, group2, new_group, ierr )
Purpose:
MPI_Group_intersection creates a new group of processes from the intersection of two groups.
Arguments:
Input, integer group1:
the identifier of group1;
Input, integer group2:
the identifier of group2.
Output, integer new_group:
the processes of a new group, comprising all the processes that are in both group1 and group2;
Output, integer ierr:
The error status.


MPI_Group_rank

Call:
subroutine MPI_Group_rank ( group, rank, ierr )
Purpose:
MPI_Group_rank returns the rank of the calling process in a group.
Arguments:
Input, integer group:
The identifier of the group.
Output, integer rank:
the rank of the calling process in the group.
Output, integer ierr:
The error status.


MPI_Group_size

Call:
subroutine MPI_Group_size ( group, size, ierr )
Purpose:
MPI_Group_size returns the number of processes in a group.
Arguments:
Input, integer group:
The identifier of the group.
Output, integer size:
the number of processes in the group.
Output, integer ierr:
The error status.


MPI_Group_union

Call:
subroutine MPI_Group_union ( group1, group2, new_group, ierr )
Purpose:
MPI_Group_union creates a new group of processes from the union of two groups.
Arguments:
Input, integer group1:
the identifier of group1;
Input, integer group2:
the identifier of group2.
Output, integer new_group:
the processes of a new group, comprising all the processes that are in either group1 or group2;
Output, integer ierr:
The error status.


MPI_Ibsend

Call:
subroutine MPI_Ibsend ( data, count, datatype, receiver, tag, communicator, request, ierr )
Purpose:
MPI_Ibsend is a buffered non-blocking send of data.
Discussion:
The user-supplied buffer area must be set up with a call to MPI_Buffer_attach. The routine returns immediately, without checking to see if the data has been received. MPI_Bsend is the blocking version of this routine.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer receiver;
The "id" of the process that is to receive the value of data; the value of receiver must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator.
Input, integer tag;
The "tag" for the message. The sender and receiver need to agree on the meaning of tags, or to ignore them.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer request:
a handle, which can be used to determine if the data has been received yet. Simply call MPI_Test or MPI_Wait, and include the request handle.
Output, integer ierr:
The error status.


MPI_Init

Call:
subroutine MPI_Init ( ierr )
Purpose:
MPI_Init initializes the MPI library. It must be the first MPI routine called.
Arguments:
Output, integer ierr:
The error status.


MPI_Initialized

Call:
subroutine MPI_Initialized ( flag, ierr )
Purpose:
MPI_Initialized reports whether MPI has been initialized by a call to MPI_Init.
Arguments:
Output, logical flag:
is TRUE if MPI has been initialized, and FALSE otherwise.
Output, integer ierr:
The error status.


MPI_Irecv

Call:
subroutine MPI_Irecv ( data, count, datatype, sender, tag, communicator, request, ierr )
Purpose:
MPI_Irecv receives data from another process within a communicator.
Discussion:
The data should have been sent by a call to MPI_Isend, which is a non-blocking send. MPI_Irecv returns "immediately", whether or not the data has been received yet. Thus, it is up to the user to use the request argument to determine if the data has been received, and if not, to wait at some point. Routines such as MPI_Wait and MPI_Test can be used for this task.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer sender;
The "id" of the process that is to send the value of data; the value of sender must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator. If sender is given the value MPI_ANY_SOURCE then no source checking is done.
Input, integer tag;
The "tag" for the message. There may be many messages directed to this process, but the routine will only accept a message that has the specified tag. If tag is given the value MPI_ANY_TAG then no tag checking is done.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer request:
a handle, which can be used to determine if the data has been received yet. Simply call MPI_Test or MPI_Wait, and include the request handle.
Output, integer ierr:
The error status.


MPI_Irsend

Call:
subroutine MPI_Irsend ( data, count, datatype, receiver, tag, communicator, request, ierr )
Purpose:
MPI_Irsend is a non-blocking "ready send" of data.
Discussion:
The "ready send" option can be used on certain machines, such as the Intel Paragon and the TMC CM-5, in which the communication protocol is greatly simplified when the sending process can be certain that the receiving process has already posted its receive request. On other machines, the MPI implementation may treat this as a call to "MPI_Isend".
The blocking version of this routine is MPI_Rsend.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer receiver;
The "id" of the process that is to receive the value of data; the value of receiver must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator.
Input, integer tag;
The "tag" for the message. The sender and receiver need to agree on the meaning of tags, or to ignore them.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer request:
a handle, which can be used to determine if the data has been received yet. Simply call MPI_Test or MPI_Wait, and include the request handle.
Output, integer ierr:
The error status.


MPI_Isend

Call:
subroutine MPI_Isend ( data, count, datatype, receiver, tag, communicator, request, ierr )
Purpose:
MPI_Isend is a nonblocking send of data.
Discussion:
MPI_Isend uses nonblocking communication. In other words, the routine sends the data, and does not wait to see if the intended recipient has started to receive it, but instead, returns immediately. Thus, the user must use the request argument to determine if the data has been received, and if not, to wait at some point. Routines such as MPI_Wait and MPI_Test can be used for this task. The program can do some other work while waiting, but it must not overwrite the data being transferred until it has been received! The receiving process should call MPI_Irecv.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process. Note that the quantities in data should not be altered until the receiving process has received them, an event which cannot be guaranteed to have happened at the time that MPI_Isend returns to the calling process!
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer receiver;
The "id" of the process that is to receive the value of data; the value of receiver must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator.
Input, integer tag;
The "tag" for the message. The sender and receiver need to agree on the meaning of tags, or to ignore them.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer request:
a handle, which can be used to determine if the data has been received yet. Simply call MPI_Test or MPI_Wait, and include the request handle.
Output, integer ierr:
The error status.


MPI_Issend

Call:
subroutine MPI_Issend ( data, count, datatype, receiver, tag, communicator, request, ierr )
Purpose:
MPI_Issend is a synchronous non-blocking send of data.
Discussion:
Using synchronous mode, the send operation can begin whether or not the matching receive operation has been posted yet. Until the matching receive operation is posted, however, the send operation will not complete, and the routine will not return.
The blocking version of this routine is MPI_Ssend.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer receiver;
The "id" of the process that is to receive the value of data; the value of receiver must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator.
Input, integer tag;
The "tag" for the message. The sender and receiver need to agree on the meaning of tags, or to ignore them.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer request:
a handle, which can be used to determine if the data has been received yet. Simply call MPI_Test or MPI_Wait, and include the request handle.
Output, integer ierr:
The error status.


MPI_Keyval_create

Call:
subroutine MPI_Keyval_create ( copy_fn, delete_fn, key_ptr, extra_arg, ierr )
Purpose:
MPI_Keyval_create creates a key (or handle) for a new attribute to be associated with a communicator.
Discussion:
You may want to associate some attribute with a communicator, such as the rank of the special process that you have assigned to do I/O. This call allows you to set up such an attribute.
Arguments:
Input, external copy_fn:
the attribute copy function to be used to copy the data if the communicator is duplicated (in which case the attribute will have to be copied too);
Input, external delete_fn:
the attribute delete function used to free up memory associated with the attribute, if the communicator is freed.
Output, integer keyval:
a handle for the attribute.
Input, integer extra_state:
an extra argument used by the copy and delete functions.
Output, integer ierr:
The error status.


MPI_Op_create

Call:
subroutine MPI_Op_create ( op_fun, commutes, op_id, ierr )
Purpose:
MPI_Op_create allows the user to get an ID for a new reduction operation.
Discussion:
Once an ID has been acquired, the newly defined reduction operation can be carried out by routines like MPI_Reduce.
The operation must be associative, as, for example with addition, where:
( A + B ) + C = A + ( B + C )
Arguments:
Input, external op_fun:
the reduction operation routine, defined by the user, that carries out the operation.
Input, logical commutes:
is TRUE if the operation is commutative (as in A+B = B+A), and FALSE if it is not commutative (as in A/B /= B/A). If the operation is not commutative, then it will be carried out in strict process-rank order.
Output, integer op_id:
an ID, or handle, for the operation, which should be used as the operation-defining argument to any MPI reduction routine;
Output, integer ierr:
The error status.


MPI_Op_free

Call:
subroutine MPI_Op_free ( op_id, ierr )
Purpose:
MPI_Op_free frees the memory associated with a user-defined reduction operation.
Discussion:
This call discards the memory that had been set aside for the definition of a user-defined reduction operation by a call to MPI_Op_create.
Arguments:
Input, integer op_id:
the ID, or handle, for the operation;
Output, integer ierr:
The error status.


MPI_Pack

Call:
subroutine MPI_Pack ( data, count, datatype, buffer, buffer_size, buffer_position, communicator, ierr )
Purpose:
MPI_Pack packs data into a buffer.
Discussion:
Once all the data has been packed, it may be transmitted by any routine, such as MPI_Send, using an MPI Datatype of MPI_PACKED.
A routine that receives packed data must unpack it by calling MPI_Unpack.
Arguments:
Input, datatype data(count):
Information that is to be packed into the buffer.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input/output, integer buffer(buffer_size/4);
is an array into which the data is to be packed. FORTRAN will expect buffer to be declared with a standard type, so you can declare it as an integer variable of a given size. MPI_Pack will want to know the size of this array, as measured in bytes. Integers are normally equivalent to 4 bytes.
Input, integer buffer_size;
the size of the buffer, as measured in bytes.
Input/output, integer buffer_position;
a pointer to the next free location in the buffer. On first call, you would normally set buffer_position=0. Each time the routine is called to pack more data into the buffer, the pointer is updated. So the only thing you have to do is reset the value to 0 if you have transmitted your data, and want to pack some new things into the buffer.
Input, integer communicator:
The communicator which will be using the buffer to transmit the packed data.
Output, integer ierr:
The error status.


MPI_Pack_size

Call:
subroutine MPI_Pack_size ( count, datatype, communicator, size, ierr )
Purpose:
MPI_Pack_size reports the size of the buffer needed to hold a set of packed data.
Discussion:
Often the user will pack data of several different datatypes into one buffer. Simply call MPI_Pack_size once for each datatype to be packed (along with the number of items of that datatype), and add up the resulting sizes. The total will be the size in bytes needed to pack all the data at one time.
Arguments:
Input, integer count:
The number of items of the given datatype to be packed.
Input, integer datatype:
The datatype of the information. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer communicator:
The communicator which will be using the buffer to transmit the packed data.
Output, integer size;
the size of the buffer, measured in bytes, necessary to pack the given amount of data.
Output, integer ierr:
The error status.


MPI_Probe

Call:
subroutine MPI_Probe ( sender, tag, communicator, status, ierr )
Purpose:
MPI_Probe allows you to check whether a message has been sent, and is ready to be received, without actually receiving it yet.
Discussion:
There are situations where you want to know if a message is ready to be received, and the amount of data coming, so that you can set aside space for it before you go ahead and receive it. You can do this with a combination of MPI_Probe (to get the status array) and MPI_Get_count(to examine the status array and tell you how many items are in the message). Then you can allocate space and call MPI_Recv.
Arguments:
Input, integer sender;
The "id" of the process that is to send the value of data; the value of sender must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator. If sender is given the value MPI_ANY_SOURCE then no source checking is done.
Input, integer tag;
The "tag" for the message. There may be many messages directed to this process, but the routine will only accept a message that has the specified tag. If tag is given the value MPI_ANY_TAG then no tag checking is done.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer status(MPI_STATUS_SIZE):
Returns information about the message received, useful if MPI_ANY_SOURCE or MPI_ANY_TAG was specified:
  • status(MPI_TAG) is the actual tag of the message received;
  • status(MPI_SOURCE) is the actual sending process of the message received;
Output, integer ierr:
The error status.


MPI_Recv

Call:
subroutine MPI_Recv ( data, count, datatype, sender, tag, communicator, status, ierr )
Purpose:
MPI_Recv receives data from another process within a communicator.
Discussion:
The data should have been sent by a call to MPI_Send.
Arguments:
Input, datatype data(count):
A scalar or vector, whose type and size will be specified. The value of data, as determined by the sending process, is to be passed to the receiving process.
Input, integer count:
The number of items within data.
Input, integer datatype:
The type of the information in data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer sender;
The "id" of the process that is to send the value of data; the value of sender must be the rank of the process within the specified communicator. Both the sending and receiving process must be part of the communicator. If sender is given the value MPI_ANY_SOURCE then no source checking is done.
Input, integer tag;
The "tag" for the message. There may be many messages directed to this process, but the routine will only accept a message that has the specified tag. If tag is given the value MPI_ANY_TAG then no tag checking is done.
Input, integer communicator:
The communicator, of which both the sender and receiver are members. This is often simply MPI_COMM_WORLD, the communicator of all processes.
Output, integer status(MPI_STATUS_SIZE):
Returns information about the message received, useful if MPI_ANY_SOURCE or MPI_ANY_TAG was specified:
  • status(MPI_TAG) is the actual tag of the message received;
  • status(MPI_SOURCE) is the actual sending process of the message received;
Output, integer ierr:
The error status.


MPI_Reduce

Call:
subroutine MPI_Reduce ( local_data, global_data, count, datatype, operation, receiver, communicator, ierr )
Purpose:
MPI_Reduce carries out a reduction operation (such as sum, maximum, or product).
Comments:
The first two arguments must not overlap or share memory in any way.
Compare this routine with MPI_Allreduce, in which all processes receive the final result.
Arguments:
Input, datatype local_data(count):
A scalar or vector, whose type and size will be specified. The value of local_data at every process is to be used as part of a reduction operation.
Output (to receiver), datatype global_data:
The value of global_data is to be determined by applying the indicated reduction operation to the values of local_data collected from the processes. Note that the value of global_data will only be available on the receiver process.
Input, integer count:
The number of items within local_data.
Input, integer datatype:
The type of the information in local_data and global_data. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer operation:
specifies the reduction operation to be carried out, and should have a value of one of the predefined MPI operations.
Input, integer receiver;
The "id" of the process that is to collect the values of local_data, and to form the value of global_data; receiver must be a process within the specified communicator.
Input, integer communicator:
The communicator, containing the processes within which the reduction computation is to be carried out.
Output, integer ierr:
The error status.


MPI_Reduce_scatter

Call:
subroutine MPI_Reduce_scatter ( send_buf, recv_buf, recv_counts, datatype, operation, communicator, ierr )
Purpose:
MPI_Reduce_scatter collects a message of the same length from each process. These might be thought of as columns of a 2D array. It then applies a reduction operation to each row of the array. The resulting column of data is scattered across the processes in rank order, with each process getting a user-specified number of the entries.
Note that there is no distinguished or special process in this call; all processes are treated equally.
Comments:
The first two arguments must not overlap or share memory in any way.
Arguments:
Input, datatype send_buf(send_count):
the data which each process contributes. The value of send_count, the number of items in send_buf is determined implicitly as the sum of the entries of recv_counts. It is the same on all processes.
Output, datatype recv_buf(recv_count(i)):
the data returned from the reduction operation. Process I receives recv_count(I) values.
Input, integer recv_count(num_procs):
The number of items of the reduced data that are to be sent to each process.
Input, integer datatype:
The type of the information. The value of datatype should be a standard MPI datatype or else a derived datatype.
Input, integer operation:
specifies the reduction operation to be carried out, and should have a value of one of the predefined MPI operations.
Input, integer communicator:
The communicator, containing the processes within which the reduction computation is to be carried out.
Output, integer ierr:
The error status.


MPI_Request_free

Call:
subroutine MPI_Request_free ( request, ierr )
Purpose:
MPI_Request_free releases the memory associated with a request.
Arguments:
Input/output, integer request:
On input, the ID of the request to be freed up. On output, the ID has been set to that of MPI_REQUEST_NULL.
Output, integer ierr:
The err