]> https://gitweb.dealii.org/ - dealii.git/commit
Utilities::MPI::mpi_sum_avg: create MPI_Datatype and MPI_Op once
authorMatthias Maier <tamiko@43-1.org>
Sun, 18 Apr 2021 21:11:33 +0000 (16:11 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 19 Apr 2021 22:22:49 +0000 (17:22 -0500)
commit42a245ef8b7c08d46afc2b136416f8978702c166
tree826b0c21f7eba95d7aa06abd514a7024aa76b30b
parent008cea61ee1118b6379153d394f118ee8cce9df4
Utilities::MPI::mpi_sum_avg: create MPI_Datatype and MPI_Op once

Instead of repeatedly creating and freeing an MPI_Datatype and MPI_Op
for every invocation of Utilities::MPI::mpi_sum_avg let us define these
objects statically and create them only once.

This works around a memory leak issue with OpenMPI 4.1.0 that will leak
memory in the subsequent MPI_Allreduce call.

Upstream bug report: https://github.com/open-mpi/ompi/issues/8827
source/base/mpi.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.