]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make serial work
authorTimo Heister <timo.heister@gmail.com>
Sat, 10 Sep 2022 14:12:45 +0000 (10:12 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 13 Sep 2022 20:13:42 +0000 (16:13 -0400)
source/base/data_out_base.cc

index f73a608eebfce6dce5aac99aa5be8299e6a6edf3..00e0b8590793d4eb8863c6fda4abc91c940a801d 100644 (file)
@@ -8202,22 +8202,17 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
     (data_filter.n_nodes() > 0) ? data_filter.n_cells() : 0;
 
 
-  // And compute the global total
 #ifdef DEAL_II_WITH_MPI
+
   const int myrank = Utilities::MPI::this_mpi_process(comm);
-  int       ierr   = MPI_Allreduce(local_node_cell_count,
+  // And compute the global total
+  int ierr = MPI_Allreduce(local_node_cell_count,
                            global_node_cell_count,
                            2,
                            MPI_UINT64_T,
                            MPI_SUM,
                            comm);
   AssertThrowMPI(ierr);
-#else
-  (void)comm;
-  const int myrank = 0;
-  global_node_cell_count[0] = local_node_cell_count[0];
-  global_node_cell_count[1] = local_node_cell_count[1];
-#endif
 
   // The implementation is a bit complicated because we are supposed to return
   // the correct data on rank 0 and an empty object on all other ranks but all
@@ -8243,6 +8238,17 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
 
   const int tag = 47381;
 
+#else
+  (void)comm;
+  global_node_cell_count[0] = local_node_cell_count[0];
+  global_node_cell_count[1] = local_node_cell_count[1];
+
+  const bool am_i_first_rank_with_data = true;
+
+#endif
+
+
+
   // Output the XDMF file only on the root process of all ranks with data:
   if (am_i_first_rank_with_data)
     {
@@ -8274,6 +8280,7 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
                               data_filter.get_data_set_dim(i));
         }
 
+#ifdef DEAL_II_WITH_MPI
       if (myrank != 0)
         {
           // send to rank 0
@@ -8283,10 +8290,12 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
 
           return {};
         }
-      else
-        return entry;
+#endif
+
+      return entry;
     }
 
+#ifdef DEAL_II_WITH_MPI
   if (myrank == 0 && !am_i_first_rank_with_data)
     {
       // receive the XDMF data on rank 0 if we don't have it...
@@ -8311,6 +8320,7 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
 
       return Utilities::unpack<XDMFEntry>(buffer, false);
     }
+#endif
 
   // default case for any other rank is to return an empty object
   return {};

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.