[Mpi3-tools] Standardized MPI_COMM_WORLD rank environment variable?

Jeffrey Squyres jsquyres at cisco.com
Tue Apr 24 14:03:21 CDT 2012

Rayson Ho has been working with a few tools recently (e.g., Google's gperftools) that do things like profile (MPI) processes and then output files with meta data about the run.  Valgrind does analogous things.

The problem is that if all the MPI processes are running in the same networked filesystem directory, they need a way to write unique output filenames.

A common way to solve this has been to include the process' MPI_COMM_WORLD rank somewhere in the filename.  Open MPI's run time sets the OMPI_COMM_WORLD_RANK environment variable with that proc's MPI_COMM_WORLD rank.  Likewise, MPICH2 sets the PMI_RANK environment variable.

These env variables can then be used to form the tool's output filename, and all is well.

My question is: is it worth it to standardize an environment variable name (or some other mechanism) for a tool to get an MPI process' rank in MPI_COMM_WORLD?

I admit that this gets murkier when there are multiple MPI processes per OS process, but that problem, too, will need to be solved by the tools...

Jeff Squyres
jsquyres at cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/

More information about the mpiwg-tools mailing list