diff options
author | tradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001> | 2002-04-23 16:41:31 +0000 |
---|---|---|
committer | tradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001> | 2002-04-23 16:41:31 +0000 |
commit | cf7d25d425bb83833c99ff88a73ea4838b50feb5 (patch) | |
tree | 500f5d7deee8c35c0360f39f994b32b78fda25d9 /src/GHExtension.c | |
parent | a1063cbd7ddb585ac878ce431bc929a5fd8271e9 (diff) |
Code cleanup before moving into production mode.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOPanda/trunk@29 38c3d835-c875-442e-b0fe-21c19ce1d001
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r-- | src/GHExtension.c | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c deleted file mode 100644 index b3cdd1d..0000000 --- a/src/GHExtension.c +++ /dev/null @@ -1,159 +0,0 @@ - /*@@ - @file GHExtension.c - @date 01 Oct 1999 - @author Jonghyun Lee - @desc IOPanda GH extension stuff - @enddesc - @history - @endhistory - @@*/ - -/*#define DEBUG_IO*/ - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -#include "cctk.h" -#include "cctk_Parameters.h" -#include "CactusBase/IOUtil/src/ioGH.h" -#include "ioPandaGH.h" - -void *IOPanda_SetupGH (tFleshConfig *config, - int convergence_level, - cGH *GH); -int IOPanda_InitGH (cGH *GH); -void Panda_Create(int, int); - - - /*@@ - @routine IOPanda_SetupGH - @date Fri 01 Oct 1999 - @author Jonghyun Lee - @desc - Allocates the IOPanda GH extension structure. - @enddesc - @calledby CCTK scheduler at CCTK_INITIALIZE - @var config - @vdesc flesh configuration structure (unused) - @vtype tFleshConfig * - @vio in - @endvar - @var convergence_level - @vdesc convergence level (unused) - @vtype int - @vio in - @endvar - @var GH - @vdesc pointer to grid hierarchy - @vtype cGH * - @vio in - @endvar - @history - - @endhistory -@@*/ -void *IOPanda_SetupGH (tFleshConfig *config, - int convergence_level, - cGH *GH) -{ - int numvars; - pandaGH *newGH; - - - /* avoid warnings about unused arguments */ - config = config; - convergence_level = convergence_level; - GH = GH; - - numvars = CCTK_NumVars (); - - newGH = (pandaGH *) malloc (sizeof (pandaGH)); - newGH->do_out3D = (char *) malloc (numvars * sizeof (char)); - newGH->out3D_last = (int *) malloc (numvars * sizeof (int)); - - return (newGH); -} - - - /*@@ - @routine IOPanda_InitGH - @date Fri 01 Oct 1999 - @author Jonghyun Lee - @desc - The GH initialization routine for IOFlexIO. - Necessary output dirs are created. - @enddesc - @calledby CCTK scheduler at CCTK_INITIALIZE - @var GH - @vdesc pointer to grid hierarchy - @vtype cGH * - @vio in - @endvar - @history - - @endhistory -@@*/ -int IOPanda_InitGH (cGH *GH) -{ - DECLARE_CCTK_PARAMETERS - int i; - ioGH *ioUtilGH; - pandaGH *myGH; - - - /* get the handles for IOUtil and IOPanda extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - myGH = (pandaGH *) GH->extensions [CCTK_GHExtensionHandle ("IOPanda")]; - - /* How often to output */ - myGH->out3D_every = out_every > 0 ? out_every : -1; - if (out3D_every > 0) - { - myGH->out3D_every = out3D_every; - } - - /* Check whether "outdir3D" was set. - If so take this dir otherwise default to "IO::outdir" */ - if (CCTK_ParameterQueryTimesSet ("outdir3D", CCTK_THORNSTRING) > 0) - { - myGH->outdir3D = strdup (outdir3D); - } - else - { - myGH->outdir3D = strdup (outdir); - } - - /* Create the output directory */ - if (CCTK_MyProc (GH) == 0) - { - FILE *fp; - - - i = CCTK_CreateDirectory (0755, myGH->outdir3D); - if (i < 0) - { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOPanda_InitGH: Problem creating IOPanda 3D output " - "directory '%s'", myGH->outdir3D); - } - else if (i > 0) - { - CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, - "IOPanda_InitGH: IOPanda 3D output directory '%s' already " - "exists", myGH->outdir3D); - } - fp = fopen ("FILEPREFIX", "w"); - fprintf (fp, "%s", myGH->outdir3D); - fclose (fp); - } - - for (i = 0; i < CCTK_NumVars (); i++) - { - myGH->out3D_last [i] = -1; - } - - Panda_Create (ioUtilGH->ioproc_every, 1); - - return (0); -} |