]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
check return value of MPI_File_open
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Oct 2013 20:00:04 +0000 (20:00 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Oct 2013 20:00:04 +0000 (20:00 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31179 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/data_out_base.cc

index 792868cd2648ed0638a70f69a663e5eef0d067a0..f0d11fde1d6d50385a0afedf9fb4a852bc55d683 100644 (file)
@@ -6514,15 +6514,19 @@ void DataOutInterface<dim,spacedim>::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<char *>(filename),
+  err = MPI_File_open(comm, const_cast<char *>(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.

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.