Procedure Specification

Procedure Specification


Up: MPI Terms and Conventions Next: Semantic Terms Previous: Document Notation

MPI procedures are specified using a language independent notation. The arguments of procedure calls are marked as IN, OUT or INOUT. The meanings of these are:

  • the call uses but does not update an argument marked IN,
  • the call may update an argument marked OUT,
  • the call both uses and updates an argument marked INOUT.

There is one special case --- if an argument is a handle to an opaque object (these terms are defined in Section Opaque objects ), and the object is updated by the procedure call, then the argument is marked OUT. It is marked this way even though the handle itself is not modified --- we use the OUT attribute to denote that what the handle references is updated.

The definition of MPI tries to avoid, to the largest possible extent, the use of INOUT arguments, because such use is error-prone, especially for scalar arguments.

A common occurrence for MPI functions is an argument that is used as IN by some processes and OUT by other processes. Such argument is, syntactically, an INOUT argument and is marked as such, although, semantically, it is not used in one call both for input and for output.

Another frequent situation arises when an argument value is needed only by a subset of the processes. When an argument is not significant at a process then an arbitrary value can be passed as argument.

Unless specified otherwise, an argument of type OUT or type INOUT cannot be aliased with any other argument passed to an MPI procedure. An example of argument aliasing in C appears below. If we define a C procedure like this,

void copyIntBuffer( int *pin, int *pout, int len ) 
{   int i; 
    for (i=0; i<len; ++i) *pout++ = *pin++; 
} 
then a call to it in the following code fragment has aliased arguments.
int a[10]; 
copyIntBuffer( a, a+3, 7); 
Although the C language allows this, such usage of MPI procedures is forbidden unless otherwise specified. Note that Fortran prohibits aliasing of arguments.

All MPI functions are first specified in the language-independent notation. Immediately below this, the ANSI C version of the function is shown, and below this, a version of the same function in Fortran 77.



Up: MPI Terms and Conventions Next: Semantic Terms Previous: Document Notation


Return to MPI Standard Index
Return to MPI home page