PMI_RANK and PMI_SIZE look to me like what you want and one of my Intel colleagues had the same answer in response to a similar question regarding Intel MPI, which also uses Hydra (https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/703734).

I'm sure you know that all of this is non-standard and relying on it is inherently non-portable.

Jeff

On Sun, Feb 3, 2019 at 1:40 PM Brice Goglin via discuss <discuss@mpich.org> wrote:
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



_______________________________________________
discuss mailing list     discuss@mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


--