aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CheckpointRecovery.c19
-rw-r--r--src/ioutil_CheckpointRecovery.h2
2 files changed, 5 insertions, 16 deletions
diff --git a/src/CheckpointRecovery.c b/src/CheckpointRecovery.c
index cba3106..b512e50 100644
--- a/src/CheckpointRecovery.c
+++ b/src/CheckpointRecovery.c
@@ -764,25 +764,14 @@ void IOUtil_SetAllParameters (char *parameters)
}
-int IOUtil_RestartFromRecovery (cGH *GH)
+int IOUtil_RestartFromRecovery (const cGH *GH)
{
- ioGH *myGH;
- int handle;
- int result;
+ const ioGH *myGH;
- result = 0;
- handle = CCTK_GHExtensionHandle ("IO");
- if (GH != NULL && handle >= 0)
- {
- myGH = (ioGH *) GH->extensions[handle];
- if (myGH)
- {
- result = myGH->recovered;
- }
- }
+ myGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
- return (result);
+ return (myGH ? myGH->recovered : 0);
}
diff --git a/src/ioutil_CheckpointRecovery.h b/src/ioutil_CheckpointRecovery.h
index 4340fda..dd5aa36 100644
--- a/src/ioutil_CheckpointRecovery.h
+++ b/src/ioutil_CheckpointRecovery.h
@@ -61,7 +61,7 @@ char *IOUtil_GetAllParameters (cGH *GH);
void IOUtil_SetAllParameters (char *parameters);
/* return true if this run was restarted from recovery, otherwise false */
-int IOUtil_RestartFromRecovery (cGH *GH);
+int IOUtil_RestartFromRecovery (const cGH *GH);
/* print the checkpoint/recovery timings to stdout */
void IOUtil_PrintTimings (const char *description,