MPI rank generalization for MPI groups?

Is there any generalization of rank number to group numbers? For my code, I would like to create a hierarchical decomposition of MPI :: COMM_WORLD. Suppose we use 16 threads. I use MPI :: COMM_WORLD.Split to create 4 communicators, each of which has 4 digits. Is there now an MPI function that provides some unique identifiers for the respective four groups?

+3
source share
2 answers

Well, you can still reference each process by its original rank in MPI_COMM_WORLD. You also have full control over what each process gets in its new communicator through the arguments colorand key MPI_Comm_split(). This is a lot of information to create a comparison between old ranks and new groups / ranks.

+5
source

If you don't like @suszterpatt's answer (I know), you can always abuse the Cartesian communicator and pretend that the process in index (2,3) in the communicator is process 3 in group 2 of your hierarchical decomposition.

But do not read this and do not take away the impression that I recommend such abuse, this is just a thought.

+1
source

All Articles