aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d>2002-05-06 09:21:30 +0000
committertradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d>2002-05-06 09:21:30 +0000
commit05b0fe4b1f1337319fbd1beb6928610bb92f57b3 (patch)
treecc453d31302e5633d4114666a7747d4c7bebe12b
parentcfd0aa21d5237ba08b06f687c21f5d1d56a41003 (diff)
Parameter names changes as announced in today's mail to users@cactuscode.org.
You must also update thorns IOHDF5Util and IOUtil now. This thorn will be moved from AlphaThorns to CactusPUGHIO now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@127 4825ed28-b72c-4eae-9704-e50c059e567d
-rw-r--r--doc/documentation.tex103
-rw-r--r--par/hdf5.par6
-rw-r--r--param.ccl89
-rw-r--r--schedule.ccl8
-rw-r--r--src/DumpGH.c16
-rw-r--r--src/Output.c60
-rw-r--r--src/RecoverGH.c20
-rw-r--r--src/Startup.c54
-rw-r--r--src/Write.c49
-rw-r--r--src/WriteIsosurface.c4
-rw-r--r--src/ioHDF5GH.h11
-rw-r--r--test/checkpoint.parfile11
-rw-r--r--test/test_recover.par5
13 files changed, 218 insertions, 218 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index a6b14d9..d75e81f 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -4,22 +4,52 @@
\title{IOHDF5}
\author{Thomas Radke}
-\date{1999}
+\date{1999\\$ $Revision$ $Date$ $}
\maketitle
\abstract{
-Thorn IOHDF5 provides an I/O method to output variables in HDF5 file format.
+Thorn {\bf IOHDF5} provides an I/O method to output variables in HDF5 file format.
It also implements checkpointing/recovery functionality using HDF5.
}
%
-\section{Purpose}
%
-Thorn IOHDF5 uses the standard I/O library HDF5 (Hierarchical Data Format
+\section{Building A Cactus Configuration with {\bf IOHDF5}}
+%
+The Cactus distribution does not contain the HDF5 header files and library which
+is used by thorn {\bf IOHDF5}. So you need to configure it as an external
+software package via:
+%
+\begin{verbatim}
+ make <configuration>-config HDF5=yes
+ [HDF5_DIR=<path to HDF5 package>]
+\end{verbatim}
+%
+The configuration script will look in some default places for an installed
+HDF5 package. If nothing is found this way you can explicitly specify it with
+the {\tt HDF5\_DIR} configure variable.
+
+Thorn {\bf IOStreamedHDF5} inherits from {\bf IOUtil} and {\bf IOHDF5Util}
+so you need to include these thorns in your thorn list to build a configuration
+with {\bf IOStreamedHDF5}.
+%Configure also checks which library version is contained within the HDF5
+%package: it can be either serial or parallel. The latter version includes the parallel IO extensions of the MPI 2 standard. To make use of these extensions
+%you need to configure Cactus with both HDF5 and MPI. Please make also sure then
+%that the parallel HDF5 library was built with the same MPI version as is used
+%for Cactus.
+
+%If Cactus was not configured to use HDF5 but has thorn IOHDF5 compiled in
+%it will give a warning message each time a thorn's routine is called
+%saying HDF5 I/O is not available.
+%
+%
+\section{Getting HDF5 Output}
+%
+Thorn {\bf IOHDF5} uses the standard I/O library HDF5 (Hierarchical Data Format
version 5, see {\tt http://hdf.ncsa.uiuc.edu/whatishdf5.html} for details)
-to output any type of grid variables (grid scalars, grid functions, and arrays
-of arbitrary dimension) in the HDF5 file format.\\
+to output any type of CCTK grid variables (grid scalars, grid functions, and
+grid arrays of arbitrary dimension) in the HDF5 file format.\\
-Output is done by invoking the {\tt IOHDF5} I/O method which thorn IOHDF5
+Output is done by invoking the {\tt IOHDF5} I/O method which thorn {\bf IOHDF5}
registers with the flesh's I/O interface at startup.\\
You obtain output by either
@@ -38,24 +68,24 @@ You obtain output by either
Data is written into files named {\tt "<varname>.h5"}.
Such datafiles can be used for further postprocessing (eg. visualization)
-or fed back into Cactus via the filereader capabilities of thorn IOUtil.
+or fed back into Cactus via the filereader capabilities of thorn {\bf IOUtil}.
-\subsection{Parallel File I/O}
+\subsection{Serial versus Parallel Output}
-According to the ouptput mode parameter settings ({\tt IO::out3D\_mode,
-IO::out3D\_unchunked, IO::out3D\_procs}) of thorn IOUtil, thorn IOHDF5
-will output distributed data either
+According to the ouptput mode parameter settings ({\tt IO::out\_mode,
+IO::out\_unchunked, IO::out\_proc\_every}) of thorn {\bf IOUtil}, thorn
+{\bf IOHDF5} will output distributed data either
\begin{itemize}
\item in serial into a single unchunked file
\begin{verbatim}
- IO::out3D_mode = "onefile"
- IO::out3D_unchunked = "yes"
+ IO::out_mode = "onefile"
+ IO::out_unchunked = "yes"
\end{verbatim}
\item in parallel, that is, into separate files containing chunks of the
individual processors' patches of the distributed array
\begin{verbatim}
- IO::out3D_mode = "proc | np"
+ IO::out_mode = "proc|np"
\end{verbatim}
\end{itemize}
The default is to output data in parallel, in order to get maximum I/O
@@ -74,41 +104,39 @@ hdf5\_recombiner} will be placed in the {\tt exe/<configuration>/}
subdirectory.
-\subsection{Checkpointing \& Recovery}
+\section{Checkpointing \& Recovery}
-Thorn IOHDF5 can also be used for creating HDF5 checkpoint files and recovering
-from such files later on.\\
+Thorn {\bf IOHDF5} can also be used for creating HDF5 checkpoint files and
+recovering from such files later on.
Checkpoint routines are scheduled at several timebins so that you can save
the current state of your simulation after the initial data phase,
during evolution, or at termination.
-A recovery routine is registered with thorn IOUtil in order to restart
+A recovery routine is registered with thorn {\bf IOUtil} in order to restart
a new simulation from a given HDF5 checkpoint.
The very same recovery mechanism is used to implement a filereader
-functionality to feed back data into Cactus.\\
+functionality to feed back data into Cactus.
Checkpointing and recovery are controlled by corresponding checkpoint/recovery
-parameters of thorn IOUtil (for a description of these parameters please refer
-to this thorn's documentation).
+parameters of thorn {\bf IOUtil} (for a description of these parameters please
+refer to this thorn's documentation).
-\section{Comments}
-
-\subsection{Importing external data into Cactus with IOHDF5}
+\section{Importing External Data Into Cactus With {bf IOHDF5}}
In order to import external data into Cactus (eg. to initialize some variable)
you first need to convert this data into an HDF5 datafile which then can be
-processed by the registered recovery routine of thorn IOHDF5.\\
+processed by the registered recovery routine of thorn {\bf IOHDF5}.
The following description explains the HDF5 file layout of an unchunked
-datafile which thorn IOHDF5 expects in order to restore Cactus variables
+datafile which thorn {\bf IOHDF5} expects in order to restore Cactus variables
from it properly. There is also a well-documented example C program provided
({\tt IOHDF5/doc/CreateIOHDF5datafile.c}) which illustrates how to create
-a datafile with IOHDF5 file layout. This working example can be used as a
+a datafile with {\bf IOHDF5} file layout. This working example can be used as a
template for building your own data converter program.\\
\begin{enumerate}
- \item Actual data is stored as multidimensional datasets in an IOHDF5 file.
+ \item Actual data is stored as multidimensional datasets in an HDF5 file.
There is no nested grouping structure, every dataset is located
in the root group.\\
A dataset's name must match the following naming pattern which
@@ -116,13 +144,13 @@ template for building your own data converter program.\\
\begin{verbatim}
"<full variable name> timelevel <timelevel> at iteration <iteration>"
\end{verbatim}
- IOHDF5's recovery routine parses a dataset's name according to this
+ {\bf IOHDF5}'s recovery routine parses a dataset's name according to this
pattern to determine the Cactus variable to restore, along with its
timelevel. The iteration number is just informative and not needed here.
\item The type of your data as well as its dimensions are already
inherited by a dataset itself as metainformation. But this is not
- enough for IOHDF5 to safely match it against a specific Cactus variable.
+ enough for {\bf IOHDF5} to safely match it against a specific Cactus variable.
For that reason, the variable's groupname, its grouptype, and the
total number of timelevels must be attached to every dataset
as attribute information.
@@ -142,17 +170,18 @@ template for building your own data converter program.\\
\end{enumerate}
The example C program goes through all of these steps and creates a datafile
-{\tt x\_3d.h5} in IOHDF5 file layout which contains a single dataset named
+{\tt x.h5} in {\bf IOHDF5} file layout which contains a single dataset named
{\tt "grid::x timelevel 0 at iteration 0"}, with groupname
{\tt "grid::coordinates"}, grouptype {\tt CCTK\_GF} (thus identifying the
-variable as a grid function), and the total number of timelevels set to 1.\\
+variable as a grid function), and the total number of timelevels set to 1.
+
The global attributes are set to
{\tt "unchunked" $=$ "yes", nprocs $=$ 1,} and {\tt ioproc\_every $=$ 1}.\\
Once you've built and ran the program you can easily verify if it worked
properly with
\begin{verbatim}
- h5dump x_3d.h5
+ h5dump x.h5
\end{verbatim}
which lists all objects in the datafile along with their values.
It will also dump the contents of the 3D dataset. Since it only contains zeros
@@ -160,14 +189,14 @@ it would probably not make much sense to feed this datafile into Cactus for
initializing your x coordinate grid function :-)
%
%
-\subsection{Other utility programs in IOHDF5}
+\section{Other Utility Programs in {\bf IOHDF5}}
%
-In addition to the HDF5 recombiner program, thorn IOHDF5 also provides
+In addition to the HDF5 recombiner program, thorn {\bf IOHDF5} also provides
some other utilities which can be build the same way:
%
\begin{itemize}
\item {\tt hdf5\_convert\_from\_ieeeio.c}\\
- Converts a datafile created by thorn IOFlexIO into an HDF5 datafile.
+ Converts a datafile created by thorn {\bf IOFlexIO} into an HDF5 datafile.
\item {\tt hdf5\_merge.c}\\
Merges a list of HDF5 input files into a single HDF5 output file.
This can be used to concatenate HDF5 output data created as one file per
diff --git a/par/hdf5.par b/par/hdf5.par
index 83fb835..586de82 100644
--- a/par/hdf5.par
+++ b/par/hdf5.par
@@ -19,11 +19,11 @@ driver::global_nz = 10
####################### IO parameters ###################################
# flag to enable verbose output
-IO::verbose = "yes"
+IO::verbose = "standard"
# want unchunked output into a single file
-IO::out3D_mode = "onefile"
-IO::out3D_unchunked = "yes"
+IO::out_mode = "onefile"
+IO::out_unchunked = "yes"
# say when, where, and what GF to output
IOHDF5::out_every = 1
diff --git a/param.ccl b/param.ccl
index e3defd0..2829d21 100644
--- a/param.ccl
+++ b/param.ccl
@@ -1,4 +1,5 @@
# Parameter definitions for thorn IOHDF5
+# $Header$
#############################################################################
### declare IOHDF5 parameters
@@ -10,32 +11,54 @@ private:
########################
INT out_every "How often to do IOHDF5 output, overrides IO::out_every" STEERABLE = ALWAYS
{
- -1:* :: "Values <= 0 disable IOHDF5 output"
+ 1:* :: "Every so many iterations"
+ 0: :: "Disable IOHDF5 output"
+ -1: :: "Default to IO::out_every"
} -1
-INT outHDF5_every "How often to do IOHDF5 output, overrides IO::out_every" STEERABLE = ALWAYS
+INT outHDF5_every "How often to do IOHDF5 output, overrides IO::out_every (DEPRECATED IN BETA13)" STEERABLE = ALWAYS
{
- -1:* :: "Values <= 0 disable IOHDF5 output"
+ 1:* :: "Every so many iterations"
+ 0: :: "Disable IOHDF5 output"
+ -1: :: "Default to IO::out_every"
+} -1
+INT out3D_every "How often to do IOHDF5 output, overrides IO::out_every (DEPRECATED IN BETA13)" STEERABLE = ALWAYS
+{
+ 1:* :: "Every so many iterations"
+ 0: :: "Disable IOHDF5 output"
+ -1: :: "Default to IO::out_every"
} -1
####################
# Output directories
####################
-STRING outdir "Name of IOHDF5 output directory, overrides IO::outdir"
+STRING out_dir "Output directory for IOHDF5 files, overrides IO::outdir" STEERABLE = RECOVER
{
- .* :: A regex which matches everything
-} "."
-STRING outdir_HDF5 "DEPRICATED: Name of IOHDF5 output directory, overrides IO::outdir"
+ ".+" :: "A valid directory name"
+ "^$" :: "An empty string to choose the default from IO::out_dir"
+} ""
+STRING outdir_HDF5 "Output directory for IOHDF5 files, overrides IO::outdir (DEPRECATED IN BETA13)" STEERABLE = RECOVER
+{
+ ".+" :: "A valid directory name"
+ "^$" :: "An empty string to choose the default from IO::out_dir"
+} ""
+STRING outdir3D "Output directory for IOHDF5 files, overrides IO::outdir (DEPRECATED IN BETA13)" STEERABLE = RECOVER
{
- .* :: A regex which matches everything
+ ".+" :: "A valid directory name"
+ "^$" :: "An empty string to choose the default from IO::out_dir"
} "."
-
#####################
# Variables to output
#####################
STRING out_vars "Variables to output in HDF5 file format" STEERABLE = ALWAYS
{
- .* :: A regex which matches everything
+ ".+" :: "Space-separated list of fully qualified variable/group names"
+ "^$" :: "An empty string to output nothing"
+} ""
+STRING out3D_vars "Variables to output in 3D HDF5 file format (DEPRECATED IN BETA13)" STEERABLE = ALWAYS
+{
+ ".+" :: "Space-separated list of fully qualified variable/group names"
+ "^$" :: "An empty string to output nothing"
} ""
@@ -55,46 +78,20 @@ BOOLEAN checkpoint_next "Checkpoint at next iteration" 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
-
+# FIXME: want USES STRING out_dir AS default_out_dir
+# FIXME: want USES INT out_every AS default_out_every
-################
-# various things
-################
-USES BOOLEAN verbose
-USES BOOLEAN newverbose
+USES KEYWORD verbose
USES BOOLEAN print_timing_info
-USES BOOLEAN out3D_parameters
-#######################
-# Specific to 3D output
-#######################
-USES KEYWORD out3D_mode
-USES BOOLEAN out3D_septimefiles
+USES KEYWORD out_mode
+USES KEYWORD out_save_parameters
+USES INT out_timesteps_per_file
-###################################
-# Checkpointing/recovery parameters
-###################################
+USES INT checkpoint_every
+USES INT checkpoint_keep
USES BOOLEAN checkpoint_ID
-USES BOOLEAN checkpoint_keep_all
-USES KEYWORD recover
USES BOOLEAN recover_and_remove
-USES INT checkpoint_every
USES BOOLEAN checkpoint_on_terminate
-USES INT checkpoint_keep
-USES STRING checkpoint_file
-USES STRING checkpoint_ID_file
-USES STRING recover_file
-USES STRING checkpoint_dir
-USES STRING recovery_dir
+USES KEYWORD recover
+USES STRING recover_file
diff --git a/schedule.ccl b/schedule.ccl
index ffbc5b0..109f703 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -13,24 +13,24 @@ schedule IOHDF5_Startup at STARTUP after IOHDF5Util_Startup
########################################################################
### register checkpointing routines
########################################################################
-schedule IOHDF5_InitialDataCheckpoint at CCTK_CPINITIAL
+schedule IOHDF5_InitialDataCheckpoint at CPINITIAL
{
LANG:C
} "Initial data checkpoint routine"
-schedule IOHDF5_EvolutionCheckpoint at CCTK_CHECKPOINT
+schedule IOHDF5_EvolutionCheckpoint at CHECKPOINT
{
LANG:C
} "Evolution data checkpoint routine"
-schedule IOHDF5_TerminationCheckpoint at CCTK_TERMINATE before IOHDF5Util_Terminate
+schedule IOHDF5_TerminationCheckpoint at TERMINATE before IOHDF5Util_Terminate
{
LANG:C
} "Termination checkpoint routine"
if (! CCTK_Equals (recover, "no") && *recover_file)
{
- schedule IOHDF5_RecoverParameters at CCTK_RECOVER_PARAMETERS
+ schedule IOHDF5_RecoverParameters at RECOVER_PARAMETERS
{
LANG:C
} "Parameter recovery routine"
diff --git a/src/DumpGH.c b/src/DumpGH.c
index b9d5674..952cbc0 100644
--- a/src/DumpGH.c
+++ b/src/DumpGH.c
@@ -16,7 +16,7 @@
#include "cctk_Parameters.h"
#include "CactusBase/IOUtil/src/ioGH.h"
#include "CactusBase/IOUtil/src/ioutil_CheckpointRecovery.h"
-#include "BetaThorns/IOHDF5Util/src/ioHDF5UtilGH.h"
+#include "CactusPUGHIO/IOHDF5Util/src/ioHDF5UtilGH.h"
#ifdef CCTK_MPI
#include "CactusPUGH/PUGH/src/include/pugh.h"
#endif
@@ -30,7 +30,7 @@
/* the rcs ID and its dummy function to use it */
static const char *rcsid = "$Header$";
-CCTK_FILEVERSION(AlphaThorns_IOHDF5_DumpGH_c)
+CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_DumpGH_c)
/********************************************************************
@@ -102,7 +102,7 @@ void IOHDF5_EvolutionCheckpoint (const cGH *GH)
((checkpoint_every > 0 && GH->cctk_iteration % checkpoint_every == 0) ||
checkpoint_next))
{
- if (verbose)
+ if (! CCTK_Equals (verbose, "none"))
{
CCTK_INFO("------------------------------------------------------------");
CCTK_VInfo (CCTK_THORNSTRING, "Dumping periodic checkpoint file at "
@@ -232,7 +232,7 @@ static int Checkpoint (const cGH *GH, int called_from)
/* Now open the file */
if (myproc == ioUtilGH->ioproc)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Creating checkpoint file '%s'",
cp_tempname);
@@ -269,7 +269,7 @@ static int Checkpoint (const cGH *GH, int called_from)
/* close the temporary checkpoint file and rename it to the real file */
if (myproc == ioUtilGH->ioproc)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Closing temporary checkpoint file '%s' "
"and renaming it to '%s'",
@@ -281,7 +281,7 @@ static int Checkpoint (const cGH *GH, int called_from)
HDF5_ERROR (H5Fclose (file));
}
- /* delete the oldest checkpoint file if checkpoint_keep_all isn't set
+ /* delete the oldest checkpoint file if requested
and put the new filename into the ring buffer */
if (retval == 0)
{
@@ -301,14 +301,14 @@ static int Checkpoint (const cGH *GH, int called_from)
{
if (myGH->cp_filename_list[myGH->cp_filename_index])
{
- if (! checkpoint_keep_all)
+ if (checkpoint_keep > 0)
{
remove (myGH->cp_filename_list[myGH->cp_filename_index]);
}
free (myGH->cp_filename_list[myGH->cp_filename_index]);
}
myGH->cp_filename_list[myGH->cp_filename_index] = strdup (cp_filename);
- myGH->cp_filename_index = (myGH->cp_filename_index+1) % checkpoint_keep;
+ myGH->cp_filename_index = (myGH->cp_filename_index+1) % abs (checkpoint_keep);
}
}
}
diff --git a/src/Output.c b/src/Output.c
index b06e979..fb0f0d9 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -16,8 +16,8 @@
#include "ioHDF5GH.h"
/* the rcs ID and its dummy function to use it */
-static const char *rcsid = "$Id$";
-CCTK_FILEVERSION(AlphaThorns_IOHDF5_Output_c)
+static const char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_Output_c)
/********************************************************************
@@ -35,10 +35,10 @@ static void CheckSteerableParameters (const cGH *GH);
@enddesc
@calls IOHDF5_TimeFor
- IOHDF5_OutputVarAs
+ IOHDF5_Write
@var GH
- @vdesc Pointer to CCTK GH
+ @vdesc pointer to CCTK GH
@vtype const cGH *
@vio in
@endvar
@@ -52,43 +52,21 @@ static void CheckSteerableParameters (const cGH *GH);
int IOHDF5_OutputGH (const cGH *GH)
{
int vindex, retval;
- ioHDF5GH *myGH;
- char *fullname;
- const char *name;
- DECLARE_CCTK_PARAMETERS
-
-
- myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5");
+ const ioHDF5GH *myGH;
- CheckSteerableParameters (GH);
- if (myGH->out_every <= 0)
- {
- return (0);
- }
+ retval = 0;
+ myGH = (const ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5");
/* loop over all variables */
- for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++)
+ for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
{
- if (IOHDF5_TimeFor (GH, vindex))
+ if (IOHDF5_TimeFor (GH, vindex) &&
+ IOHDF5_Write (GH, vindex, CCTK_VarName (vindex)) == 0)
{
- name = CCTK_VarName (vindex);
- fullname = CCTK_FullName (vindex);
-
- if (verbose)
- {
- CCTK_VInfo (CCTK_THORNSTRING, "IOHDF5_OutputGH: (fullname, name) = "
- "(%s, %s)", fullname, name);
- }
-
- if (IOHDF5_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++;
}
}
@@ -107,7 +85,7 @@ int IOHDF5_OutputGH (const cGH *GH)
@calls IOHDF5_Write
@var GH
- @vdesc Pointer to CCTK GH
+ @vdesc pointer to CCTK GH
@vtype const cGH *
@vio in
@endvar
@@ -137,7 +115,7 @@ int IOHDF5_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, "IOHDF5_OutputVarAs: fullname, alias, "
"index = (%s, %s, %d)", fullname, alias, vindex);
@@ -175,7 +153,7 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias)
@calls CheckSteerableParameters
@var GH
- @vdesc Pointer to CCTK GH
+ @vdesc pointer to CCTK GH
@vtype const cGH *
@vio in
@endvar
@@ -233,7 +211,7 @@ int IOHDF5_TimeFor (const cGH *GH, int vindex)
@calls IOHDF5_Write
@var GH
- @vdesc Pointer to CCTK GH
+ @vdesc pointer to CCTK GH
@vtype const cGH *
@vio in
@endvar
@@ -261,7 +239,7 @@ int IOHDF5_TriggerOutput (const cGH *GH, int vindex)
myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5");
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
fullname = CCTK_FullName (vindex);
CCTK_VInfo (CCTK_THORNSTRING, "IOHDF5_TriggerOutput: "
@@ -298,7 +276,7 @@ int IOHDF5_TriggerOutput (const cGH *GH, int vindex)
@calls IOHDF5Util_ParseVarsForOutput
@var GH
- @vdesc Pointer to CCTK grid hierarchy
+ @vdesc pointer to CCTK grid hierarchy
@vtype const cGH *
@vio in
@endvar
diff --git a/src/RecoverGH.c b/src/RecoverGH.c
index e8c4b8d..4732cea 100644
--- a/src/RecoverGH.c
+++ b/src/RecoverGH.c
@@ -26,7 +26,7 @@
/* the rcs ID and its dummy function to use it */
-static const char *rcsid = "$Id$";
+static const char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_RecoverGH_c)
@@ -138,7 +138,7 @@ int IOHDF5_Recover (cGH *GH, const char *basefilename, int called_from)
/* Recover GH extensions */
if (called_from == CP_RECOVER_DATA)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_INFO ("Recovering GH extensions");
}
@@ -148,7 +148,7 @@ int IOHDF5_Recover (cGH *GH, const char *basefilename, int called_from)
if (! result)
{
/* Recover variables */
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Recovering %schunked data with ioproc %d, "
"ioproc_every %d", fileinfo.unchunked ? "un" : "",
@@ -160,7 +160,7 @@ int IOHDF5_Recover (cGH *GH, const char *basefilename, int called_from)
/* Close the file and remove it if requested by the user */
if (CCTK_MyProc (GH) == fileinfo.ioproc)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
if (called_from == CP_RECOVER_DATA)
{
@@ -177,7 +177,7 @@ int IOHDF5_Recover (cGH *GH, const char *basefilename, int called_from)
if (called_from == CP_RECOVER_DATA && recover_and_remove)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Old checkpoint file '%s' will be removed"
" after next successful checkpoint",
@@ -337,7 +337,7 @@ static int OpenFile (cGH *GH, const char *basefilename, int called_from,
if (myproc == 0)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Opening file '%s'", filename);
}
@@ -361,7 +361,7 @@ static int OpenFile (cGH *GH, const char *basefilename, int called_from,
fileinfo->unchunked);
strcat (filename, ".h5");
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Trying now file '%s'...", filename);
}
@@ -417,7 +417,7 @@ static int OpenFile (cGH *GH, const char *basefilename, int called_from,
if ((fileinfo->ioproc_every == nprocs && nprocs > 1) ||
fileinfo->unchunked)
{
- if (verbose)
+ if (! CCTK_Equals (verbose, "none"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Recovering from one %schunked file",
fileinfo->unchunked ? "un" : "");
@@ -435,7 +435,7 @@ static int OpenFile (cGH *GH, const char *basefilename, int called_from,
}
else
{
- if (verbose)
+ if (! CCTK_Equals (verbose, "none"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Recovering from %d chunked files",
nprocs / fileinfo->ioproc_every +
@@ -481,7 +481,7 @@ static int OpenFile (cGH *GH, const char *basefilename, int called_from,
/* Open chunked files on other IO processors */
if (myproc == fileinfo->ioproc && myproc != 0)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "Opening chunked file '%s' on "
"processor %d", filename, myproc);
diff --git a/src/Startup.c b/src/Startup.c
index 28efa08..15b7049 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -19,8 +19,8 @@
#include "ioHDF5GH.h"
/* the rcs ID and its dummy function to use it */
-static const char *rcsid = "$Id$";
-CCTK_FILEVERSION(AlphaThorns_IOHDF5_Startup_c)
+static const char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_Startup_c)
/********************************************************************
@@ -130,51 +130,55 @@ static void *SetupGH (tFleshConfig *config, int conv_level, cGH *GH)
myGH = (ioHDF5GH *) malloc (sizeof (ioHDF5GH));
myGH->out_last = (int *) malloc (numvars * sizeof (int));
myGH->requests = (ioRequest **) calloc (numvars, sizeof (ioRequest *));
- myGH->cp_filename_list = (char **) calloc (checkpoint_keep, sizeof (char *));
+ myGH->cp_filename_list = (char **) calloc (abs (checkpoint_keep),
+ sizeof (char *));
myGH->cp_filename_index = 0;
- /* Check whether "IOHDF5::outdir" was set.
- If so take this directory otherwise default to "IO::outdir" */
- if (CCTK_ParameterQueryTimesSet ("outdir", CCTK_THORNSTRING) > 0 ||
- CCTK_ParameterQueryTimesSet ("outdir_HDF5", CCTK_THORNSTRING) > 0)
+ /* get the name of IOHDF5's output directory */
+ if (*out_dir == 0)
{
- if (CCTK_ParameterQueryTimesSet ("outdir", CCTK_THORNSTRING) <= 0)
- {
- CCTK_WARN (1, "Parameter 'IOHDF5::outdir_HDF5 is depricated in BETA12, "
- "please use 'IOHDF5::outdir' instead");
- outdir = outdir_HDF5;
- }
+ out_dir = *(const char **)
+ CCTK_ParameterGet ("out_dir", CCTK_ImplementationThorn ("IO"),
+ NULL);
+ }
- if (CCTK_Equals (out3D_mode, "onefile") || ! strstr (outdir, "%u"))
+ /* skip the directory pathname if output goes into current directory */
+ if (strcmp (out_dir, "."))
+ {
+ i = strlen (out_dir);
+ if (CCTK_Equals (out_mode, "onefile") || ! strstr (out_dir, "%u"))
{
- myGH->outdir = strdup (outdir);
+ 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->outdir = (char *) malloc (strlen (outdir) + 20);
- sprintf (myGH->outdir, outdir, CCTK_MyProc (GH));
+ 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 */
+ /* create the output directory */
ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
- 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,
- "Problem creating HDF5 output directory '%s'", myGH->outdir);
+ "Problem creating HDF5 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,
- "HDF5 output directory '%s' already exists", myGH->outdir);
+ "HDF5 output directory '%s' already exists", myGH->out_dir);
}
for (i = 0; i < numvars; i++)
diff --git a/src/Write.c b/src/Write.c
index b21c2d2..c4d3b50 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -21,7 +21,7 @@
/* the rcs ID and its dummy funtion to use it */
static const char *rcsid = "$Header$";
-CCTK_FILEVERSION(AlphaThorns_IOHDF5_Write_c)
+CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_Write_c)
/********************************************************************
@@ -113,7 +113,7 @@ int IOHDF5_Write (const cGH *GH, int vindex, const char *alias)
}
else
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "%s HDF5 output file '%s'",
is_new_file ? "Opening" : "Appending", filename);
@@ -154,9 +154,10 @@ int IOHDF5_Write (const cGH *GH, int vindex, const char *alias)
{
/* all GH extension variables and parameter stuff which is not
specific to any dataset goes into dedicated groups */
- if (strcmp (out3D_parameters, "no"))
+ if (! CCTK_Equals (out_save_parameters, "no"))
{
- IOHDF5Util_DumpParameters (GH, ! strcmp (out3D_parameters, "all"), file);
+ IOHDF5Util_DumpParameters (GH, CCTK_Equals (out_save_parameters, "all"),
+ file);
}
IOHDF5Util_DumpGHExtensions (GH, file);
@@ -168,16 +169,15 @@ int IOHDF5_Write (const cGH *GH, int vindex, const char *alias)
/* close the file */
if (file >= 0)
{
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_INFO ("Closing HDF5 output file from this iteration");
}
HDF5_ERROR (H5Fclose (file));
}
- /* free the filename if it was not registered for re-opening
- in IOHDF5_net3D_filename () */
- if (out3D_septimefiles)
+ /* free the filename if it was not registered for re-opening */
+ if (out_timesteps_per_file > 0)
{
free (filename);
}
@@ -259,7 +259,7 @@ static char *IOHDF5_GetFilename (const cGH *GH,
myproc = CCTK_MyProc (GH);
- if (out3D_septimefiles)
+ if (out_timesteps_per_file > 0)
{
tmp = extra;
sprintf (extra, "%s.time_%7.3f", extra, GH->cctk_time);
@@ -289,26 +289,18 @@ static char *IOHDF5_GetFilename (const cGH *GH,
sprintf (extra, "%s.file_%d", extra, myproc / ioUtilGH->ioproc_every);
/* If necessary create the output directory */
- outputdir = (char *) malloc (strlen (myGH->outdir) + strlen (varname) + 5);
-
- if (strcmp (myGH->outdir, "."))
- {
- sprintf (outputdir, "%s/%s_3d", myGH->outdir, varname);
- }
- else
- {
- sprintf (outputdir, "%s_3d", varname);
- }
+ outputdir = (char *) malloc (strlen (myGH->out_dir) + strlen (varname) + 5);
+ sprintf (outputdir, "%s%s_3d", myGH->out_dir, varname);
result = IOUtil_CreateDirectory (GH, outputdir,
- ! CCTK_Equals (out3D_mode, "onefile"),
+ ! CCTK_Equals (out_mode, "onefile"),
ioUtilGH->ioproc);
if (result < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Problem creating output directory '%s'", outputdir);
}
- else if (result > 0 && CCTK_Equals (newverbose, "full"))
+ else if (result > 0 && CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING,
"Output directory '%s' already exists", outputdir);
@@ -327,23 +319,16 @@ static char *IOHDF5_GetFilename (const cGH *GH,
/* CREATE THE COMPLETE OUTPUT FILENAME
----------------------------------- */
- filename = (char *) malloc (strlen (myGH->outdir) +
+ filename = (char *) malloc (strlen (myGH->out_dir) +
strlen (extradir) +
strlen (varname) +
strlen (extra) +
strlen (GH->identity) + 8);
- if (strcmp (myGH->outdir, "."))
- {
- sprintf (filename, "%s/%s%s%s%s.h5",
- myGH->outdir, extradir, varname, extra, GH->identity);
- }
- else
- {
- sprintf (filename, "%s%s%s%s.h5", extradir, varname, extra, GH->identity);
- }
+ sprintf (filename, "%s%s%s%s%s.h5",
+ myGH->out_dir, extradir, varname, extra, GH->identity);
/* no need to store filenames if used only once */
- if (! out3D_septimefiles)
+ if (out_timesteps_per_file < 0)
{
if (myproc == ioUtilGH->ioproc)
{
diff --git a/src/WriteIsosurface.c b/src/WriteIsosurface.c
index 3e7e573..be12eb8 100644
--- a/src/WriteIsosurface.c
+++ b/src/WriteIsosurface.c
@@ -16,8 +16,8 @@
#include "ioHDF5GH.h"
/* the rcs ID and its dummy funtion to use it */
-static const char *rcsid = "$Id$";
-CCTK_FILEVERSION(AlphaThorns_IOHDF5_WriteIsosurface_c)
+static const char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_WriteIsosurface_c)
#define SOCKET_URL_PREFIX "sock://"
diff --git a/src/ioHDF5GH.h b/src/ioHDF5GH.h
index 1c2fc5a..31c5fc0 100644
--- a/src/ioHDF5GH.h
+++ b/src/ioHDF5GH.h
@@ -4,14 +4,15 @@
@author Thomas Radke
@desc
The extensions to the GH structure from IOHDF5.
- @version $Id$
+ @enddesc
+ @version $Header$
@@*/
#ifndef _IOHDF5_IOHDF5GH_H_
-#define _IOHDF5_IOHDF5GH_H_
+#define _IOHDF5_IOHDF5GH_H_ 1
-#include "BetaThorns/IOHDF5Util/src/ioHDF5UtilGH.h"
#include "StoreNamedData.h"
+#include "CactusPUGHIO/IOHDF5Util/src/ioHDF5UtilGH.h"
/* IOHDF5 GH extension structure */
typedef struct
@@ -20,8 +21,8 @@ typedef struct
/* how often to output */
int out_every;
- /* directories in which to output */
- char *outdir;
+ /* directory in which to output */
+ char *out_dir;
/* the last iteration output */
int *out_last;
diff --git a/test/checkpoint.parfile b/test/checkpoint.parfile
index ac479ff..392107f 100644
--- a/test/checkpoint.parfile
+++ b/test/checkpoint.parfile
@@ -17,18 +17,18 @@ ActiveThorns = "Time WavetoyC IDScalarWaveC PUGH PUGHReduce PUGHSlab CartGrid3D
# For the testsuite the output directory must be the basename
# of the recovery parameter file's filename
-IO::outdir = "test_recover"
+IO::out_dir = "test_recover"
# Checkpoint initial data into a single unchunked checkpoint file
# with basename 'WavetoyID' and place it into the current directory
IO::checkpoint_ID = "yes"
-IO::out3D_unchunked = "yes"
-IO::out3D_mode = "onefile"
+IO::out_unchunked = "yes"
+IO::out_mode = "onefile"
IO::checkpoint_ID_file = "WavetoyID.chkpt"
IO::checkpoint_dir = "."
# Give some verbose output while checkpointing
-IO::verbose = "yes"
+IO::verbose = "standard"
# Say that the checkpoint file should be created with the IOHDF5 IO method
IOHDF5::checkpoint = "yes"
@@ -62,3 +62,6 @@ IOASCII::out1D_d = "no"
IOASCII::out1D_vars = "wavetoy::phi"
IO::out_fileinfo = "none"
+
+# do not use the new scheme for names of output files
+IO::new_filename_scheme = "no" \ No newline at end of file
diff --git a/test/test_recover.par b/test/test_recover.par
index 154f5e2..25e0f82 100644
--- a/test/test_recover.par
+++ b/test/test_recover.par
@@ -23,7 +23,7 @@ IO::recover = "manual"
IO::recover_file = "WavetoyID.chkpt.it_0"
# ... to be found in directory ...
-IO::recovery_dir = "../../../arrangements/AlphaThorns/IOHDF5/test/"
+IO::recover_dir = "../../../arrangements/AlphaThorns/IOHDF5/test/"
# Note that this parameter is restored to "yes" during parameter recovery.
# Since we don't need to checkpoint twice it is explicitely disabled here.
@@ -32,3 +32,6 @@ IO::checkpoint_ID = "no"
# disable output of file information (parameter filename, creation date)
# because this could cause diffs when running the testsuite
IO::out_fileinfo = "none"
+
+# do not use the new scheme for names of output files
+IO::new_filename_scheme = "no"