From 09680a38573408ddc0ccb51d7fbe883ade626bef Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Apr 2024 01:03:39 -0400 Subject: [PATCH] use MPI_SUM instead of MPI_MAX to work around OpenMPI bug on macOS with Apple CPU --- src/INTEL/pair_eam_intel.cpp | 2 +- src/MANYBODY/pair_eam.cpp | 2 +- src/OPENMP/pair_eam_omp.cpp | 2 +- src/OPT/pair_eam_opt.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/INTEL/pair_eam_intel.cpp b/src/INTEL/pair_eam_intel.cpp index ed92a41a11..3f1f54e3c0 100644 --- a/src/INTEL/pair_eam_intel.cpp +++ b/src/INTEL/pair_eam_intel.cpp @@ -657,7 +657,7 @@ void PairEAMIntel::eval(const int offload, const int vflag, fix->stop_watch(TIME_HOST_PAIR); if (EFLAG && (!exceeded_rhomax)) { - MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_MAX, world); + MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_SUM, world); if (exceeded_rhomax) { if (comm->me == 0) error->warning(FLERR, diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index d1b56a9eae..e4a0155ab9 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -328,7 +328,7 @@ void PairEAM::compute(int eflag, int vflag) } if (eflag && (!exceeded_rhomax)) { - MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_MAX, world); + MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_SUM, world); if (exceeded_rhomax) { if (comm->me == 0) error->warning(FLERR, diff --git a/src/OPENMP/pair_eam_omp.cpp b/src/OPENMP/pair_eam_omp.cpp index 1d3c7ded3a..56d41973c9 100644 --- a/src/OPENMP/pair_eam_omp.cpp +++ b/src/OPENMP/pair_eam_omp.cpp @@ -305,7 +305,7 @@ void PairEAMOMP::eval(int iifrom, int iito, ThrData * const thr) } if (EFLAG && (!exceeded_rhomax)) { - MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_MAX, world); + MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_SUM, world); if (exceeded_rhomax) { if (comm->me == 0) error->warning(FLERR, diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp index 20463515da..96afff4ee5 100644 --- a/src/OPT/pair_eam_opt.cpp +++ b/src/OPT/pair_eam_opt.cpp @@ -367,7 +367,7 @@ template void PairEAMOpt::eval() fast_gamma = nullptr; if (EFLAG && (!exceeded_rhomax)) { - MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_MAX, world); + MPI_Allreduce(&beyond_rhomax, &exceeded_rhomax, 1, MPI_INT, MPI_SUM, world); if (exceeded_rhomax) { if (comm->me == 0) error->warning(FLERR,