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

前端 未结 2 738
遥遥无期
遥遥无期 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 18:58

    Considering the answer and comments by semiuseless and Hristo Iliev, there is no general and portable way to do this. As a workaround, you can check for environment variables that are set by mpirun. See e.g.:
    http://www.open-mpi.org/faq/?category=running#mpi-environmental-variables

提交回复
热议问题