From 3f34fa26a6040b4ede8e4eedd13a20a08098d25d Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 4 Nov 2019 10:53:11 -0500 Subject: [PATCH] move mutex down --- include/deal.II/base/mpi_compute_index_owner_internal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/mpi_compute_index_owner_internal.h b/include/deal.II/base/mpi_compute_index_owner_internal.h index b2e63c0a34..3587b2b31e 100644 --- a/include/deal.II/base/mpi_compute_index_owner_internal.h +++ b/include/deal.II/base/mpi_compute_index_owner_internal.h @@ -119,10 +119,6 @@ namespace Utilities this->partition(owned_indices, comm); #ifdef DEAL_II_WITH_MPI - - static CollectiveMutex mutex; - CollectiveMutex::ScopedLock lock(mutex, comm); - unsigned int my_rank = this_mpi_process(comm); types::global_dof_index dic_local_received = 0; @@ -188,6 +184,10 @@ namespace Utilities } } + // protect the following communication steps using a mutex: + static CollectiveMutex mutex; + CollectiveMutex::ScopedLock lock(mutex, comm); + n_dict_procs_in_owned_indices = buffers.size(); std::vector request; request.reserve(n_dict_procs_in_owned_indices); -- 2.39.5