From 9cf3756873d5606f91b2c4c7fe564b7fd742d4a0 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 22 Dec 2010 20:41:19 -0600 Subject: CarpetInterp: Check that MPI datatypes are defined before using them --- Carpet/CarpetInterp/src/interp.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetInterp') diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc index bbeeb7558..f6579bc8b 100644 --- a/Carpet/CarpetInterp/src/interp.cc +++ b/Carpet/CarpetInterp/src/interp.cc @@ -713,7 +713,12 @@ namespace CarpetInterp { case N: { T dummy; datatype = dist::mpi_datatype(dummy); break; } #include "typecase.hh" #undef TYPECASE - default: { CCTK_WARN (0, "invalid datatype"); abort(); } + 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", + vtype); } MPI_Datatype vdatatype; MPI_Type_vector(1, N_output_arrays, 0, datatype, &vdatatype); -- cgit v1.2.3