aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2001-07-11 21:50:47 +0000
committerallen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2001-07-11 21:50:47 +0000
commit8f1deb36a120092db6a4ed4f8906b7e5007210e0 (patch)
tree40ae6950cd4f920d6c90e8a84abd72418d0078ca
parent40076cb17ebdbe4e5b5bcacd69e6dc46c91ac8e0 (diff)
Initial implementation of newverbose parameter in IOBasic.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@94 b589c3ab-70e8-4b4d-a09f-cba2dd200880
-rw-r--r--param.ccl1
-rw-r--r--src/GHExtension.c32
-rw-r--r--src/Output.c27
-rw-r--r--src/OutputInfo.c24
-rw-r--r--src/Startup.c12
5 files changed, 90 insertions, 6 deletions
diff --git a/param.ccl b/param.ccl
index 9eb44d4..f4b73cb 100644
--- a/param.ccl
+++ b/param.ccl
@@ -88,6 +88,7 @@ USES INT out_every
# various things
################
USES BOOLEAN verbose
+USES BOOLEAN newverbose
USES BOOLEAN new_filename_scheme
EXTENDS KEYWORD out_fileinfo
{
diff --git a/src/GHExtension.c b/src/GHExtension.c
index bf53d1e..df3d69c 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -45,10 +45,9 @@ void *IOBasic_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
int IOBasic_InitGH (cGH *GH)
{
- DECLARE_CCTK_PARAMETERS
int i;
iobasicGH *myGH;
-
+ DECLARE_CCTK_PARAMETERS
/* get the handles for IOBasic extensions */
myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")];
@@ -57,11 +56,15 @@ int IOBasic_InitGH (cGH *GH)
/* How often to output */
myGH->outInfo_every = out_every > 0 ? out_every : -1;
if (outInfo_every > 0)
+ {
myGH->outInfo_every = outInfo_every;
+ }
myGH->outScalar_every = out_every > 0 ? out_every : -1;
if (outScalar_every > 0)
+ {
myGH->outScalar_every = outScalar_every;
+ }
/* Check whether "outdirScalar" was set.
If so take this dir otherwise default to "IO::outdir" */
@@ -102,5 +105,30 @@ int IOBasic_InitGH (cGH *GH)
myGH->filenameListScalar = NULL;
+ /* Provide Information */
+ if (CCTK_Equals(newverbose,"standard") || CCTK_Equals(newverbose,"full"))
+ {
+ if (myGH->outInfo_every > 0)
+ {
+ CCTK_VInfo("IOBasic","Info: Output every %d iterations",
+ myGH->outInfo_every);
+ }
+ else
+ {
+ CCTK_VInfo("IOBasic","Info: No output requested");
+ }
+ CCTK_INFO("Info: Output to screen (standard output)");
+ if (myGH->outScalar_every > 0)
+ {
+ CCTK_VInfo("IOBasic","Scalar: Output every %d iterations",
+ myGH->outScalar_every);
+ }
+ else
+ {
+ CCTK_VInfo("IOBasic","Scalar: No output requested");
+ }
+ CCTK_VInfo("IOBasic","Scalar: Output to directory %s",myGH->outdirScalar);
+ }
+
return 0;
}
diff --git a/src/Output.c b/src/Output.c
index 2f3a96a..0461611 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -290,18 +290,29 @@ int IOBasic_TriggerOutput (cGH *GH, int vindex)
/* check if steerable parameters have changed */
static void CheckSteerableParameters (iobasicGH *myGH)
{
- DECLARE_CCTK_PARAMETERS
int times_set;
+ int out_old;
+ int i;
static int outScalar_vars_lastset = -1;
+ DECLARE_CCTK_PARAMETERS
/* How often to output */
+ out_old = myGH->outScalar_every;
myGH->outScalar_every = out_every > 0 ? out_every : -1;
if (outScalar_every > 0)
{
myGH->outScalar_every = outScalar_every;
}
-
+ if (myGH->outScalar_every != out_old)
+ {
+ if (CCTK_Equals(newverbose,"standard") || CCTK_Equals(newverbose,"full"))
+ {
+ CCTK_VInfo("IOBasic","Scalar: Output every %d iterations",
+ myGH->outScalar_every);
+ }
+ }
+
/* re-parse the 'outScalar_vars' parameter if it was changed */
times_set = CCTK_ParameterQueryTimesSet ("outScalar_vars", CCTK_THORNSTRING);
if (times_set != outScalar_vars_lastset)
@@ -310,6 +321,18 @@ static void CheckSteerableParameters (iobasicGH *myGH)
CCTK_TraverseString (outScalar_vars, SetOutputFlag, myGH->do_outScalar,
CCTK_GROUP_OR_VAR);
+ if (CCTK_Equals(newverbose,"full"))
+ {
+ for (i=0;i<CCTK_NumVars();i++)
+ {
+ if (myGH->do_outScalar[i] > 0)
+ {
+ CCTK_VInfo("IOBasic","Scalar: Output requested for %s",
+ CCTK_VarName(i));
+ }
+ }
+ }
+
/* Save the last setting of 'outScalar_vars' parameter */
outScalar_vars_lastset = times_set;
}
diff --git a/src/OutputInfo.c b/src/OutputInfo.c
index 224c60b..2d763e6 100644
--- a/src/OutputInfo.c
+++ b/src/OutputInfo.c
@@ -74,6 +74,7 @@ int IOBasic_OutputInfoGH (cGH *GH)
int ierr1;
int ierr2;
int times_set;
+ int out_old;
const char *vname;
iobasicGH *myGH;
char ll[80], l1[1024], l2[1024], l3[1024];
@@ -83,12 +84,21 @@ int IOBasic_OutputInfoGH (cGH *GH)
myGH = (iobasicGH *) CCTK_GHExtension (GH, "IOBasic");
/* How often to output */
+ out_old = myGH->outInfo_every;
myGH->outInfo_every = out_every > 0 ? out_every : -1;
if (outInfo_every > 0)
{
myGH->outInfo_every = outInfo_every;
}
-
+ if (myGH->outInfo_every != out_old)
+ {
+ if (CCTK_Equals(newverbose,"standard") || CCTK_Equals(newverbose,"full"))
+ {
+ CCTK_VInfo("IOBasic","Info: Output every %d iterations",
+ myGH->outInfo_every);
+ }
+ }
+
/* Return if no output is required */
if (myGH->outInfo_every < 1 ||
GH->cctk_iteration % myGH->outInfo_every != 0)
@@ -105,6 +115,18 @@ int IOBasic_OutputInfoGH (cGH *GH)
CCTK_TraverseString (outInfo_vars, SetOutputFlag, myGH->do_outInfo,
CCTK_GROUP_OR_VAR);
+ if (CCTK_Equals(newverbose,"full"))
+ {
+ for (i=0;i<CCTK_NumVars();i++)
+ {
+ if (myGH->do_outInfo[i] > 0)
+ {
+ CCTK_VInfo("IOBasic","Info: Output requested for %s",
+ CCTK_VarName(i));
+ }
+ }
+ }
+
/* Save the last setting of 'outInfo_vars' parameter */
outInfo_vars_lastset = times_set;
diff --git a/src/Startup.c b/src/Startup.c
index 9a1a8c7..43637c3 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -12,6 +12,7 @@
#include <string.h>
#include "cctk.h"
+#include "cctk_Parameters.h"
static const char *rcsid = "$Header$";
@@ -53,7 +54,7 @@ void IOBasic_Startup (void)
{
int IOMethod;
int IO_GHExtension;
-
+ DECLARE_CCTK_PARAMETERS
if (CCTK_GHExtensionHandle ("IO") < 0)
{
@@ -77,5 +78,14 @@ void IOBasic_Startup (void)
CCTK_RegisterIOMethodOutputGH (IOMethod, IOBasic_OutputInfoGH);
CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOBasic_TimeForInfo);
CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOBasic_TriggerOutputInfo);
+
+ if (CCTK_Equals(newverbose,"standard") || CCTK_Equals(newverbose,"full"))
+ {
+ CCTK_INFO("IO Method <Scalar> registered");
+ CCTK_INFO("Scalar: Output of scalar quantities "
+ "(grid scalars, reductions) to ASCII file");
+ CCTK_INFO("IO Method <Info> registered");
+ CCTK_INFO("Info: Output of reductions of grid functions to screen");
+ }
}