diff options
author | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2001-08-01 13:00:41 +0000 |
---|---|---|
committer | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2001-08-01 13:00:41 +0000 |
commit | df5fe6326b8a80bd9c7c20bfeb4dc0f4cee46c67 (patch) | |
tree | 6343f8663745950c4c540234b26686040a372cdc /src/RecoverVar.c | |
parent | fd4cd0198f1faf4f711561865acb39b3712b95be (diff) |
Check for file version attribute already when opening the file.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@40 7842ec3a-9562-4be5-9c5b-06ba18f2b668
Diffstat (limited to 'src/RecoverVar.c')
-rw-r--r-- | src/RecoverVar.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/RecoverVar.c b/src/RecoverVar.c index 0195416..0b8781f 100644 --- a/src/RecoverVar.c +++ b/src/RecoverVar.c @@ -177,17 +177,13 @@ int IOHDF5Util_RecoverVariables (cGH *GH, int IOHDF5Util_RecoverGHextensions (cGH *GH, fileinfo_t *fileinfo) { - hid_t group, version_attr; + hid_t group; CCTK_REAL4 real4Buffer; - CCTK_INT4 int4Buffer[4]; - H5E_auto_t print_error_fn; - void *print_error_fn_arg; + CCTK_INT4 int4Buffer[3]; if (CCTK_MyProc (GH) == 0) { - int4Buffer[3] = 0; - /* all the important global attributes and GH extensions are stored in the GLOBAL_ATTRIBUTES_GROUP group */ group = H5Gopen (fileinfo->file, GLOBAL_ATTRIBUTES_GROUP); @@ -200,19 +196,6 @@ int IOHDF5Util_RecoverGHextensions (cGH *GH, READ_ATTRIBUTE (group, "main_loop_index", IOHDF5_INT4, &int4Buffer[2]); READ_ATTRIBUTE (group, "cctk_time", IOHDF5_REAL4, &real4Buffer); - /* check if there exists a version attribute - For this we temporarily turn off automatic error printing. */ - IOHDF5_ERROR (H5Eget_auto (&print_error_fn, &print_error_fn_arg)); - IOHDF5_ERROR (H5Eset_auto (NULL, NULL)); - version_attr = H5Aopen_name (group, "Cactus version"); - IOHDF5_ERROR (H5Eset_auto (print_error_fn, print_error_fn_arg)); - - int4Buffer[3] = version_attr >= 0; - if (int4Buffer[3]) - { - IOHDF5_ERROR (H5Aclose (version_attr)); - } - IOHDF5_ERROR (H5Gclose (group)); } @@ -228,7 +211,7 @@ int IOHDF5Util_RecoverGHextensions (cGH *GH, /* NOTE: We have to use MPI_COMM_WORLD here because PUGH_COMM_WORLD is not yet set up at parameter recovery time. We also assume that PUGH_MPI_INT4 is a compile-time defined datatype. */ - CACTUS_MPI_ERROR (MPI_Bcast (int4Buffer, 4, PUGH_MPI_INT4, 0,MPI_COMM_WORLD)); + CACTUS_MPI_ERROR (MPI_Bcast (int4Buffer, 3, PUGH_MPI_INT4, 0,MPI_COMM_WORLD)); if (int4Buffer[0]) { CACTUS_MPI_ERROR (MPI_Bcast (&real4Buffer, 1, PUGH_MPI_REAL4, 0, @@ -242,7 +225,6 @@ int IOHDF5Util_RecoverGHextensions (cGH *GH, GH->cctk_iteration = int4Buffer[1]; CCTK_SetMainLoopIndex ((int) int4Buffer[2]); } - fileinfo->has_version = (int) int4Buffer[3]; /* Return 0 for success otherwise negative */ return (int4Buffer[0] ? 0 : -1); |