diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-08-01 11:38:17 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-08-01 11:38:17 +0000 |
commit | 1ec7c99cb05a7a5dde7ed81fbc185be658822bda (patch) | |
tree | 40ea9282884da6a01d6cbae0eea39cc0968abb8f /src/GHExtension.c | |
parent | ad7050ddb6009847f4b345dbb6c32e1e02e54466 (diff) |
For info output, you can now specify the reduction values to print by setting
IOBasic::outInfo_reductions or add an option string to the variable name
in IOBasic::outInfo_vars. Scalar variables will be output by their value.
The option string syntax is
IOBasic::outInfo_vars = "var1[reductions=<minimum maximum>] var2"
and might still change slightly in the future.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@96 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r-- | src/GHExtension.c | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c deleted file mode 100644 index df3d69c..0000000 --- a/src/GHExtension.c +++ /dev/null @@ -1,134 +0,0 @@ - /*@@ - @file GHExtension.c - @date Friday 18th September - @author Gabrielle Allen - @desc - IO GH extension stuff. - @enddesc - @@*/ - -/* #define DEBUG_IO */ - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "cctk.h" -#include "cctk_Parameters.h" -#include "iobasicGH.h" - -static const char *rcsid = "$Header$"; - -CCTK_FILEVERSION(CactusBase_IOBasic_GHExtension_c) - -void *IOBasic_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) -{ - int i; - iobasicGH *newGH; - - newGH = (iobasicGH *) malloc (sizeof (iobasicGH)); - newGH->infovals = (CCTK_REAL **) - malloc (CCTK_NumVars () * sizeof (CCTK_REAL *)); - for (i=0;i<CCTK_NumVars ();i++) - { - newGH->infovals[i] = (CCTK_REAL *) malloc (2 * sizeof (CCTK_REAL)); - } - - newGH->do_outScalar = (char *) malloc (CCTK_NumVars () * sizeof (char)); - newGH->outScalar_last = (int *) malloc (CCTK_NumVars () * sizeof (int)); - - newGH->do_outInfo = (char *) malloc (CCTK_NumVars () * sizeof (char)); - newGH->outInfo_last = (int *) malloc (CCTK_NumVars () * sizeof (int)); - - return newGH; -} - -int IOBasic_InitGH (cGH *GH) -{ - int i; - iobasicGH *myGH; - DECLARE_CCTK_PARAMETERS - - /* get the handles for IOBasic extensions */ - myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; - myGH->filenameListScalar = NULL; - - /* 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" */ - if (CCTK_ParameterQueryTimesSet ("outdirScalar", CCTK_THORNSTRING) > 0) - { - myGH->outdirScalar = strdup (outdirScalar); - } - else - { - myGH->outdirScalar = strdup (outdir); - } - - /* create the output dir */ - if (CCTK_MyProc (GH) == 0) - { - i = CCTK_CreateDirectory (0755,myGH->outdirScalar); - if (i < 0) - { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOBasic_InitGH: Problem creating Scalar output directory '%s'", - myGH->outdirScalar); - } - if (i > 0) - { - CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOBasic_InitGH: Scalar output directory '%s' already exists", - myGH->outdirScalar); - } - } - - for (i=0; i<CCTK_NumVars(); i++) - { - myGH->outScalar_last[i] = -1; - myGH->outInfo_last [i] = -1; - myGH->infovals[i][0] = 0.0; - myGH->infovals[i][1] = 0.0; - } - - 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; -} |