aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2006-02-09 16:55:00 +0000
committerThomas Radke <tradke@aei.mpg.de>2006-02-09 16:55:00 +0000
commitbe5e2d4b7498b80c175fe283a2361af2bd4ab006 (patch)
tree50041cb4159e69c9d23cbf2c8b427fc51098dac3 /Carpet/CarpetIOHDF5
parentf2c612a116d74e88914b084c73ddfc6a0ef2b7ee (diff)
CarpetIOHDF5: fix declaration of scheduled routine
The scheduled routine CarpetIOHDF5_CloseFiles() was declared to return an int and take no arguments. Instead it must be declared to take a 'const cGH* const' argument. It should also return void. See http://www.cactuscode.org/old/pipermail/developers/2006-February/001656.html. This patch also fixes a couple of g++ warning about signed-unsigned integer comparisons. darcs-hash:20060209165534-776a0-24101ebd8c09cea0a9af04acc48f8e2aa2961e34.gz
Diffstat (limited to 'Carpet/CarpetIOHDF5')
-rw-r--r--Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh4
-rw-r--r--Carpet/CarpetIOHDF5/src/Input.cc27
2 files changed, 15 insertions, 16 deletions
diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh
index 13b710b86..ab5624149 100644
--- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh
+++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh
@@ -110,13 +110,13 @@ namespace CarpetIOHDF5
extern "C" {
int CarpetIOHDF5_Startup (void);
+ int CarpetIOHDF5_RecoverParameters (void);
int CarpetIOHDF5_Init (const cGH* const);
int CarpetIOHDF5_SetNumRefinementLevels (void);
- int CarpetIOHDF5_CloseFiles (void);
int CarpetIOHDF5_InitialDataCheckpoint (const cGH* const);
int CarpetIOHDF5_EvolutionCheckpoint (const cGH* const);
int CarpetIOHDF5_TerminationCheckpoint (const cGH* const);
- int CarpetIOHDF5_RecoverParameters (void);
+ void CarpetIOHDF5_CloseFiles (const cGH* const);
} // extern "C"
diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc
index ec531559a..2729565c9 100644
--- a/Carpet/CarpetIOHDF5/src/Input.cc
+++ b/Carpet/CarpetIOHDF5/src/Input.cc
@@ -122,7 +122,7 @@ int CarpetIOHDF5_SetNumRefinementLevels (void)
//////////////////////////////////////////////////////////////////////////////
// close all open checkpoint/filereader files after recovering grid variables
//////////////////////////////////////////////////////////////////////////////
-int CarpetIOHDF5_CloseFiles (void)
+void CarpetIOHDF5_CloseFiles (const cGH* const cctkGH)
{
int error_count = 0;
DECLARE_CCTK_PARAMETERS;
@@ -130,7 +130,7 @@ int CarpetIOHDF5_CloseFiles (void)
for (list<fileset_t>::const_iterator set = filesets.begin();
set != filesets.end(); set++) {
- for (int i = 0; i < set->files.size(); i++) {
+ for (unsigned int i = 0; i < set->files.size(); i++) {
if (set->files[i].file >= 0) {
if (CCTK_Equals (verbose, "full")) {
@@ -145,8 +145,6 @@ int CarpetIOHDF5_CloseFiles (void)
}
filesets.clear();
-
- return (-error_count);
}
@@ -218,7 +216,7 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
const int numvars = CCTK_NumVars ();
vector<vector<bool> > read_completely(numvars);
vector<vector<vector<ibset> > > bboxes_read (numvars);
- for (int vindex = 0; vindex < bboxes_read.size(); vindex++) {
+ for (unsigned int vindex = 0; vindex < bboxes_read.size(); vindex++) {
const int timelevels = CCTK_ActiveTimeLevelsVI (cctkGH, vindex);
read_completely[vindex].resize (timelevels, false);
bboxes_read[vindex].resize (timelevels);
@@ -230,7 +228,7 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
// create a bbox set for each group to list how much needs to be read
const int numgroups = CCTK_NumGroups ();
vector<vector<ibset> > group_bboxes (numgroups);
- for (int gindex = 0; gindex < group_bboxes.size(); gindex++) {
+ for (unsigned int gindex = 0; gindex < group_bboxes.size(); gindex++) {
group_bboxes[gindex].resize (Carpet::maps);
const int grouptype = CCTK_GroupTypeI (gindex);
BEGIN_MAP_LOOP (cctkGH, grouptype) {
@@ -248,7 +246,7 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
const ioGH* ioUtilGH = (const ioGH*) CCTK_GHExtension (cctkGH, "IO");
// loop over all input files of this set
- for (int i = 0; i < fileset->files.size(); i++) {
+ for (unsigned int i = 0; i < fileset->files.size(); i++) {
const int file_idx = (i + fileset->first_ioproc) % fileset->nioprocs;
file_t& file = fileset->files[file_idx];
@@ -310,7 +308,8 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
}
// check the timelevel
- if (patch->timelevel >= read_completely.at(patch->vindex).size()) {
+ if ((unsigned int) patch->timelevel >=
+ read_completely.at(patch->vindex).size()) {
CCTK_VWarn (3, __LINE__, __FILE__, CCTK_THORNSTRING,
"Ignoring dataset '%s' (invalid timelevel %d)",
patch->patchname.c_str(), patch->timelevel);
@@ -332,9 +331,9 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
}
// check if all variables have been read completely already
- int all_read_completely = true;
- for (int vindex = 0; vindex < read_completely.size(); vindex++) {
- for (int tl = 0; tl < read_completely[vindex].size(); tl++) {
+ bool all_read_completely = true;
+ for (unsigned int vindex = 0; vindex < read_completely.size(); vindex++) {
+ for (unsigned int tl = 0; tl < read_completely[vindex].size(); tl++) {
all_read_completely &= read_completely[vindex][tl];
}
}
@@ -345,7 +344,7 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
// check that all variables have been read completely on this mglevel/reflevel
int num_incomplete = 0;
- for (int vindex = 0; vindex < read_completely.size(); vindex++) {
+ for (unsigned int vindex = 0; vindex < read_completely.size(); vindex++) {
if (CCTK_GroupTypeFromVarI (vindex) != CCTK_GF and reflevel > 0) {
continue;
@@ -364,7 +363,7 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
delete[] value;
}
- for (int tl = 0; tl < read_completely[vindex].size(); tl++) {
+ for (unsigned int tl = 0; tl < read_completely[vindex].size(); tl++) {
if (called_from == FILEREADER_DATA and not
(ioUtilGH->do_inVars and ioUtilGH->do_inVars[vindex])) {
continue;
@@ -692,7 +691,7 @@ static int ReadVar (const cGH* const cctkGH,
DECLARE_CCTK_PARAMETERS;
const int gindex = CCTK_GroupIndexFromVarI (patch->vindex);
- assert (gindex >= 0 and gindex < Carpet::arrdata.size());
+ assert (gindex >= 0 and (unsigned int) gindex < Carpet::arrdata.size());
cGroup group;
CCTK_GroupData (gindex, &group);