Skip to content

Commit

Permalink
Add parallel reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich committed Oct 23, 2023
1 parent bb25d4b commit b62455f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ngp_algorithms/GeometryInteriorAlg.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "SolutionOptions.h"
#include "utils/StkHelpers.h"
#include "stk_mesh/base/NgpMesh.hpp"
#include <stk_util/parallel/ParallelReduce.hpp>

namespace sierra {
namespace nalu {
Expand Down Expand Up @@ -146,7 +147,10 @@ GeometryInteriorAlg<AlgTraits>::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(
Expand Down

0 comments on commit b62455f

Please sign in to comment.