From: Daniel Arndt Date: Tue, 10 Dec 2019 23:41:38 +0000 (-0500) Subject: Fix MPI::Utilities::some_to_some X-Git-Tag: v9.2.0-rc1~793^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b37ed8e9b92a8f35ddf672f5fee066140af183c0;p=dealii.git Fix MPI::Utilities::some_to_some --- diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index 0f267f22a8..1156ab9142 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -1506,6 +1506,10 @@ namespace Utilities const unsigned int n_point_point_communications = Utilities::MPI::compute_n_point_to_point_communications(comm, send_to); + // Protect the following communication: + static CollectiveMutex mutex; + CollectiveMutex::ScopedLock lock(mutex, comm); + // If we have something to send, or we expect something from other // processors, we need to visit one of the two scopes below. Otherwise, // no other action is required by this mpi process, and we can safely @@ -1513,10 +1517,6 @@ namespace Utilities if (send_to.size() == 0 && n_point_point_communications == 0) return received_objects; - // Protect the following communication: - static CollectiveMutex mutex; - CollectiveMutex::ScopedLock lock(mutex, comm); - const int mpi_tag = internal::Tags::compute_point_to_point_communication_pattern; diff --git a/tests/dofs/dof_tools_22a.cc b/tests/dofs/dof_tools_22a.cc index 0ca80adbd0..d092899b82 100644 --- a/tests/dofs/dof_tools_22a.cc +++ b/tests/dofs/dof_tools_22a.cc @@ -124,7 +124,7 @@ test() deallog.push(Utilities::int_to_string(myid)); deallog << "**** proc " << myid << ": \n\n"; - deallog << "Sparsity pattern:\n"; + deallog << "Sparsity pattern:" << std::endl; sp.print_gnuplot(deallog.get_file_stream()); MPI_Barrier(MPI_COMM_WORLD); diff --git a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=1.output b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=1.output index 98a40dba86..2081760d4e 100644 --- a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=1.output +++ b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=1.output @@ -1,4 +1,7 @@ +DEAL:0:0:0::**** proc 0: + +Sparsity pattern: 0 0 1 0 2 0 diff --git a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=3.output b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=3.output index 5a38705aa8..f5c319ef8f 100644 --- a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=3.output +++ b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=3.output @@ -1,4 +1,7 @@ +DEAL:0:0:0::**** proc 0: + +Sparsity pattern: 0 0 1 0 2 0 @@ -2508,6 +2511,9 @@ 118 -119 119 -119 +DEAL:1:1:1::**** proc 1: + +Sparsity pattern: 2 -2 3 -2 7 -2 @@ -3421,6 +3427,9 @@ 133 -133 +DEAL:2:2:2::**** proc 2: + +Sparsity pattern: 3 -3 50 -3 53 -3 diff --git a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=5.output b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=5.output index d9687a5e5e..d2718cdc5f 100644 --- a/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=5.output +++ b/tests/dofs/dof_tools_22a.with_p4est=true.with_trilinos=true.mpirun=5.output @@ -1,4 +1,7 @@ +DEAL:0:0:0::**** proc 0: + +Sparsity pattern: 0 0 1 0 2 0 @@ -947,6 +950,9 @@ 90 -91 91 -91 +DEAL:1:1:1::**** proc 1: + +Sparsity pattern: 1 -1 3 -1 5 -1 @@ -3116,6 +3122,9 @@ 119 -119 +DEAL:2:2:2::**** proc 2: + +Sparsity pattern: 2 -2 3 -2 7 -2 @@ -4029,6 +4038,9 @@ 133 -133 +DEAL:3:3:3::**** proc 3: + +Sparsity pattern: 3 -3 50 -3 53 -3 @@ -6170,4 +6182,7 @@ 146 -146 +DEAL:4:4:4::**** proc 4: + +Sparsity pattern: