How can my program detect, whether it was launch via mpirun

前端 未结 2 745
遥遥无期
遥遥无期 2020-12-11 18:19

How can my MPI program detect, if it was launched as a standalone application or via mpirun?

2条回答
  •  生来不讨喜
    2020-12-11 19:05

    There is no MPI standard way to tell the difference between an MPI application that is launched directly, or as a single rank with mpirun. See "Singleton MPI_Init" for more on this kind of MPI job.

    The environment variable checking answer from Douglas is a reasonable hack...but is not portable to any other MPI implementation.

提交回复
热议问题