From b029ec9f91b16fea7ff1c59a48db2de48d78f532 Mon Sep 17 00:00:00 2001
From: Timo Heister <timo.heister@gmail.com>
Date: Tue, 8 Oct 2013 20:02:32 +0000
Subject: [PATCH] take over r31179 to mainline

git-svn-id: https://svn.dealii.org/trunk@31180 0785d39b-7218-0410-832d-ea1e28bc413d
---
 deal.II/source/base/data_out_base.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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<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.
-- 
2.39.5