os.environ['_'] contains info about what called the python command, thus, for srun python3 file.py, it will read /path/to/srun.
I believe this is the equivalent of
cond4mpi4py = not has_key('NERSC_HOST') or (has_key('NERSC_HOST') and has_key('SLURM_SUBMIT_DIR'))
on NERSC, and also works on CSCS.
os.environ['_']
contains info about what called the python command, thus, forsrun python3 file.py
, it will read/path/to/srun
.I believe this is the equivalent of
cond4mpi4py = not has_key('NERSC_HOST') or (has_key('NERSC_HOST') and has_key('SLURM_SUBMIT_DIR'))
on NERSC, and also works on CSCS.