MPI_COMM_SIZE, MPI_Comm_size Purpose Returns the size of the group associated with a communicator. C synopsis #include int MPI_Comm_size(MPI_Comm comm,int *size); C++ synopsis #include mpi.h int MPI::Comm::Get_size() const; FORTRAN synopsis include 'mpif.h' or use mpi MPI_COMM_SIZE(INTEGER COMM,INTEGER SIZE,INTEGER IERROR) Parameters comm is the communicator (handle) (IN) size is an integer specifying the number of tasks in the group of comm (OUT) IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine returns the size of the group associated with a communicator. MPI_COMM_SIZE is a shortcut to: * accessing the communicator's group with MPI_COMM_GROUP, * computing the size using MPI_GROUP_SIZE, and * freeing the temporary group using MPI_GROUP_FREE. If comm is an intercommunicator, size will be the size of the local group. To determine the size of the remote group of an intercommunicator, use MPI_COMM_REMOTE_SIZE. You can use this subroutine with MPI_COMM_RANK to determine the amount of concurrency available for a specific library or program. MPI_COMM_RANK indicates the rank of the task that calls it in the range from 0...size - 1, where size is the return value of MPI_COMM_SIZE. The rank and size information can then be used to partition work across the available tasks. Notes This function indicates the number of tasks in a communicator. For MPI_COMM_WORLD, it indicates the total number of tasks available. Errors Invalid communicator MPI not initialized MPI already finalized Related information MPI_COMM_GROUP MPI_COMM_RANK MPI_COMM_REMOTE_SIZE MPI_GROUP_FREE MPI_GROUP_SIZE