aboutsummaryrefslogtreecommitdiff
path: root/src/Startup.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2002-05-06 09:16:28 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2002-05-06 09:16:28 +0000
commitfe88d9e6f770a9d36acc8ffc02655a5c68fa8b7d (patch)
tree50c97ccae5cd94d5b65209ed2be3dd4cbe1783c7 /src/Startup.c
parent4121f7f8af4cb1b3232319205129d9cef22e53b1 (diff)
Parameter names changes as announced in today's mail to users@cactuscode.org.
You must also update thorn IOUtil now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@241 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Startup.c')
-rw-r--r--src/Startup.c71
1 files changed, 27 insertions, 44 deletions
diff --git a/src/Startup.c b/src/Startup.c
index ecddd20..e75b1d4 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -112,7 +112,7 @@ int IOFlexIO_TerminateGH (const cGH *GH)
while (current)
{
IEEEfiles_2D = (IOFile *) current->data;
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Closing 2D IEEEIO output files "
"for variable alias '%s'", current->name);
@@ -131,7 +131,7 @@ int IOFlexIO_TerminateGH (const cGH *GH)
IEEEfile = (IEEEfile_t *) current->data;
if (IEEEfile->iofile)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Closing IEEEIO output file '%s'",
IEEEfile->filename);
@@ -205,9 +205,10 @@ int IOFlexIO_TerminateGH (const cGH *GH)
@@*/
static void *SetupGH (tFleshConfig *config, int conv_level, cGH *GH)
{
- int i, numvars, maxdim;
+ int i, numvars;
flexioGH *myGH;
const ioGH *ioUtilGH;
+ const char *default_out_dir;
const char *timer_names[4] = {"IOFlexIO time to dump parameters",
"IOFlexIO time to dump datasets",
"IOFlexIO total time to checkpoint",
@@ -242,72 +243,54 @@ static void *SetupGH (tFleshConfig *config, int conv_level, cGH *GH)
numvars = CCTK_NumVars ();
myGH = (flexioGH *) malloc (sizeof (flexioGH));
myGH->requests = (ioRequest **) calloc (numvars, sizeof (ioRequest *));
- myGH->do_out2D = (char *) malloc (numvars * sizeof (char));
+ myGH->out_every = (int *) malloc (numvars * sizeof (int));
+ myGH->out2D_every = (int *) malloc (numvars * sizeof (int));
myGH->out_last = (int *) malloc (numvars * sizeof (int));
myGH->out2D_last = (int *) malloc (numvars * sizeof (int));
- maxdim = CCTK_MaxDim();
- myGH->sp2xyz = (int **) malloc(maxdim * sizeof (int *));
- for (i = 0; i < maxdim; i++)
- {
- myGH->sp2xyz[i] = (int *) malloc (3 * sizeof (int ));
- }
-
- /* get the handle for IOUtil extensions */
- ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
-
- /* check whether "outdir2D" and/or "outdir3D" were set.
- If so take these dirs otherwise default to "IO::outdir" */
- if (*outdir2D)
- {
- myGH->outdir2D = strdup (outdir2D);
- }
- else
- {
- myGH->outdir2D = CCTK_ParameterValString ("outdir",
- CCTK_ImplementationThorn ("IO"));
- }
+ myGH->out_vars = strdup ("");
+ myGH->out_every_default = out_every - 1;
+ myGH->out2D_vars = strdup ("");
+ myGH->out2D_every_default = out2D_every - 1;
- if (*outdir3D)
- {
- myGH->outdir = strdup (outdir3D);
- }
- else
- {
- myGH->outdir = CCTK_ParameterValString ("outdir",
- CCTK_ImplementationThorn ("IO"));
- }
+ /* get the names of output directories */
+ default_out_dir = *(const char **)
+ CCTK_ParameterGet ("out_dir",
+ CCTK_ImplementationThorn ("IO"), NULL);
+ myGH->out2D_dir = strdup (*out2D_dir ? out2D_dir : default_out_dir);
+ myGH->out_dir = strdup (*out_dir ? out_dir : default_out_dir);
/* create the output directories */
- i = IOUtil_CreateDirectory (GH, myGH->outdir2D,
- ! CCTK_Equals (out3D_mode, "onefile"),
+ ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
+ i = IOUtil_CreateDirectory (GH, myGH->out2D_dir,
+ ! CCTK_Equals (out_mode, "onefile"),
ioUtilGH->ioproc);
if (i < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOFlexIO_InitGH: problem creating IOFlexIO 2D output"
- " directory '%s'", myGH->outdir2D);
+ " directory '%s'", myGH->out2D_dir);
}
- else if (i > 0 && CCTK_Equals (newverbose, "full"))
+ else if (i > 0 && CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING,
"IOFlexIO_InitGH: 2D IOFlexIO output directory '%s' "
- "already exists", myGH->outdir2D);
+ "already exists", myGH->out2D_dir);
}
- i = IOUtil_CreateDirectory (GH, myGH->outdir,
- ! CCTK_Equals (out3D_mode, "onefile"),
+ i = IOUtil_CreateDirectory (GH, myGH->out_dir,
+ ! CCTK_Equals (out_mode, "onefile"),
ioUtilGH->ioproc);
if (i < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOFlexIO_InitGH: Problem creating IOFlexIO output"
- " directory '%s'", myGH->outdir);
+ " directory '%s'", myGH->out_dir);
}
- else if (i > 0 && CCTK_Equals (newverbose, "full"))
+ else if (i > 0 && CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING,
"IOFlexIO_InitGH: IOFlexIO output directory '%s' "
- "already exists", myGH->outdir);
+ "already exists", myGH->out_dir);
}
for (i = 0; i < numvars; i++)