Skip to content
Snippets Groups Projects
Commit 57eb68c6 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix last(?) MPI memory leak for reproducible sums

parent d37126d4
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s) ...@@ -43,6 +43,7 @@ allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s)
BinType sum_bin = zero; BinType sum_bin = zero;
MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); 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); MPI_Op_free(&mpi_bin_sum_op);
return sum_bin; return sum_bin;
...@@ -71,6 +72,7 @@ allReduceReproducibleSum(const ReproducibleTinyVectorSum<ArrayT, BoolArrayT>& s) ...@@ -71,6 +72,7 @@ allReduceReproducibleSum(const ReproducibleTinyVectorSum<ArrayT, BoolArrayT>& s)
MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); 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_Op_free(&mpi_bin_sum_op);
MPI_Type_free(&mpi_bin_type);
return sum_bin; return sum_bin;
} }
...@@ -98,6 +100,7 @@ allReduceReproducibleSum(const ReproducibleTinyMatrixSum<ArrayT, BoolArrayT>& s) ...@@ -98,6 +100,7 @@ allReduceReproducibleSum(const ReproducibleTinyMatrixSum<ArrayT, BoolArrayT>& s)
MPI_Allreduce(&local_bin, &sum_bin, 1, mpi_bin_type, mpi_bin_sum_op, parallel::Messenger::getInstance().comm()); 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_Op_free(&mpi_bin_sum_op);
MPI_Type_free(&mpi_bin_type);
return sum_bin; return sum_bin;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment