Detect if code is run with 'srun' #372
-
Hi dear community, I am running code on different HPC's and struggle with the following. Assume I have a file
Everything works great when I I am thinking of something along
My current workaround is to set my own os.environ['dont_use_MPI'], but I am thinking there should be a better way? Hope someone can help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Looks like your MPI implementation is using PMI for process management. If that is the case, you can use: import os
if "PMI_SIZE" in os.environ:
from mpi4py import MPI
else:
MPI = None |
Beta Was this translation helpful? Give feedback.
Looks like your MPI implementation is using PMI for process management. If that is the case, you can use: