I work with MPI programs on an SMP supercomputer. I would like to determine which processes use the same node, for example, by setting an integer key equal in all processes to the same node and different from node to another. The goal is to use this key to separate the communicator and the presence of sub-communicators that collect only processes in the same node.
So the function will look like
int identify_node(MPI_Comm* comm);
Assuming a simple distribution of processes such as 0,1,2,3 on node_1, 4,5,6,7 on node_2, etc., this is a matter of a simple formula, but I would like to achieve the same result without assuming distribution.
I have an idea how to do this using MPI_Get_processor_name: calculating the hash of the name and not assuming that no two names will get the same hash (I don't like this, because if one day I have two names with the same hash, there will be itβs difficult to track down the problem) or use some kind of coordination algorithm between processes (which I donβt know yet).
How would you do it (efficiently, if possible)?
Mathieu
source
share