From: Pengfei Jia Date: Fri, 25 Feb 2022 01:21:01 +0000 (-0500) Subject: Remove unnecessary codes X-Git-Tag: v9.4.0-rc1~432^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13446%2Fhead;p=dealii.git Remove unnecessary codes Correct indent; Adding descriptions --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 806948d404..8831df89ba 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -7718,19 +7718,17 @@ DataOutInterface::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();