diff options
author | allen <allen@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2001-08-26 17:27:25 +0000 |
---|---|---|
committer | allen <allen@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2001-08-26 17:27:25 +0000 |
commit | 25a72824915dc01e57b865d4b4a08833ef95d2b9 (patch) | |
tree | 6f9da85bffda34bcebeeb87ee57e2722af4bfd2a /src | |
parent | 4dc67c6a0904a6467951570022bf88c9351f721a (diff) |
Adding more output for newverbose parameter on startup/steering:
- IO method registration
- Directory used
- Output every
- Variables output
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@76 94b1c47f-dcfd-45ef-a468-0854c0e9e350
Diffstat (limited to 'src')
-rw-r--r-- | src/Output1D.c | 38 | ||||
-rw-r--r-- | src/Output2D.c | 31 | ||||
-rw-r--r-- | src/Startup.c | 53 |
3 files changed, 109 insertions, 13 deletions
diff --git a/src/Output1D.c b/src/Output1D.c index 84dfd3b..748d153 100644 --- a/src/Output1D.c +++ b/src/Output1D.c @@ -266,10 +266,13 @@ int IOASCII_TriggerOutput1D (cGH *GH, int vindex) /* check if steerable parameters have changed */ static void CheckSteerableParameters (asciiioGH *myGH) { - DECLARE_CCTK_PARAMETERS + int i; + int out_old; int times_set; static int out1D_vars_lastset = -1; + DECLARE_CCTK_PARAMETERS + out_old = myGH->out2D_every; /* How often to output */ myGH->out1D_every = out_every > 0 ? out_every : -1; @@ -278,6 +281,19 @@ static void CheckSteerableParameters (asciiioGH *myGH) myGH->out1D_every = out1D_every; } + /* Report if frequency changed */ + + if (myGH->out1D_every != out_old) + { + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_1D: Output every %d iterations", + myGH->out1D_every); + } + out_old = myGH->out2D_every; + } + /* re-parse the 'out1D_vars' parameter if it was changed */ times_set = CCTK_ParameterQueryTimesSet ("out1D_vars", CCTK_THORNSTRING); if (times_set != out1D_vars_lastset) @@ -286,6 +302,19 @@ static void CheckSteerableParameters (asciiioGH *myGH) CCTK_TraverseString (out1D_vars, SetOutputFlag, myGH->do_out1D, CCTK_GROUP_OR_VAR); + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + for (i=0;i<CCTK_NumVars();i++) + { + if (myGH->do_out1D[i]) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_1D: Output requested for %s", + CCTK_FullName(i)); + } + } + } + /* Save the last setting of 'out1D_vars' parameter */ out1D_vars_lastset = times_set; } @@ -308,8 +337,8 @@ static int CheckOutputVar (int vindex) { fullname = CCTK_FullName (vindex); CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, - "No IOASCII 1D output for '%s' (not a grid function " - "or an array)", fullname); + "CheckOutputVar: No IOASCII 1D output for '%s' (not a grid " + "function or an array)", fullname); free (fullname); } @@ -332,6 +361,7 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg) if (optstring) { CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, - "Optional string '%s' in variable name ignored", optstring); + "SetOutputFlag: Optional string '%s' in variable name ignored", + optstring); } } diff --git a/src/Output2D.c b/src/Output2D.c index a3a497b..c0187e3 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -266,10 +266,13 @@ int IOASCII_TriggerOutput2D (cGH *GH, int vindex) /* check if steerable parameters have changed */ static void CheckSteerableParameters (asciiioGH *myGH) { - DECLARE_CCTK_PARAMETERS + int i; + int out_old; int times_set; static int out2D_vars_lastset = -1; + DECLARE_CCTK_PARAMETERS + out_old = myGH->out2D_every; /* How often to output */ myGH->out2D_every = out_every > 0 ? out_every : -1; @@ -278,6 +281,19 @@ static void CheckSteerableParameters (asciiioGH *myGH) myGH->out2D_every = out2D_every; } + /* Report if frequency changed */ + + if (myGH->out2D_every != out_old) + { + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output every %d iterations", + myGH->out2D_every); + } + out_old = myGH->out2D_every; + } + /* re-parse the 'out2D_vars' parameter if it was changed */ times_set = CCTK_ParameterQueryTimesSet ("out2D_vars", CCTK_THORNSTRING); if (times_set != out2D_vars_lastset) @@ -286,6 +302,19 @@ static void CheckSteerableParameters (asciiioGH *myGH) CCTK_TraverseString (out2D_vars, SetOutputFlag, myGH->do_out2D, CCTK_GROUP_OR_VAR); + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + for (i=0;i<CCTK_NumVars();i++) + { + if (myGH->do_out2D[i]) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output requested for %s", + CCTK_FullName(i)); + } + } + } + /* Save the last setting of 'out2D_vars' parameter */ out2D_vars_lastset = times_set; } diff --git a/src/Startup.c b/src/Startup.c index 07981b2..edb94f8 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -57,7 +57,7 @@ void IOASCII_Startup (void) /* check that thorn IOUtil was activated */ if (CCTK_GHExtensionHandle ("IO") < 0) { - CCTK_WARN (1, "Thorn IOUtil was not activated. " + CCTK_WARN (1, "IOASCII_Startup: Thorn IOUtil was not activated. " "No IOASCII IO methods will be enabled."); return; } @@ -133,6 +133,17 @@ static void *IOASCII_SetupGH (tFleshConfig *config, CCTK_RegisterIOMethodTimeToOutput (i, IOASCII_TimeFor2D); CCTK_RegisterIOMethodTriggerOutput (i, IOASCII_TriggerOutput2D); + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals( newverbose, "full")) + { + CCTK_INFO ("I/O Method 'IOASCII_1D' registered"); + CCTK_INFO ("IOASCII_1D: Output of 1D lines of grid functions/arrays " + "to ASCII files"); + CCTK_INFO ("I/O Method 'IOASCII_2D' registered"); + CCTK_INFO ("IOASCII_2D: Output of 2D planes of grid functions/arrays " + "to ASCII files"); + } + /* allocate the GH extension and its components */ newGH = (asciiioGH *) malloc (sizeof (asciiioGH)); @@ -180,6 +191,31 @@ static void *IOASCII_SetupGH (tFleshConfig *config, { newGH->out2D_every = out2D_every; } + + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + if (out1D_every > 0) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_1D: Output every %d iterations", + newGH->out1D_every); + } + else + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_1D: Output not activated"); + } + if (out2D_every > 0) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output every %d iterations", + newGH->out2D_every); + } + else + { + CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output not activated"); + } + } + + /* Deal with the output directories */ /* Check whether "outdirXD" was set. @@ -196,14 +232,14 @@ static void *IOASCII_SetupGH (tFleshConfig *config, if (i < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOASCII_InitGH: problem creating IOASCII 1D output" + "IOASCII_InitGH: Problem creating IOASCII 1D output" " directory '%s'", newGH->outdir1D); } - else if (i > 0 && CCTK_Equals (newverbose, "full")) + else if (i >= 0 && CCTK_Equals (newverbose, "full")) { CCTK_VInfo (CCTK_THORNSTRING, - "IOASCII_InitGH: 1D output directory '%s' already exists", - newGH->outdir1D); + "IOASCII_1D: Output to directory '%s'", + newGH->outdir1D); } /* create the 2D output dir */ @@ -214,12 +250,13 @@ static void *IOASCII_SetupGH (tFleshConfig *config, "IOASCII_InitGH: problem creating IOASCII 2D output" " directory '%s'", newGH->outdir2D); } - else if (i > 0 && CCTK_Equals (newverbose, "full")) + else if (i >= 0 && CCTK_Equals (newverbose, "full")) { CCTK_VInfo (CCTK_THORNSTRING, - "IOASCII_InitGH: 2D output directory '%s' already exists", - newGH->outdir2D); + "IOASCII_2D: Output to directory '%s'", + newGH->outdir2D); } + } else { |