diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-05-11 20:32:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-05-11 20:32:00 +0000 |
commit | 138b25353c96c37a0a1508c85127c0620f3441cc (patch) | |
tree | 79731d0f9bd964474824e83b456c14b9e85a0bcb /Carpet/CarpetIOHDF5/src | |
parent | 10b56095c5a5960075205f5dbd60cc1c689daf1a (diff) |
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
Diffstat (limited to 'Carpet/CarpetIOHDF5/src')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc | 16 |
1 files changed, 8 insertions, 8 deletions
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) { |