This seems like a good suggestion for the kind of sanity checking that an mpirun could do, though I'm sure how.  If an executable is statically linked, there would have to be some kind of signature that mpirun could deduced from, e.g., "strings" on the executable.  Or, mpirun and the MPI library could cooperate, e.g., mpirun could define some environment variable that MPI_Init() validated.  This could be spoofed, I suppose.  But, a simplistic implementation might be all that is required to satisfy Jeff's request.

Larry Baker
US Geological Survey
650-329-5608
baker@usgs.gov



On 22 Apr 2014, at 2:48 PM, Jeff Hammond wrote:

Does anyone know of a good way to detect when the user has built an
MPI application with mpicc from implementation A and tries to launch
with mpirun/mpiexec from implementation B?

I know that inside of the application, I can use either
MPI_Get_library_version or preprocessor info to know what
implementation I am using.  But can I discover anything about mpirun
inside of the application?  Is there anything in the environment that
I can query to know if my PM is Hydra, for example?  If not, can that
be added?

This is a relatively common user error that leads to very bad things
in some cases so it would be nice to be able to detect it and throw a
warning/error.

Thanks,

Jeff

--
Jeff Hammond
jeff.science@gmail.com