diff --git a/src/utils/Messenger.cpp b/src/utils/Messenger.cpp index 14891477a2b804c4f0c8698fdfa51a8ea2470c8b..c66102669709be2f4d5aa19677b212611391ea16 100644 --- a/src/utils/Messenger.cpp +++ b/src/utils/Messenger.cpp @@ -28,7 +28,7 @@ Messenger::destroy() } } -Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[], bool parallel_output) +Messenger::Messenger([[maybe_unused]] int& argc, [[maybe_unused]] char* argv[], [[maybe_unused]] bool parallel_output) { #ifdef PUGS_HAS_MPI MPI_Init(&argc, &argv); diff --git a/src/utils/ReproducibleSumMPI.hpp b/src/utils/ReproducibleSumMPI.hpp index c3b2e8ef39e4385bbc6ea949bbe3d0964c864117..bb466e9db94bc4808ce0ac29130f5ae2df4573c8 100644 --- a/src/utils/ReproducibleSumMPI.hpp +++ b/src/utils/ReproducibleSumMPI.hpp @@ -48,6 +48,9 @@ allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s) BinType sum_bin = zero; MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); + MPI_Type_free(&mpi_bin_type); + MPI_Op_free(&mpi_bin_sum_op); + return sum_bin; } @@ -73,6 +76,9 @@ allReduceReproducibleSum(const ReproducibleTinyVectorSum<ArrayT, BoolArrayT>& s) BinType sum_bin = zero; MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); + MPI_Op_free(&mpi_bin_sum_op); + MPI_Type_free(&mpi_bin_type); + return sum_bin; } @@ -98,6 +104,9 @@ allReduceReproducibleSum(const ReproducibleTinyMatrixSum<ArrayT, BoolArrayT>& s) BinType sum_bin = zero; MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); + MPI_Op_free(&mpi_bin_sum_op); + MPI_Type_free(&mpi_bin_type); + return sum_bin; } diff --git a/src/utils/ReproducibleSumUtils.hpp b/src/utils/ReproducibleSumUtils.hpp index f2d52aa20122452e96130c0c29b6d12ccc32a4aa..2ce3d763cfdf8f8af2d2b1dcb975640dad6290b6 100644 --- a/src/utils/ReproducibleSumUtils.hpp +++ b/src/utils/ReproducibleSumUtils.hpp @@ -168,7 +168,7 @@ class ReproducibleScalarSum PUGS_INLINE static void _update(const DataType& m, Bin& bin) noexcept(NO_ASSERT) { - Assert(m > 0); + Assert(m >= 0); using namespace reproducible_sum_utils; if (m >= std::pow(DataType{2}, W - 1.) * ulp(bin.S[0])) {