diff options
author | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2000-11-29 01:08:25 +0000 |
---|---|---|
committer | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2000-11-29 01:08:25 +0000 |
commit | 257767c90a7f5cc2248e697feacd1337f8fd4a8e (patch) | |
tree | 900fba6f4e477906bf0be9261f28a35f1d38b787 /src/RecoverVar.c | |
parent | ead65aead64cf2462b1b5a2ed74c253edd778fa8 (diff) |
Renamed local variable 'index' into 'vindex' to stop compiler warnings
about hiding a global routine index(3).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@13 7842ec3a-9562-4be5-9c5b-06ba18f2b668
Diffstat (limited to 'src/RecoverVar.c')
-rw-r--r-- | src/RecoverVar.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/RecoverVar.c b/src/RecoverVar.c index d6ccd01..b041e15 100644 --- a/src/RecoverVar.c +++ b/src/RecoverVar.c @@ -122,7 +122,7 @@ int IOHDF5Util_RecoverVariables (cGH *GH, /* And here the code for non-IO processors: */ MPI_Datatype mpi_type; MPI_Status ms; - int index, timelevel, npoints; + int vindex, timelevel, npoints; /* They don't know how many datasets there are, because the IO processors could skip some on the fly during their consistency checks. @@ -135,15 +135,15 @@ int IOHDF5Util_RecoverVariables (cGH *GH, /* receive the next variable index from my IO processor */ CACTUS_MPI_ERROR (MPI_Recv (var_info, 3, PUGH_MPI_INT, fileinfo->ioproc, STARTUPBASE, pughGH->PUGH_COMM_WORLD, &ms)); - index = var_info[0]; timelevel = var_info[1]; npoints = var_info[2]; + vindex = var_info[0]; timelevel = var_info[1]; npoints = var_info[2]; /* check for termination condition */ - if (index < 0) + if (vindex < 0) { break; } - switch (CCTK_VarTypeI (index)) + switch (CCTK_VarTypeI (vindex)) { case CCTK_VARIABLE_CHAR: mpi_type = PUGH_MPI_CHAR; break; case CCTK_VARIABLE_INT: mpi_type = PUGH_MPI_INT; break; @@ -151,12 +151,12 @@ int IOHDF5Util_RecoverVariables (cGH *GH, case CCTK_VARIABLE_COMPLEX: mpi_type = pughGH->PUGH_mpi_complex; break; default: CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "Unsupported datatype %d", CCTK_VarTypeI (index)); + "Unsupported datatype %d", CCTK_VarTypeI (vindex)); continue; } /* receive following data from my IO processor */ - CACTUS_MPI_ERROR (MPI_Recv (GH->data[index][timelevel], npoints, + CACTUS_MPI_ERROR (MPI_Recv (GH->data[vindex][timelevel], npoints, mpi_type, fileinfo->ioproc, STARTUPBASE, pughGH->PUGH_COMM_WORLD, &ms)); } @@ -336,11 +336,11 @@ int IOHDF5Util_RecoverParameters (fileinfo_t *fileinfo) If there is a mismatch a warning (warning level 2) is printed and a negative value is returned to indicate that this dataset should be ignored. If successful, the global variable index, the group type and the timelevel - to restore are stored in {*index, *gtype, *timelevel}, and 0 is returned. + to restore are stored in {*vindex, *gtype, *timelevel}, and 0 is returned. */ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, - int unchunked, int *index, int *grouptype, + int unchunked, int *vindex, int *grouptype, int *timelevel, int is_group) { cGroup group_static_data; @@ -364,8 +364,8 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, } /* check if there is a matching variable */ - *index = CCTK_VarIndex (fullvarname); - if (*index < 0) + *vindex = CCTK_VarIndex (fullvarname); + if (*vindex < 0) { CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, "No matching variable found for '%s'", fullvarname); @@ -374,7 +374,7 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, /* read and verify the group name */ READ_ATTRIBUTE (dataset, "groupname", H5T_C_S1, groupname_stored); - groupname = CCTK_GroupNameFromVarI (*index); + groupname = CCTK_GroupNameFromVarI (*vindex); if (! CCTK_Equals (groupname_stored, groupname)) { CCTK_WARN (2, "Groupnames don't match"); @@ -394,12 +394,6 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, "Cannot get static group data for '%s'", fullvarname); return (-1); } - if (CCTK_GroupDynamicData (GH, groupindex, &group_dynamic_data) != 0) - { - CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, - "Cannot get dynamic group data for '%s'", fullvarname); - return (-1); - } /* now check the group data against the information in the checkpoint file */ if (group_static_data.grouptype != grouptype_stored) @@ -455,7 +449,7 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, IOHDF5_ERROR (H5Sclose (dataspace)); flag = 0; - if (group_static_data.dim != rank_stored) + if (group_static_data.dim != (int) rank_stored) { flag = 1; } @@ -465,10 +459,16 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, break; case CCTK_ARRAY: case CCTK_GF: + if (CCTK_GroupDynamicData (GH, groupindex, &group_dynamic_data) != 0) + { + CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, + "Cannot get dynamic group data for '%s'", fullvarname); + return (-1); + } dims = unchunked ? group_dynamic_data.gsh : group_dynamic_data.lsh; for (i = 0; i < group_static_data.dim; i++) { - if (dims[group_static_data.dim - i - 1] != dims_stored[i]) + if (dims[group_static_data.dim - i - 1] != (int) dims_stored[i]) { flag = 1; } @@ -504,7 +504,7 @@ static int GetCommonAttributes (cGH *GH, hid_t dataset, const char *datasetname, static int IOHDF5Util_RestoreGS (hid_t dataset, - int index, + int vindex, int timelevel, recover_info_t *rec_info) { @@ -516,7 +516,7 @@ static int IOHDF5Util_RestoreGS (hid_t dataset, #endif - data = CCTK_VarDataPtrI (rec_info->it_info->GH, timelevel, index); + data = CCTK_VarDataPtrI (rec_info->it_info->GH, timelevel, vindex); /* read the data into the local variable ... */ IOHDF5_ERROR (H5Dread (dataset, rec_info->iohdf5_type, H5S_ALL, H5S_ALL, @@ -529,7 +529,7 @@ static int IOHDF5Util_RestoreGS (hid_t dataset, pughGH = PUGH_pGH (rec_info->it_info->GH); /* set the variable's index and the timelevel */ - var_info[0] = index; var_info[1] = timelevel; var_info[2] = 1; + var_info[0] = vindex; var_info[1] = timelevel; var_info[2] = 1; /* send info and data to the non-IO processors */ for (proc = rec_info->it_info->ioproc + 1; @@ -549,7 +549,7 @@ static int IOHDF5Util_RestoreGS (hid_t dataset, static int IOHDF5Util_RestoreGA (hid_t dataset, - int index, + int vindex, int timelevel, recover_info_t *rec_info) { @@ -567,7 +567,7 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, if (CCTK_nProcs (rec_info->it_info->GH) == 1) { IOHDF5_ERROR (H5Dread (dataset, rec_info->iohdf5_type, H5S_ALL, - H5S_ALL, H5P_DEFAULT, rec_info->it_info->GH->data[index][timelevel])); + H5S_ALL, H5P_DEFAULT, rec_info->it_info->GH->data[vindex][timelevel])); return (0); } @@ -577,7 +577,7 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, pughGH = PUGH_pGH (rec_info->it_info->GH); /* Get the pGExtras pointer as a shortcut */ - extras = ((pGA ***) pughGH->variables)[index][timelevel]->extras; + extras = ((pGA ***) pughGH->variables)[vindex][timelevel]->extras; /* allocate memory for the biggest chunk */ npoints = extras->rnpoints[rec_info->it_info->ioproc + 1]; @@ -591,7 +591,7 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, buffer = malloc (npoints * rec_info->element_size); /* set the variable's index and timelevel to restore */ - var_info[0] = index; var_info[1] = timelevel; + var_info[0] = vindex; var_info[1] = timelevel; /* now loop over the group of processors associated to each IO processor */ for (proc = rec_info->it_info->ioproc; @@ -602,7 +602,7 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, /* read own data directly into variable */ if (proc == rec_info->it_info->ioproc) { - data = rec_info->it_info->GH->data[index][timelevel]; + data = rec_info->it_info->GH->data[vindex][timelevel]; } else { @@ -630,7 +630,7 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, hsize_t *chunk_dims; /* get the dimension of the variable */ - dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (index)); + dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (vindex)); chunk_origin = (hssize_t *) malloc (dim * sizeof (hssize_t)); chunk_dims = (hsize_t *) malloc (dim * sizeof (hsize_t)); @@ -684,7 +684,7 @@ static herr_t processDataset (hid_t group, pGH *pughGH; ioGH *ioUtilGH; ioHDF5UtilGH *h5UtilGH; - int index, gtype, timelevel; + int vindex, gtype, timelevel; iterate_info_t *it_info = (iterate_info_t *) arg; recover_info_t rec_info; hid_t dataset; @@ -717,7 +717,7 @@ static herr_t processDataset (hid_t group, /* read in the dataset's attributes and verify them */ if (GetCommonAttributes (it_info->GH, dataset, datasetname, - it_info->unchunked, &index, >ype, &timelevel, is_group) < 0) + it_info->unchunked, &vindex, >ype, &timelevel, is_group) < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "Ignoring dataset '%s'", datasetname); @@ -726,11 +726,11 @@ static herr_t processDataset (hid_t group, /* if we read in initial data via the file reader interface check whether the user wants to have this variable restored */ - if (ioUtilGH->do_inVars && ! ioUtilGH->do_inVars[index]) + if (ioUtilGH->do_inVars && ! ioUtilGH->do_inVars[vindex]) { if (verbose) { - char *varname = CCTK_FullName (index); + char *varname = CCTK_FullName (vindex); CCTK_VInfo (CCTK_THORNSTRING, "Ignoring variable '%s' for file reader " "recovery", varname); @@ -741,7 +741,7 @@ static herr_t processDataset (hid_t group, if (verbose) { - char *varname = CCTK_FullName (index); + char *varname = CCTK_FullName (vindex); CCTK_VInfo (CCTK_THORNSTRING, "Restoring variable '%s' (timelevel %d)", varname, timelevel); @@ -750,7 +750,7 @@ static herr_t processDataset (hid_t group, rec_info.it_info = it_info; - switch (CCTK_VarTypeI (index)) + switch (CCTK_VarTypeI (vindex)) { case CCTK_VARIABLE_CHAR: rec_info.iohdf5_type = IOHDF5_CHAR; @@ -787,7 +787,7 @@ static herr_t processDataset (hid_t group, default: CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "Unsupported variable datatype '%s'", - CCTK_VarTypeName (CCTK_VarTypeI (index))); + CCTK_VarTypeName (CCTK_VarTypeI (vindex))); return (0); } @@ -795,11 +795,11 @@ static herr_t processDataset (hid_t group, switch (gtype) { case CCTK_SCALAR: - IOHDF5Util_RestoreGS (dataset, index, timelevel, &rec_info); + IOHDF5Util_RestoreGS (dataset, vindex, timelevel, &rec_info); break; case CCTK_GF: case CCTK_ARRAY: - IOHDF5Util_RestoreGA (dataset, index, timelevel, &rec_info); + IOHDF5Util_RestoreGA (dataset, vindex, timelevel, &rec_info); break; default: CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, |