aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-12-22 20:40:49 -0600
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:25:51 +0000
commit506379e82a0d11605d7af4264efb36557edba406 (patch)
tree5ea9c8ece473583edbe654051d4a405061aeae1e /Carpet/CarpetIOHDF5
parentef18dde5ce4e460f11a882f2d35a8b42438999e1 (diff)
CarpetIOHDF5: Check that MPI datatypes are defined before using them
Diffstat (limited to 'Carpet/CarpetIOHDF5')
-rw-r--r--Carpet/CarpetIOHDF5/src/Output.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc
index 4967785d6..3c44d87ac 100644
--- a/Carpet/CarpetIOHDF5/src/Output.cc
+++ b/Carpet/CarpetIOHDF5/src/Output.cc
@@ -548,7 +548,12 @@ int WriteVarChunkedParallel (const cGH* const cctkGH,
case N: { T dummy; datatype = dist::mpi_datatype(dummy); } break;
#include "typecase.hh"
#undef TYPECASE
- default: assert (0 and "invalid datatype");
+ default: { CCTK_WARN (CCTK_WARN_ABORT, "invalid datatype"); abort(); }
+ }
+ if (datatype == MPI_DATATYPE_NULL) {
+ CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "MPI datatype for Cactus datatype %d is not defined",
+ group.vartype);
}
const size_t size = bbox.size() * CCTK_VarTypeSize (group.vartype);