]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove unnecessary codes 13446/head
authorPengfei Jia <pengfej@clemson.edu>
Fri, 25 Feb 2022 01:21:01 +0000 (20:21 -0500)
committerPengfei Jia <pengfej@clemson.edu>
Fri, 25 Feb 2022 18:28:05 +0000 (13:28 -0500)
Correct indent; Adding descriptions

source/base/data_out_base.cc

index 806948d404b7cf742e795ce66d63378765616f2e..8831df89ba601db03f619571c02bcf0e654102c2 100644 (file)
@@ -7718,19 +7718,17 @@ DataOutInterface<dim, spacedim>::write_vtu_in_parallel(
       std::stringstream ss;
       DataOutBase::write_vtu_header(ss, vtk_flags);
       header_size = ss.str().size();
-      ierr = MPI_File_write(fh,
-                            DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
-                            header_size,
-                            MPI_CHAR,
-                            MPI_STATUS_IGNORE);
+      // Write the header on rank 0 and automatically move the
+      // shared file pointer to the location after header;
+      ierr = MPI_File_write_shared(fh,
+                                   DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
+                                   header_size,
+                                   MPI_CHAR,
+                                   MPI_STATUS_IGNORE);
       AssertThrowMPI(ierr);
     }
 
-  ierr = MPI_Bcast(&header_size, 1, MPI_UNSIGNED, 0, comm);
-  AssertThrowMPI(ierr);
 
-  ierr = MPI_File_seek_shared(fh, header_size, MPI_SEEK_SET);
-  AssertThrowMPI(ierr);
   {
     const auto &patches = get_patches();
     const types::global_dof_index my_n_patches = patches.size();

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.