next up previous contents
Next: MPICOMMSIZE MPI Communicator Size Up: MPI Functions Previous: MPIRECV MPI Receive Array   Contents

Subsections

MPICOMMRANK MPI Communicator Rank

Usage

This function returns the rank of a process within the specified communicator. The general syntax for its use is

   y = mpicommrank(comm)

where comm is the communicator to use. If no communicator is provided, then MPI_COMM_WORLD is used. The returned value y is the rank of the current process in the communicator.

Example

Here is a simple example of using mpicommrank to obtain the process rank. It defaults to 0, because the process is the root of the group (which contains only itself).

--> mpiinit
--> mpicommrank
ans = 
  <int32>  - size: [1 1]
             0



Samit K. Basu 2005-03-16