]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix parallel .vtu missing footer
authorTimo Heister <timo.heister@gmail.com>
Tue, 31 May 2022 20:19:24 +0000 (16:19 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 31 May 2022 20:19:24 +0000 (16:19 -0400)
source/base/data_out_base.cc

index bfa770c2eba7c7a3f8de4e861e8821a796f9aac7..a7bbb7d98ceef4e820cccb0e1f0b27fc33d31cd4 100644 (file)
@@ -7786,6 +7786,11 @@ DataOutInterface<dim, spacedim>::write_vtu_in_parallel(
       }
   }
 
+  // Make sure we sync to disk. This ensures that the change in file
+  // size caused by the write_at() for the footer is visible for all
+  // ranks. Otherwise, the footer is sometimes lost.
+  ierr = MPI_File_sync(fh);
+  AssertThrowMPI(ierr);
 
   ierr = MPI_File_close(&fh);
   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.