mpi :: Comm :: defaultinit
# An MPI communicator
extern class Comm `{ MPI_Comm `}
# The _null_ communicator, targeting no processors
new null_ `{ return MPI_COMM_NULL; `}
# The _world_ communicator, targeting all processors
new world `{ return MPI_COMM_WORLD; `}
# The _self_ communicator, targeting this processor only
new self_ `{ return MPI_COMM_SELF; `}
# Number of processors in this communicator
fun size: Int `{
int size;
MPI_Comm_size(self, &size);
return size;
`}
# Rank on this processor in this communicator
fun rank: Rank `{
int rank;
MPI_Comm_rank(self, &rank);
return rank;
`}
end
lib/mpi/mpi.nit:166,1--190,3