Learn R Programming

npRmpi (version 0.60-20)

mpi.comm.size: MPI_Comm_c2f, MPI_Comm_dup, MPI_Comm_rank, and MPI_Comm_size APIs

Description

mpi.comm.c2f converts the comm (a C communicator) and returns an integer that can be used as the communicator in external FORTRAN code. mpi.comm.dup duplicates (copies) a comm to a new comm. mpi.comm.rank returns its rank in a comm. mpi.comm.size returns the total number of members in a comm.

Usage

mpi.comm.c2f(comm=1)
  mpi.comm.dup(comm, newcomm)
  mpi.comm.rank(comm = 1)
  mpi.comm.size(comm = 1)

Value

  • mpi.comm.c2f: integer communicator for use in FORTRAN code.

  • mpi.comm.dup: integer identifier of the duplicated communicator.

  • mpi.comm.rank: integer rank within the communicator.

  • mpi.comm.size: integer size of the communicator.

Arguments

comm

a communicator number

newcomm

a new communicator number

Author

Hao Yu

References

https://www.mpich.org/, https://www.mpich.org/static/docs/latest/www3/

Examples

Run this code
if (FALSE) {
## Not run in checks when toggled to dontrun: communicator examples are
## documented for manual MPI sessions.
mpi.comm.rank(comm=0)
mpi.comm.size(comm=0)
mpi.comm.dup(comm=0, newcomm=5)
} 

Run the code above in your browser using DataLab