diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index 692f78cf9f..0dde34619a 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -241,7 +241,14 @@ void TemperGrem::command(int narg, char **arg) timer->init_timeout(); update->integrate->run(nevery); - if (timer->is_timeout()) break; + + // check for timeout across all procs + + int my_timeout=0; + int any_timeout=0; + if (timer->is_timeout()) my_timeout=1; + MPI_Allreduce(&my_timeout, &any_timeout, 1, MPI_INT, MPI_SUM, universe->uworld); + if (any_timeout) break; // compute PE // notify compute it will be called at next swap diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index 55c9aadc6f..0fdcd0ab81 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -220,7 +220,14 @@ void TemperNPT::command(int narg, char **arg) timer->init_timeout(); update->integrate->run(nevery); - if (timer->is_timeout()) break; + + // check for timeout across all procs + + int my_timeout=0; + int any_timeout=0; + if (timer->is_timeout()) my_timeout=1; + MPI_Allreduce(&my_timeout, &any_timeout, 1, MPI_INT, MPI_SUM, universe->uworld); + if (any_timeout) break; // compute PE // notify compute it will be called at next swap