From 138b25353c96c37a0a1508c85127c0620f3441cc Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 11 May 2006 20:32:00 +0000 Subject: CarpetIOHDF5: Delay check whether storage is enabled Check whether a group has storage only after checking whether it should be output. darcs-hash:20060511203215-dae7b-20604fda3117034cccf38998561b7e3bed1e6873.gz --- Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Carpet/CarpetIOHDF5/src') diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc index fc96024d6..da55245dc 100644 --- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc +++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc @@ -525,14 +525,6 @@ static int OutputVarAs (const cGH* const cctkGH, const char* const fullname, assert (do_global_mode); } - // Check for storage - if (not CCTK_QueryGroupStorageI (cctkGH, group)) { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "Cannot output variable '%s' because it has no storage", - fullname); - return (0); - } - // get the default I/O request for this variable const CarpetIOHDF5GH *myGH = (CarpetIOHDF5GH *) CCTK_GHExtension (cctkGH, CCTK_THORNSTRING); @@ -600,6 +592,14 @@ static int OutputVarAs (const cGH* const cctkGH, const char* const fullname, assert (last_output < cctk_iteration); last_output = cctk_iteration; + // Check for storage + if (not CCTK_QueryGroupStorageI (cctkGH, group)) { + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Cannot output variable '%s' because it has no storage", + fullname); + return (0); + } + // Open the output file if this is a designated I/O processor hid_t file = -1; if (dist::rank() == ioproc) { -- cgit v1.2.3