[mpich-discuss] finding the rank of processes from their environment?

Brice Goglin Brice.Goglin at inria.fr
Sun Feb 3 08:24:20 CST 2019


Hello

Is there a way to find out the rank of a process (in COMM_WORLD) by
looking at its environment? We use this feature in OpenMPI and srun for
displaying the placement of ranks in hwloc tools. By default, we display
the PID, but displaying the commworld rank is more useful. Looking in
/proc/<pid>/environ is an easy way to find environment variables, but I
could not find a clear solution for MPICH.

I tried on several machines with different mpich installations. In one
case, I found a MPI_LOCALRANKID (which isn't exactly what I want but
could be sufficient). There's also PMI_RANK, which may be identical to
the commworld rank?

Thanks for the help

Brice






More information about the discuss mailing list