diff options
author | allen <allen@eff87b29-5268-4891-90a3-a07138403961> | 2001-08-26 17:32:26 +0000 |
---|---|---|
committer | allen <allen@eff87b29-5268-4891-90a3-a07138403961> | 2001-08-26 17:32:26 +0000 |
commit | 64721212e4128a5a3b4168862828f3ab9696b38b (patch) | |
tree | 44f30cefe69c9203dbdb702694161527409fb766 | |
parent | 3ccc2c5afda9cc2f2fa79b5148bfda9f8bad5d6d (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/CactusIO/IOJpeg/trunk@43 eff87b29-5268-4891-90a3-a07138403961
-rw-r--r-- | param.ccl | 2 | ||||
-rw-r--r-- | src/GHExtension.c | 28 | ||||
-rw-r--r-- | src/Output2D.c | 31 | ||||
-rw-r--r-- | src/Startup.c | 7 |
4 files changed, 58 insertions, 10 deletions
@@ -108,6 +108,8 @@ CCTK_INT slabdim "default dimension of slab" shares: IO +USES KEYWORD newverbose + ######################## # How often to do output ######################## diff --git a/src/GHExtension.c b/src/GHExtension.c index c541e05..e88d18a 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -16,7 +16,6 @@ void *IOJpeg_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH); void IOJpeg_SliceCenterSetup(CCTK_ARGUMENTS); int IOJpeg_InitGH (cGH *GH); - void *IOJpeg_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) { int numvars,iv; @@ -51,15 +50,25 @@ int IOJpeg_InitGH (cGH *GH) int inum; IOJpegGH *myGH; - myGH = (IOJpegGH *) GH->extensions [CCTK_GHExtensionHandle ("IOJpeg")]; + /* How often to output */ + myGH->out2D_every = out_every > 0 ? out_every : -1; if (out2D_every > 0) { myGH->out2D_every = out2D_every; } + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full")) + { + CCTK_VInfo (CCTK_THORNSTRING, "IOJpeg_2D: Output every %d iterations", + myGH->out2D_every); + } + + /* Initialise iteration of last output */ + for (inum=0; inum<CCTK_NumVars(); inum++) { myGH->out2D_last [inum] = -1; @@ -68,8 +77,9 @@ int IOJpeg_InitGH (cGH *GH) /* Deal with the output directories */ /* Check whether "outdirXD" was set. If so take this dir otherwise default to "IO::outdir" */ - myGH->outdir2D = CCTK_ParameterQueryTimesSet("out2D_dir",CCTK_THORNSTRING)>0 ? - strdup (out2D_dir) : strdup (outdir); + myGH->outdir2D = + CCTK_ParameterQueryTimesSet("out2D_dir",CCTK_THORNSTRING)>0 ? + strdup (out2D_dir) : strdup (outdir); /* create the output dir */ if (CCTK_MyProc (GH) == 0) @@ -79,14 +89,14 @@ int IOJpeg_InitGH (cGH *GH) if (i < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOASCII_InitGH: Problem creating 2D output directory '%s'", + "IOJpeg_InitGH: Problem creating 2D output directory '%s'", myGH->outdir2D); } - if (i > 0) + else if (i >= 0 && CCTK_Equals (newverbose, "full")) { - CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOASCII_InitGH: 2D output directory '%s' already exists", - myGH->outdir2D); + CCTK_VInfo (CCTK_THORNSTRING, + "IOJpeg_2D: Jpeg output to directory '%s'", + myGH->outdir2D); } } diff --git a/src/Output2D.c b/src/Output2D.c index d88b02d..0c63945 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -16,7 +16,6 @@ CCTK_FILEVERSION(CactusIO_IOJpeg_Output2D_c) static void CheckSteerableParameters (IOJpegGH *myGH); static void SetOutputFlag (int vindex, const char *optstring, void *arg); - /*@@ @routine IOJpeg_Output2DGH @date Thu Sep 14 10:47:58 2000 @@ -175,17 +174,35 @@ static void CheckSteerableParameters (IOJpegGH *myGH) { DECLARE_CCTK_PARAMETERS int out2D_vars_current_nset; + int out_old; + int i; static int out2D_vars_lastset = 0; + out_old = myGH->out2D_every; /* How often to output */ + myGH->out2D_every = out_every > 0 ? out_every : -1; if (out2D_every > 0) { 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, "IOJpeg_2D: Output every %d iterations", + myGH->out2D_every); + } + out_old = myGH->out2D_every; + } + /* re-parse the 'out2D_vars' parameter if it was changed */ + out2D_vars_current_nset = CCTK_ParameterQueryTimesSet ("out2D_vars", CCTK_THORNSTRING); if (out2D_vars_current_nset != out2D_vars_lastset) @@ -194,6 +211,18 @@ static void CheckSteerableParameters (IOJpegGH *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, "IOJpeg_2D: Output for %s",CCTK_FullName(i)); + } + } + } + /* Save the last setting of 'out2D_vars' parameter */ out2D_vars_lastset = out2D_vars_current_nset; } diff --git a/src/Startup.c b/src/Startup.c index b4c8eed..919da37 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -41,4 +41,11 @@ void IOJpeg_Startup (void) CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOJpeg_TimeFor2D); CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOJpeg_TriggerOutput2D); + if (CCTK_Equals (newverbose, "standard") || + CCTK_Equals( newverbose, "full")) + { + CCTK_INFO ("I/O Method 'IOJpeg_2D' registered"); + CCTK_INFO ("IOJpeg_2D: Output of 2D slices in 3D in Jpeg format"); + } + } |