What is a simple way to create a (sub)communicator containing consecutive ranks [rStart, ..., last rank of MPI_COMM_WORLD] of MPI_COMM_WORLD?
rStart is >= 0, i.e., first rStart ranks need to be excluded.
What is a simple way to create a (sub)communicator containing consecutive ranks [rStart, ..., last rank of MPI_COMM_WORLD] of MPI_COMM_WORLD?
rStart is >= 0, i.e., first rStart ranks need to be excluded.
The simplest code is to have
run on all ranks of
MPI_COMM_WORLD. It will create two communicators - all ranks starting withrStartwill get the one you desire, the others can justMPI_Comm_freetheir communicator.If you cannot easily have the excluded ranks run the same code, you can use
MPI_Comm_create_group, but then you have to also create the group first.