From: heister Date: Tue, 8 Oct 2013 20:02:32 +0000 (+0000) Subject: take over r31179 to mainline X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00c2ca240c02631b7019a25e326f1b14afc41d25;p=dealii-svn.git take over r31179 to mainline git-svn-id: https://svn.dealii.org/trunk@31180 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/data_out_base.cc b/deal.II/source/base/data_out_base.cc index db376a019a..d4d7a03852 100644 --- a/deal.II/source/base/data_out_base.cc +++ b/deal.II/source/base/data_out_base.cc @@ -6514,15 +6514,19 @@ void DataOutInterface::write_vtu_in_parallel (const char *filename write_vtu (f); #else - int myrank, nproc; + int myrank, nproc, err; MPI_Comm_rank(comm, &myrank); MPI_Comm_size(comm, &nproc); MPI_Info info; MPI_Info_create(&info); MPI_File fh; - MPI_File_open(comm, const_cast(filename), + err = MPI_File_open(comm, const_cast(filename), MPI_MODE_CREATE | MPI_MODE_WRONLY, info, &fh); + std::cout << err << std::endl; + AssertThrow(err==0, ExcMessage("Unable to open file with MPI_File_open!")); + + MPI_File_set_size(fh, 0); // delete the file contents // this barrier is necessary, because otherwise others might already // write while one core is still setting the size to zero.