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

Fix MPI memory leak

For reproducing sums, the allocated MPI operation was not freed.
parent c77f7b05
No related branches found
No related tags found
1 merge request!192Fix MPI memory leak
This commit is part of merge request !192. Comments created here will be created in the context of that merge request.
...@@ -43,6 +43,8 @@ allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s) ...@@ -43,6 +43,8 @@ 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_Op_free(&mpi_bin_sum_op);
return sum_bin; return sum_bin;
} }
...@@ -68,6 +70,8 @@ allReduceReproducibleSum(const ReproducibleTinyVectorSum<ArrayT, BoolArrayT>& s) ...@@ -68,6 +70,8 @@ allReduceReproducibleSum(const ReproducibleTinyVectorSum<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_Op_free(&mpi_bin_sum_op);
return sum_bin; return sum_bin;
} }
...@@ -93,6 +97,8 @@ allReduceReproducibleSum(const ReproducibleTinyMatrixSum<ArrayT, BoolArrayT>& s) ...@@ -93,6 +97,8 @@ allReduceReproducibleSum(const ReproducibleTinyMatrixSum<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_Op_free(&mpi_bin_sum_op);
return sum_bin; return sum_bin;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment