From 9f8b709240ecf5bb85abf0a2f0febc85f0b66355 Mon Sep 17 00:00:00 2001 From: yye00 Date: Tue, 24 Aug 2004 15:56:54 +0000 Subject: replacing cctk_vwarn with fprintf's git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@202 4825ed28-b72c-4eae-9704-e50c059e567d --- src/util/hdf5_convert_from_ieeeio.c | 65 +++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 13 deletions(-) (limited to 'src/util/hdf5_convert_from_ieeeio.c') diff --git a/src/util/hdf5_convert_from_ieeeio.c b/src/util/hdf5_convert_from_ieeeio.c index a9613f3..5e37019 100644 --- a/src/util/hdf5_convert_from_ieeeio.c +++ b/src/util/hdf5_convert_from_ieeeio.c @@ -73,34 +73,55 @@ int main (int argc, char **argv) unchunked Cactus data */ group = H5Gcreate (outfile, GLOBAL_ATTRIBUTES_GROUP, 0); if (group < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "group is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: group is out of bounds"); + return (-1); + } attrDataspace = H5Screate (H5S_SCALAR); attribute = H5Acreate (group, "nprocs", H5T_NATIVE_INT, attrDataspace, H5P_DEFAULT); if (attribute < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "attribute is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: attribute is out of bounds"); + return (-1); + } i = 1; if(! (H5Awrite (attribute, H5T_NATIVE_INT, &i) >= 0)) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "error returned from H5Awrite"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: error returned from H5Awrite"); + return (-1); + } H5Aclose (attribute); attribute = H5Acreate (group, "ioproc_every", H5T_NATIVE_INT, attrDataspace, H5P_DEFAULT); if (attribute < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "attribute is out of bounds"); + { + fprinft ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: attribute is out of bounds"); + return (-1); + } i = 1; if(! (H5Awrite (attribute, H5T_NATIVE_INT, &i) >= 0)) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "error returned from function H5Awrite"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: error returned from function H5Awrite"); + return (-1); + } H5Aclose (attribute); attribute = H5Acreate (group, "unchunked", H5T_NATIVE_INT, attrDataspace, H5P_DEFAULT); if (attribute < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "attribute is out of bounds"); + { + fprinft ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: attribute is out of bounds"); + return (-1); + } i = 1; if(! (H5Awrite (attribute, H5T_NATIVE_INT, &i) >= 0)) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "error returned from function H5Awrite"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: error returned from function H5Awrite"); + return (-1); + } H5Aclose (attribute); H5Sclose (attrDataspace); @@ -192,14 +213,20 @@ int main (int argc, char **argv) } dataspace = H5Screate_simple (rank, hdf5Dims, NULL); if (dataspace < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5","dataspace is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: dataspace is out of bounds"); + return (-1); + } sprintf (hdf5DatasetName, "/%s timelevel %d at iteration %d", ieeeDatasetName, timelevel, iteration); dataset = H5Dcreate (outfile, hdf5DatasetName, hdf5Datatype, dataspace, H5P_DEFAULT); if (dataset < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5","dataset is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: dataset is out of bounds"); + return (-1); + } data = malloc (IOnBytes (ieeeDatatype, rank, dims)); if (data == NULL) @@ -211,7 +238,10 @@ int main (int argc, char **argv) IOread (infile, data); if(! (H5Dwrite (dataset, hdf5Datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) >= 0)) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5","error returned from function H5Dwrite"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: error returned from function H5Dwrite"); + return (-1); + } nAttributes = IOnAttributes (infile); printf ("Processing dataset '%s' with %d attributes\n", @@ -273,7 +303,10 @@ int main (int argc, char **argv) } if (attrDataspace < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "attrDataspace is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: attrDataspace is out of bounds"); + return (-1); + } /* turn off error messages about an already existing attribute */ H5E_BEGIN_TRY @@ -284,9 +317,15 @@ int main (int argc, char **argv) attribute = H5Acreate (dataset, attrName, hdf5Datatype, attrDataspace, H5P_DEFAULT); if (attribute < 0) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "attribute is out of bounds"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: attribute is out of bounds"); + return (-1); + } if(! (H5Awrite (attribute, hdf5Datatype, attrData) >= 0)) - CCTK_VWarn ( 0, __LINE__, __FILE__, "IOHDF5", "error returned from function H5Awrite"); + { + fprintf ( stderr, "IOHDF5:hdf5_convert_from_ieeeio.c: error returned from function H5Awrite"); + return (-1); + } H5Sclose (attrDataspace); H5Aclose (attribute); -- cgit v1.2.3