From: heister Date: Tue, 8 Oct 2013 20:00:04 +0000 (+0000) Subject: check return value of MPI_File_open X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9572e06d700a80f1608c31bccf1074d713112f62;p=dealii-svn.git check return value of MPI_File_open git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31179 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 792868cd26..f0d11fde1d 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.