aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001>2002-05-06 09:23:48 +0000
committertradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001>2002-05-06 09:23:48 +0000
commit03a92f415aea5cdd2ac04f749bcc07c86c1b6869 (patch)
tree2112331cf052c630c4e3f2cc370d0215335ca2cf
parent57daa72811142a5f0377bfd2cdba07eebb73e977 (diff)
Parameter names changes as announced in today's mail to users@cactuscode.org.
You must also update thorn IOUtil now. This thorn will be moved from BetaThorns to CactusPUGHIO now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOPanda/trunk@32 38c3d835-c875-442e-b0fe-21c19ce1d001
-rw-r--r--doc/documentation.tex18
-rw-r--r--par/panda.par6
-rw-r--r--param.ccl45
-rw-r--r--schedule.ccl2
-rw-r--r--src/Output.c49
-rw-r--r--src/Startup.c55
-rw-r--r--src/ioPandaGH.h2
-rw-r--r--src/make.code.defn2
8 files changed, 81 insertions, 98 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 53b1102..eeeae89 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -4,10 +4,10 @@
\title{IOPanda}
\author{Jonghyun Lee}
-\date{1999}
+\date{1999\\$ $Revision$ $Date$ $}
\maketitle
-\abstract{Thorn IOPanda provides parallel I/O methods for 3D output of grid functions and multidimensional arrays in using the Panda parallel I/O library.\\
+\abstract{Thorn {\bf IOPanda} provides parallel I/O methods for 3D output of grid functions and multidimensional arrays in using the Panda parallel I/O library.\\
%
\section{What is Panda?}
%
@@ -19,13 +19,13 @@ First, Panda provides high-performance collective array I/O. High-performance I/
entire I/O process rather than just passively respond to file read and write
requests from the compute processors.
-Second, Panda supports flexible in-memory and on-disk layouts. In Panda, applications can use different in-memory and on-disk layouts. If the user specifies different layouts in memory and on disk, Panda automatically and efficiently reorganize the data at I/O time. It supports both regular and irregular distribution of arrays. For regular distribution, Panda follows High-Performance Fortran (HPF) style distribution. The IOPanda thorn use (BLOCK, *, *) distribution as a default when writing out grid functions in Cactus, which makes the process to create a single array file much easier when multiple I/O processors creates multiple data files.
+Second, Panda supports flexible in-memory and on-disk layouts. In Panda, applications can use different in-memory and on-disk layouts. If the user specifies different layouts in memory and on disk, Panda automatically and efficiently reorganize the data at I/O time. It supports both regular and irregular distribution of arrays. For regular distribution, Panda follows High-Performance Fortran (HPF) style distribution. The {\bf IOPanda} thorn use (BLOCK, *, *) distribution as a default when writing out grid functions in Cactus, which makes the process to create a single array file much easier when multiple I/O processors creates multiple data files.
-Finally, Panda supports many other useful features such as adaptive mesh refinement (AMR) and automatic data migration. For the IOPanda thorn, these features will be included soon.
+Finally, Panda supports many other useful features such as adaptive mesh refinement (AMR) and automatic data migration. For the {\bf IOPanda} thorn, these features will be included soon.
-\section{Thorn IOPanda}
+\section{Thorn {\bf IOPanda}}
%
-Thorn IOPanda registers an IO method called {\tt IOPanda\_3D} with the IO interface in the flesh. This method creates three-dimensional output of 3D grid functions. (and possibly multidimensional arrays, which are not implemented fully in Cactus yet). Panda library integrated into IOPanda thorn has been modified and currently it supports to write array data in IEEEIO binary format. It will be modified again so that it can support output in HDF5.
+Thorn {\bf IOPanda} registers an I/O method called {\tt IOPanda} with the I/O interface in the flesh. This method creates three-dimensional output of 3D grid functions. (and possibly multidimensional arrays, which are not implemented fully in Cactus yet). Panda library integrated into {\bf IOPanda} thorn has been modified and currently it supports to write array data in IEEEIO binary format. It will be modified again so that it can support output in HDF5.
Data written by panda goes into files named {\tt "<varname>.<rank\_of\_io\_processor>"} and will be placed in the directory which is specified in the input paramemter file. Futher processing of these data can be done with visualization tools like Amira, AVS, and IDL.
@@ -34,11 +34,11 @@ Checkpoint/recovery operations are not implemented yet and will be included in t
%
\section{Comments}
%
-Since IOPanda uses parameters from IOUtil it also needs this I/O skeleton thorn compiled into Cactus and activated.
+Since {\bf IOPanda} uses parameters from {\bf IOUtil} it also needs this I/O skeleton thorn compiled into Cactus and activated.
-When using IOPanda thorn, sometimes an error regarding MPI\_TYPE\_MAX can occur. If this happens, simply increase the value using {\tt setenv MPI\_TYPE\_MAX <larger number than current value>}.
+When using {\bf IOPanda} thorn, sometimes an error regarding MPI\_TYPE\_MAX can occur. If this happens, simply increase the value using {\tt setenv MPI\_TYPE\_MAX <larger number than current value>}.
-If arrays cannot be divided evenly by the mesh determined by Cactus (i.e. dividing 10x10 array into nine chunks using 3x3 mesh), IOPanda can't handle this case because it divides array in a way different from Cactus. Please avoid this case for now.
+If arrays cannot be divided evenly by the mesh determined by Cactus (i.e. dividing 10x10 array into nine chunks using 3x3 mesh), {\bf IOPanda} can't handle this case because it divides array in a way different from Cactus. Please avoid this case for now.
% Automatically created from the ccl files
% Do not worry for now.
\include{interface}
diff --git a/par/panda.par b/par/panda.par
index 79cf44b..80422f6 100644
--- a/par/panda.par
+++ b/par/panda.par
@@ -15,12 +15,12 @@ driver::global_nsize = 10
####################### IO parameters ###################################
# flag to enable verbose output
-IO::verbose = "yes"
+IO::verbose = "standard"
# say how often to output
IO::out_every = 1
-IO::out3D_mode = "onefile"
-IO::out3D_unchunked = "yes"
+IO::out_mode = "onefile"
+IO::out_unchunked = "yes"
# say what variables to output
IOPanda::out_vars = "wavetoy::phi"
diff --git a/param.ccl b/param.ccl
index baf413b..a6931a6 100644
--- a/param.ccl
+++ b/param.ccl
@@ -1,5 +1,5 @@
# Parameter definitions for thorn IOPanda
-
+# $Header$
#############################################################################
### declare IOPanda parameters
@@ -13,17 +13,20 @@ private:
INT out_every "How often to do IOPanda output, overrides IO::out_every" \
STEERABLE = ALWAYS
{
- -1:* :: "Values <= 0 disable IOPanda output"
+ 1:* :: "Every so many iterations"
+ 0: :: "Disable IOPanda output"
+ -1: :: "Default to IO::out_every"
} -1
####################
# Output directories
####################
-STRING outdir "Name of IOPanda output directory, overrides IO::outdir"
+STRING out_dir "Name of IOPanda output directory, overrides IO::out_dir"
{
- .* :: A regex which matces everything
-} "."
+ ".+" :: "A valid directory name"
+ "^$" :: "An empty string to choose the default from IO::out_dir"
+} ""
##########################
@@ -31,7 +34,8 @@ STRING outdir "Name of IOPanda output directory, overrides IO::outdir"
##########################
STRING out_vars "Variables to output in IOPanda file format" STEERABLE = ALWAYS
{
- .* :: A regex which matches everything
+ ".+" :: "Space-separated list of fully qualified variable/group names"
+ "^$" :: "An empty string to output nothing"
} ""
@@ -40,29 +44,8 @@ STRING out_vars "Variables to output in IOPanda file format" STEERABLE = ALWAYS
#############################################################################
shares: IO
-####################
-# Output directories
-####################
-# FIXME: need USES AS
-#USES STRING outdir
-
-
-########################
-# How often to do output
-########################
-# FIXME: need USES AS
-#USES INT out_every
-
-
-################
-# various things
-################
-USES BOOLEAN verbose
-USES KEYWORD newverbose
+# FIXME: want USES STRING out_dir AS default_out_dir
+# FIXME: want USES INT out_every AS default_out_every
+USES KEYWORD verbose
USES BOOLEAN out_fileinfo
-
-
-#######################
-# Specific to 3D output
-#######################
-USES KEYWORD out3D_mode
+USES KEYWORD out_mode
diff --git a/schedule.ccl b/schedule.ccl
index 408792b..1dbb6ac 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -9,7 +9,7 @@ schedule IOPanda_Startup at STARTUP after IOUtil_Startup
LANG:C
} "IOPanda startup routine"
-schedule IOPanda_Finalize at CCTK_TERMINATE
+schedule IOPanda_Finalize at TERMINATE
{
LANG:C
} "IOPanda finalize routine"
diff --git a/src/Output.c b/src/Output.c
index 467fd22..e18615d 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -23,7 +23,7 @@
/* the rcs ID and its dummy funtion to use it */
static const char *rcsid = "$Header$";
-CCTK_FILEVERSION(BetaThorns_IOPanda_Output_c)
+CCTK_FILEVERSION(CactusPUGHIO_IOPanda_Output_c)
/********************************************************************
@@ -46,9 +46,8 @@ static void AddChunkAttributes (const cGH *GH, const ioRequest *request,
Loops over all variables and outputs them if necessary
@enddesc
- @calls CheckSteerableParameters
- IOPanda_TimeFor
- IOPanda_OutputVarAs
+ @calls IOPanda_TimeFor
+ DumpVar
@var GH
@vdesc pointer to CCTK GH
@@ -65,42 +64,26 @@ static void AddChunkAttributes (const cGH *GH, const ioRequest *request,
int IOPanda_OutputGH (const cGH *GH)
{
int vindex, retval;
- pandaGH *myGH;
- char *fullname;
- const char *name;
- DECLARE_CCTK_PARAMETERS
-
+ const pandaGH *myGH;
- CheckSteerableParameters (GH);
- myGH = (pandaGH *) CCTK_GHExtension (GH, "IOPanda");
+ myGH = (const pandaGH *) CCTK_GHExtension (GH, "IOPanda");
if (myGH->out_every <= 0)
{
return (0);
}
+ retval = 0;
+
/* loop over all variables */
- for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++)
+ for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
{
- if (IOPanda_TimeFor (GH, vindex))
+ if (IOPanda_TimeFor (GH, vindex) &&
+ DumpVar (GH, myGH->requests[vindex], CCTK_VarName (vindex)) == 0)
{
- name = CCTK_VarName (vindex);
- fullname = CCTK_FullName (vindex);
-
- if (verbose)
- {
- CCTK_VInfo (CCTK_THORNSTRING, "IOPanda_OutputGH: "
- "(fullname, name) = (%s, %s)", fullname, name);
- }
-
- if (IOPanda_OutputVarAs (GH, fullname, name) == 0)
- {
- /* register variable as having output this iteration */
- myGH->out_last[vindex] = GH->cctk_iteration;
- retval++;
- }
-
- free (fullname);
+ /* register variable as having output this iteration */
+ myGH->out_last[vindex] = GH->cctk_iteration;
+ retval++;
}
}
@@ -150,7 +133,7 @@ int IOPanda_OutputVarAs (const cGH *GH, const char *fullname, const char *alias)
vindex = CCTK_VarIndex (fullname);
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "IOPanda_OutputVarAs: (fullname, alias, "
"index) = (%s, %s, %d)", fullname, alias, vindex);
@@ -207,8 +190,8 @@ int IOPanda_OutputVarAs (const cGH *GH, const char *fullname, const char *alias)
int IOPanda_TimeFor (const cGH *GH, int vindex)
{
int retval;
- const pandaGH *myGH;
char *fullname;
+ const pandaGH *myGH;
CheckSteerableParameters (GH);
@@ -270,7 +253,7 @@ int IOPanda_TriggerOutput (const cGH *GH, int vindex)
varname = CCTK_VarName (vindex);
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "TriggerOutput: "
"name, index = %s, %d", varname, vindex);
diff --git a/src/Startup.c b/src/Startup.c
index d5f59c1..7d48617 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -21,8 +21,8 @@
#include "Panda/c_interface.h"
/* the rcs ID and its dummy function to use it */
-static const char *rcsid = "$Id$";
-CCTK_FILEVERSION(BetaThorns_IOPanda_Startup_c)
+static const char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusPUGHIO_IOPanda_Startup_c)
/********************************************************************
@@ -134,8 +134,8 @@ static void *SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
(void) (convergence_level + 0);
- /* Register IOPanda's routines as a new I/O method */
- i = CCTK_RegisterIOMethod ("IOPandaIO");
+ /* register IOPanda's routines as a new I/O method */
+ i = CCTK_RegisterIOMethod ("IOPanda");
CCTK_RegisterIOMethodOutputGH (i, IOPanda_OutputGH);
CCTK_RegisterIOMethodOutputVarAs (i, IOPanda_OutputVarAs);
CCTK_RegisterIOMethodTimeToOutput (i, IOPanda_TimeFor);
@@ -152,40 +152,57 @@ static void *SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
myGH->out_last[i] = -1;
}
- /* get the handle for IOUtil extensions */
- ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
+ /* get the name of IOPanda's output directory */
+ if (*out_dir == 0)
+ {
+ out_dir = *(const char **)
+ CCTK_ParameterGet ("out_dir", CCTK_ImplementationThorn ("IO"),
+ NULL);
+ }
- /* Check whether "IOPanda::outdir" was set.
- If so take this directory otherwise default to "IO::outdir" */
- if (CCTK_ParameterQueryTimesSet ("outdir", CCTK_THORNSTRING) > 0)
+ /* skip the directory pathname if output goes into current directory */
+ if (strcmp (out_dir, "."))
{
- myGH->outdir = strdup (outdir);
+ i = strlen (out_dir);
+ if (CCTK_Equals (out_mode, "onefile") || ! strstr (out_dir, "%u"))
+ {
+ myGH->out_dir = (char *) malloc (i + 2);
+ strcpy (myGH->out_dir, out_dir);
+ myGH->out_dir[i] = '/';
+ myGH->out_dir[i+1] = 0;
+ }
+ else
+ {
+ myGH->out_dir = (char *) malloc (i + 20);
+ sprintf (myGH->out_dir, out_dir, CCTK_MyProc (GH));
+ strcat (myGH->out_dir, "/");
+ }
}
else
{
- myGH->outdir = CCTK_ParameterValString ("outdir",
- CCTK_ImplementationThorn ("IO"));
+ myGH->out_dir = strdup ("");
}
- /* Create the output directory */
- i = IOUtil_CreateDirectory (GH, myGH->outdir,
- ! CCTK_Equals (out3D_mode, "onefile"),
+ /* create the output directory */
+ ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
+ i = IOUtil_CreateDirectory (GH, myGH->out_dir,
+ ! CCTK_Equals (out_mode, "onefile"),
ioUtilGH->ioproc);
if (i < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Problem creating IOPanda output directory '%s'", myGH->outdir);
+ "Problem creating IOPanda output 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,
- "IOPanda output directory '%s' already exists", myGH->outdir);
+ "IOPanda output directory '%s' already exists", myGH->out_dir);
}
if (CCTK_MyProc (GH) == 0)
{
fp = fopen ("FILEPREFIX", "w");
- fprintf (fp, "%s", myGH->outdir);
+ fprintf (fp, "%s", myGH->out_dir);
fclose (fp);
}
diff --git a/src/ioPandaGH.h b/src/ioPandaGH.h
index 7434e1f..736ca58 100644
--- a/src/ioPandaGH.h
+++ b/src/ioPandaGH.h
@@ -29,7 +29,7 @@ typedef struct
ioRequest **requests;
/* directory in which to output */
- char *outdir;
+ char *out_dir;
/* the last iteration output for variable[i] */
int *out_last;
diff --git a/src/make.code.defn b/src/make.code.defn
index f16782d..17142ba 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = Startup.c Output.c DumpVar.c
+SRCS = Startup.c Output.c
# Other subdirectories
SUBDIRS = Panda