triqs.utility.mpi.check_for_mpi
- triqs.utility.mpi.check_for_mpi()[source]
Detect whether the current process was launched under MPI.
Inspects a small set of environment variables commonly exported by MPI launchers:
OMPI_COMM_WORLD_RANK– Open MPI.PMI_RANK– MPICH and Intel MPI.PMIX_RANK– PMIx (used bysrun/ Slurm with PMIx support).CRAY_MPICH_VERSION– Cray MPICH.TRIQS_FORCE_MPI_INIT– escape hatch: when set (to any value), MPI initialisation is forced even though none of the launcher variables above are present.
Returns
Trueif any of them is set. Otherwise, it prints a warning to stdout and returnsFalse.- Returns:
- bool
Trueif an MPI environment is detected,Falseotherwise.