]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a valid communicator. 13471/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 1 Mar 2022 18:02:42 +0000 (11:02 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Mar 2022 03:04:59 +0000 (20:04 -0700)
tests/fullydistributed_grids/repartitioning_05.cc

index f3810754ef614c420a66549dd758404e3b1342ea..0f83f4421ae8df4c79e85fdb117a845ddc1c2243 100644 (file)
@@ -55,7 +55,7 @@ create_sub_comm(const MPI_Comm &comm, const unsigned int size)
     {
       ierr = MPI_Comm_free(&sub_comm);
       AssertThrowMPI(ierr);
-      return MPI_COMM_NULL;
+      return MPI_COMM_SELF;
     }
 }
 
@@ -69,9 +69,9 @@ partition_distributed_triangulation(const Triangulation<dim, spacedim> &tria_in,
   const auto comm_tria = tria_in.get_communicator();
 
   const auto n_global_active_cells = Utilities::MPI::max(
-    comm_tria == MPI_COMM_NULL ? 0 : tria_in.n_global_active_cells(), comm);
+    comm_tria == MPI_COMM_SELF ? 0 : tria_in.n_global_active_cells(), comm);
 
-  if (comm_tria == MPI_COMM_NULL)
+  if (comm_tria == MPI_COMM_SELF)
     {
       LinearAlgebra::distributed::Vector<double> partition{
         IndexSet(n_global_active_cells), IndexSet(n_global_active_cells), comm};
@@ -111,7 +111,7 @@ test(const MPI_Comm comm, const unsigned int n_partitions)
 
   parallel::distributed::Triangulation<dim> tria(sub_comm);
 
-  if (sub_comm != MPI_COMM_NULL)
+  if (sub_comm != MPI_COMM_SELF)
     {
       GridGenerator::subdivided_hyper_cube(tria, 4);
       tria.refine_global(3);
@@ -136,7 +136,7 @@ test(const MPI_Comm comm, const unsigned int n_partitions)
   print_statistics(tria_pft);
   print_statistics(dof_handler);
 
-  if (sub_comm != MPI_COMM_NULL)
+  if (sub_comm != MPI_COMM_SELF)
     {
       const int ierr = MPI_Comm_free(&sub_comm);
       AssertThrowMPI(ierr);

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.