aboutsummaryrefslogtreecommitdiff
path: root/src/DumpGH.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-03-14 17:05:54 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-03-14 17:05:54 +0000
commitce573e602773f737f664904cc68051bad16f910a (patch)
tree5eb4a26b78e0238bd0b1ea86f911ca18318b179f /src/DumpGH.c
parenta605efeccf30f1ab733cc0f58694b4404750884d (diff)
More stuff for cp/recovery.
Changes to use the new interface for CCTK_ParameterWalk(). Preparations for calling parameter recovery routine by scheduler. Checkpoint only variables of active implementations. Fixed warnings when compiling with LAM-MPI or no MPI at all. Thomas git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@96 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/DumpGH.c')
-rw-r--r--src/DumpGH.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/DumpGH.c b/src/DumpGH.c
index d2949b0..5f4880d 100644
--- a/src/DumpGH.c
+++ b/src/DumpGH.c
@@ -131,21 +131,29 @@ void IOFlexIO_InitialDataDumpGH (cGH *GH)
void IOFlexIO_DumpParams (cGH *GH, IOFile iof)
{
- int first;
+ int i, first;
char *param;
+ const char *thorn;
+ const cParamData *pdata;
- first = 1;
- while ((param = CCTK_ParameterWalk (first, NULL)) != NULL) {
- char *impl, *name, *aname, *value;
+ /* loop over all thorns */
+ for (i = CCTK_NumCompiledThorns () - 1; i >= 0; i--) {
+
+ thorn = CCTK_CompiledThorn (i);
+
+ /* skip all inactive thorns */
+ if (! CCTK_IsThornActive (thorn))
+ continue;
+
+ /* now walk through all parameters of given thorn */
+ first = 1;
+ while (CCTK_ParameterWalk (first, thorn, &param, &pdata) == 0) {
+ char *aname, *value;
- first = 0;
+ first = 0;
- if (Util_SplitString (&impl, &name, param, "::") != 0)
- CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Couldn't parse name of parameter '%s'", param);
- else {
- value = CCTK_ParameterValString (name, CCTK_ImplementationThorn (impl));
+ value = CCTK_ParameterValString (pdata->name, pdata->thorn);
if (value == NULL)
CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
"Couldn't get value for parameter '%s'", param);
@@ -160,14 +168,10 @@ void IOFlexIO_DumpParams (cGH *GH, IOFile iof)
free (value);
}
- free (impl);
- free (name);
-
- }
-
- free (param);
+ free (param);
- } /* end of loop walking over all parameters */
+ } /* end of loop walking over all parameters of given thorn */
+ } /* end of looping over all thorns */
}
@@ -176,6 +180,7 @@ void IOFlexIO_DumpGHExtensions (cGH *GH, IOFile iof)
CCTK_INT4 i_temp;
CCTK_REAL d_temp;
ioGH *ioUtilGH;
+ extern int CCTK_MainLoopIndex (void);
/* Get the handle for IOUtil extensions */
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
@@ -323,8 +328,10 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from)
/* ... now the variables */
for (index = 0; index < CCTK_NumVars (); index++) {
- /* let only variables pass which have storage assigned */
- if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index)))
+ /* let only variables pass which belong to an active implementation and
+ have storage assigned */
+ if (! CCTK_IsImplementationActive (CCTK_ImpFromVarI (index)) ||
+ ! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index)))
continue;
if (verbose) {