From b62455fb8650b63242cc383657abf7ede66e4a6f Mon Sep 17 00:00:00 2001 From: psakiev Date: Mon, 23 Oct 2023 17:30:51 -0600 Subject: [PATCH] Add parallel reduce --- src/ngp_algorithms/GeometryInteriorAlg.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ngp_algorithms/GeometryInteriorAlg.C b/src/ngp_algorithms/GeometryInteriorAlg.C index 4c04f49ce..f24f60a58 100644 --- a/src/ngp_algorithms/GeometryInteriorAlg.C +++ b/src/ngp_algorithms/GeometryInteriorAlg.C @@ -20,6 +20,7 @@ #include "SolutionOptions.h" #include "utils/StkHelpers.h" #include "stk_mesh/base/NgpMesh.hpp" +#include namespace sierra { namespace nalu { @@ -146,7 +147,10 @@ GeometryInteriorAlg::impl_negative_jacobian_check() }, reducer); - if (numNegVol > 0) { + size_t globalNegVol = 0; + stk::all_reduce_sum(NaluEnv::self().parallel_comm(), &numNegVol, &globalNegVol, 1); + + if (globalNegVol > 0) { realm_.provide_output(realm_.outputFailedJacobians_); const stk::topology topology(AlgTraits::topo_); throw std::runtime_error(