Skip to content

Commit 23a8eb1

Browse files
authored
Merge pull request #462 from claresinger/fix-mpi
Great, thanks!
2 parents 14de641 + 7970b43 commit 23a8eb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libmpdata++/concurr/detail/distmem.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ namespace libmpdataxx
108108
#if !defined(USE_MPI)
109109
if (
110110
// mvapich2
111-
std::getenv("MV2_COMM_WORLD_RANK") != NULL ||
111+
std::getenv("MV2_COMM_WORLD_RANK") != NULL && std::atoi(std::getenv("MV2_COMM_WORLD_SIZE")) > 1 ||
112112
// mpich
113-
std::getenv("PMI_RANK") != NULL ||
113+
std::getenv("PMI_RANK") != NULL && std::atoi(std::getenv("PMI_SIZE")) > 1 ||
114114
// openmpi
115-
std::getenv("OMPI_COMM_WORLD_RANK") != NULL ||
115+
std::getenv("OMPI_COMM_WORLD_RANK") != NULL && std::atoi(std::getenv("OMPI_COMM_WORLD_SIZE")) > 1 ||
116116
// lam
117-
std::getenv("LAMRANK") != NULL
117+
std::getenv("LAMRANK") != NULL && std::atoi(std::getenv("LAMSIZE")) > 1
118118
) throw std::runtime_error("mpirun environment variable detected but libmpdata++ was compiled with MPI disabled");
119119
#else
120120
// init mpi here, since distmem is constructed before hdf5

0 commit comments

Comments
 (0)