% /*@@ % @file Appendices.tex % @date 27 Jan 1999 % @author Tom Goodale, Gabrielle Allen, Gerd Lanferman, Thomas Radke % @desc % Appendices for the Cactus User's Guide % @enddesc % @version $Header$ % @@*/ \begin{cactuspart}{5}{Appendices}{$RCSfile$}{$Revision$} \renewcommand{\thepage}{\Alph{part}\arabic{page}} \chapter{Glossary} \label{sec:glossary} \begin{Lentry} \item[{\tt API}] Applications Programming Interface, the externally-visible interface provided by some software component. (An API usually consists of a set of subroutine/function calls, but may also include data passed via Cactus key-value tables, grid arrays, or other means.) For example, the Reference Manual documents most of the Cactus flesh APIs. \item[{\tt arrangement}] A collection of thorns, normally stored in the Cactus \verb|arrangements| directory. \item[{\tt autoconf}] A GNU program which builds a configuration script which can be used to make a Makefile. \item[{\tt boundary zone}] A boundary zone is a set of points added to the edge of a grid to contain boundary data. E.g Dirichlet or Von Neumann data. (See also: symmetry zone, ghost zone.) \item[{\tt Cactus}] A green fleshy plant with lots of thorns, usually painful if touched. \item[{\tt CCTK}] Cactus Computational Tool Kit (The Cactus flesh and computational thorns). \item[{\tt CCL}] The {\tt Cactus Configuration Language}, this is the language that the thorn configuration files are written in. \item[{\tt configuration}] The combination of a set of thorns, and all the Cactus configure options which affect what binary will be produced when compiling Cactus. For example, the choice of compilers (Cactus \verb|CC|, \verb|CXX|, \verb|F77|, and \verb|F90| configure options) and the compiler optimization settings (\verb|OPTIMISE|/\verb|OPTIMIZE| and \verb|*_OPTIMISE_FLAGS| configure options) are part of a configuration (these flags change what binary is produced), but the Cactus \verb|SILENT| and \verb|WARN| configure options aren't part of a configuration (they don't change what binary will be produced). \item[{\tt checkout}] Get a copy of the code or thorns from CVS. \item[{\tt checkpointing}] Save the entire state of a run to file so that it can be restarted at a later time. \item[{\tt convergence}] \item[{\tt CST}] This stands for Cactus Specification Tool, which is the perl scripts which parse the thorns' configuration files (those that have a \texttt{.ccl} extension). \item[{\tt CVS}] The {\em ``Concurrent Versioning System''} is the favoured distribution system for Cactus and can be downloaded from your favorite GNU site. \item[{\tt driver}] A thorn which creates and handles grid hierachies. \item[{\tt flesh}] The routines which hold all the thorns together, this is what you get if you check out {\tt Cactus} from our CVS repository. \item[{\tt friend}] \item[{\tt GF}] Shorthand for a {\tt grid function}. \item[{\tt gmake}] GNU version of make utility. \item[{\tt ghostzone}] A ghostzone is a set of points added for parallelisation purposes to enable inter-processor communication of data from processor boundaries. In single processor runs there are no ghost zones. Ghost zones should not be confused with symmetry or boundary zones. \item[{\tt grid array}] A {\it grid variable} whose global size need not be that of the computational grid; instead, the size is declared explicitly in an \verb|interface.ccl| file. \item[{\tt grid function}] A {\it grid variable} whose global size is the size of the computational grid \item[{\tt grid hierarchy}] A computational grid, and the grid variables associated with it. \item[{\tt grid scalar}] A {\it grid variable\/} which has zero indices, i.e.\hbox{} it's just a number on each processor. \item[{\tt grid variable}] Any variable which can be passed between thorns, or routines belonging to the same thorn, but passed through the defined flesh interface; implicitly implies it is related to the computational grid rather than being an internal variable of the thorn or one of its routines. {\tt grid scalar}, {\tt grid function}, and {\tt grid array} are all examples of {\tt grid variables}. \item[{\tt GNATS}] The GNU program we use for reporting and tracking bugs, comments and suggestions. \item[{\tt handle}] A signed integer value $>= 0$. Many Cactus routines return or accept a handle to represent a dynamic data or code object. Handles for the same object class should not be trusted to comprise a consecutive sequence of integer values. \item[{\tt GV}] Shorthand for a {\it grid variable} \item[{\tt HDF5}] Hierarchical Data Format version~5, an API, subroutine library, and file format for storing multimdimensional data. An HDF5 file can store both data (for example Cactus grid variables), and metadata (data describing the other data, for example Cactus coordinate systems). \item[{\tt implementation}] Defines the interface that a thorn presents to the outside world. See Section~\ref{sec:im}. \item[{\tt inherit}] \item[{\tt interpolation}] Given $N$ {\it grid arrays} and $C$ interpolation points (in the grid array coordinate space), return $M$ values on each requested processor at each interpolation point. (See also {\it local interpolation}) \item[{\tt local interpolation}] Given $N$ arrays on the current processor with a given coordinate system, and $C$ interpolation points (in the array coordinate space) return $M$ values at each interpolation point. (See also {\it interpolation}) \item[{\tt MPI}] Message Passing Interface, an API and software library for sending messages between processors in a multiprocessor system. \item[{\tt mutual recursion}] See {\it recursion, mutual}. \item[{\tt NUL character}] The C programming language uses a ``NUL character'' to terminate character strings. A NUL character has the integer value zero, but it's useful to write it as \verb|'\0'| to emphasize to human readers that this has type \verb|char| rather than \verb|int|. \item[{\tt NULL pointer}] C defines a ``NULL pointer'' which is guaranteed not to point to any object. You get a NULL pointer by converting the integer constant 0 to a pointer type, e.g.\hbox{} \verb|int* ptr = 0;|. Note that if you have an expression which has the value zero, but which isn't an integer constant, converting this to a pointer type is {\em not\/} guaranteed to give a NULL pointer, e.g.: \begin{verbatim} int i = 0; int* ptr = i; /* ptr is NOT guaranteed to be a NULL pointer! */ \end{verbatim} Many programmers prefer to use the predefined macro \verb|NULL| (defined in \verb|| and \verb||) to create NULL pointers, e.g.\hbox{} \verb|int* ptr = NULL;|, to emphasize to human readers that this is a NULL {\em pointer\/} rather than ``just'' the integer zero. Note that it is explicitly {\em not\/} defined whether a NULL pointer is represented by a bit pattern of all zero bits -- this varies from system to system, and there are real-world systems where NULL pointers are in fact {\em not\/} represented this way. \item[{\tt parameter}] A variable which remains unchanged throughout the execution of a Cactus executable. Parameters all have default values which can be changed in a parameter file. \item[{\tt processor topology}] \item[{\tt PUGH}] The default parallel driver for Cactus which uses MPI. \item[{\tt PVM}] {\tt Parallel Virtual Machine}, provides interprocessor communication. \item[{\tt recursion, mutual}] See {\it mutual recursion}. \item[{\tt reduction}] Given $N$ grid variables return $M$ output values on each requested processor. \item[{\tt symmetry zone}] A symmetry zone is a set of points added to the edge of a grid to contain data which is obtained, by some symmetry operation, from another part of the grid. (See also: boundary zone, ghost zone.) \item[{\tt TAGS}] \item[{\tt target}] \item[{\tt thorn}] A collection of subroutines with a definite interface and purpose. \item[{\tt WMPI}] Win32 Message Passing Interface. \end{Lentry} \chapter{Configuration file syntax} \label{sec:cofisy} \section{General Concepts} \label{sec:geco} Each thorn is configured by three compulsory files in the top level thorn directory: \begin{itemize} \item{} {\tt interface.ccl} \item{} {\tt param.ccl} \item{} {\tt schedule.ccl} \end{itemize} These files are written in the {\it Cactus Configuration Language} which is case insensitive. % A note on optional arguments and square brackets: If e.g. a variable or % include file is provided by this thorn, then the corresponding % section of the (in this case) interface.ccl is not optional. Thus % these sections are not enclosed in [] as a whole (though parts of them can of % course be enclosed in []). \section{interface.ccl} \label{sec:in} The interface configuration file consists of \begin{itemize} \item a header block giving details of the thorn's relationship with other thorns. \item a block detailing which include files are used from other thorns, and which include files are provided by this thorn \item blocks detailing aliased functions provided or used by this thorn \item a series of blocks listing the thorn's global variables. \end{itemize} (For a more extensive discussion of Cactus variables see Chapter \ref{chap:cava}.) \subsection{Header block} The header block has the form: \begin{verbatim} implements: inherits: , friend: , \end{verbatim} where \begin{itemize} \item{} The implementation name must be unique among all thorns, except between thorns which have the same public and protected variables and global and restricted parameters. \item{} Inheriting from another implementation makes all that implementation's public variables available to your thorn. At least one thorn providing any inherited implementation must be present at compile time. A thorn cannot inherit from itself. Inheritance is transitive, but not commutative. \item{} Being a friend of another implementation makes all that implementation's protected variables available to your thorn. At least one thorn providing an implementation for each friend must be present at compile time. A thorn cannot be its own friend. Friendship is associative and commutative. Note that your thorn is also a friend of all your thorn's friends' friends. \end{itemize} \subsection{Include files} The include file section has the form: \begin{verbatim} USES INCLUDE [SOURCE|HEADER]: INCLUDE[S] [SOURCE|HEADER]: in \end{verbatim} The former is used when a thorn wishes to use an include file from another thorn. The latter indicates that this thorn adds the code in \verb|| to the include file \verb||. If the include file is described as \verb|SOURCE|, the included code is only exectuted if the providing thorn is active. Both default to \verb|HEADER|. \subsection{Function aliasing} If any aliased function is to be used or provided by the thorn then the prototype must be declared with the form: \begin{verbatim} FUNCTION ( , ...) \end{verbatim} The \verb|| must be either \verb|void|, \verb|CCTK_INT| or \verb|CCTK_REAL|. The name of the aliased function \verb|| must be 21 characters or less, contain at least one uppercase and one lowercase letter, and follow the C standard for function names. The type of each argument, \verb|| must be a \verb|CCTK| type in \verb|INT,REAL,STRING,POINTER,INT:ARRAY,REAL:ARRAY|. Arguments may only be modified if they have the \verb|ARRAY| suffix. If the argument \verb|| is a function pointer then the argument itself (which will preceded by the return type) should be \begin{verbatim} CCTK_FPOINTER ( , ...) \end{verbatim} Function pointers may not be nested. The combined character length of \verb|| and \verb|| must be 21 characters or less. If an aliased function is to be used then the block \begin{verbatim} USES FUNCTION \end{verbatim} is required. If a function is provided then the block \begin{verbatim} PROVIDES FUNCTION WITH LANGUAGE \end{verbatim} is required. As with the alias name, \verb|| must be 21 characters or less, contain at least one uppercase and one lowercase letter, and follow the C standard for function names. Currently the only supported values of \verb|| are \verb|C| and \verb|Fortran|. \subsection{Variable blocks} The thorn's variables are collected into groups. This is not only for convenience, but for collecting like variables together. Storage assignment, communication assignment, and ghostzone synchronization take place for groups only. The thorn's variables are defined by: {\t \begin{verbatim} [:] [[]] [TYPE=] [DIM=] [TIMELEVELS=] [SIZE=] [DISTRIB=] [GHOSTSIZE=] [STAGGER=] [TAGS=] [""] [{ [ [,] ] } [""] ] \end{verbatim}} % (The options {\t TYPE}, {\t DIM}, etc.\ following {\t } must all appear on one line.) Note that the beginning brace (\{) must sit on a line by itself; the ending brace (\}) must be preceded by a carriage return. % \begin{itemize} \item{} {\t access} defines which thorns can use the following groups of variables. {\t access} can be either {\t public}, {\t protected} or {\t private}. \item{} {\t data\_type} defines the data type of the variables in the group. Supported data types are {\t INT}, {\t CHAR}, {\t REAL} and {\t COMPLEX}. \item{} {\t group\_name} must be an alpha-numeric name (which may also contain underscores) which is unique across group and variable names within the scope of the thorn. A group name is compulsory. \item{} {\t [number]}, if present, indicates that this is a {\bf vector} group. Such a group does not have named variables (so the \{\} block should not be present) but instead appears as a one-dimensional array of grid variables. The first index in the array is the mumber-index, and any other indices are the normal spatial indices for a group of this type and dimension. The number can be any valid arithmetical expression consisting of integers or integer-valued parameters. \item{} {\t TYPE} designates the kind of variables held by the group. The choices are {\t GF}, {\t ARRAY} or {\t SCALAR}. This field is optional, with the default variable type being {\t SCALAR}. \item{} {\t DIM} defines the spatial dimension of the {\t ARRAY} or {\t GF}. The default value is {\t DIM=3}. \item{} {\t TIMELEVELS} defines the number of timelevels a group has if the group is of type {\t ARRAY} or {\t GF}, and can take any positive value. The default is one timelevel. \item{} {\t SIZE} defines the number grid-points an {\tt ARRAY} has in each direction. This should be a comma-separated list of valid arithmetical expressions consisting of integers or integer-valued parameters. \item{} {\t DISTRIB} defines the processor decomposition of an {\tt ARRAY}. {\tt DISTRIB=DEFAULT} distributes {\tt SIZE} grid-points across all processors. {\tt DISTRIB=CONSTANT} implies that {\tt SIZE} grid-points should be allocated on each processor. The default value is {\tt DISTRIB=DEFAULT}. \item{} {\t GHOSTSIZE} defines number of ghost-zones in each dimension of an {\tt ARRAY}. %Does GHOSTSIZE default to one for a GF and zero for a GA? \item{} {\t STAGGER} defines position of grid-points of a {\tt GF} with respect to the underlying grid. It consists of a string made up of a combination {\tt DIM} of the letters {\tt M}, {\tt C}, {\tt P} depending on whether the layout in that direction is on the {\tt M}inus face, {\tt C}entre, or {\tt P}lus face of the cell in that dimension. \item{} {\t TAGS} defines an optional string which is used to create a set of key-value pairs associated with the group. The keys are case independent. \item{} The (optional) block following the group declaration line contains a list of variables contained in the group. All variables in a group have the same data type, variable type, dimension and distribution. The list can be separated by spaces, commas, or new lines. The variable names must be unique within the scope of the thorn. A variable can only be a member of one group. The block must be delimited by brackets on new lines. If no block is given after a group declaration line, a variable with the same name as the group is created. Apart from this case, a group name cannot be the same as the name of any variable seen by this thorn. \item{} An optional description of the group can be given on the last line. If the variable block is omitted, this description can be given at the end of the declaration line. \end{itemize} The process of sharing code among thorns using include files is discussed in Section~\ref{sec:includefiles}. \section{param.ccl} \label{sec:pa} The parameter configuration file consists of a list of {\it parameter object specification items} (OSIs) giving the type and range of the parameter separated by optional {\it parameter data scoping items} (DSIs) which detail access to the parameter. (For a more extensive discussion of Cactus parameters see Chapter \ref{chap:capa}.) \subsection{Parameter data scoping items} {\tt \begin{verbatim} : \end{verbatim} } The key word {\t access} designates that all parameter object specification items up to the next parameter data scoping item are in the same protection or scoping class. {\tt access} can take the values: \begin{Lentry} \item[{\tt global}] all thorns have access to global parameters \item[{\tt restricted}] other thorns can have access to these parameters if they specifically request it in their own param.ccl \item[{\tt private}] only your thorn has access to private parameters \item[{\tt shares}] in this case an {\t implementation} name must follow the colon. It declares that all the parameters in the following scoping block are restricted variables from the specified {\tt implementation}. (Note: only one implementation can be specified on this line.) \end{Lentry} \subsection{Parameter object specification items} \label{sec:paobspit} {\t \begin{verbatim} [EXTENDS|USES] [[]] "" [AS ] [STEERABLE=] [ACCUMULATOR=] [ACCUMULATOR-BASE=] { } \end{verbatim} } Where the options {\t AS}, {\t STEERABLE}, etc. following {\t } must all appear on one line. Note that the beginning brace ({\t\{}) must sit on a line by itself; the ending brace ({\t\}}) must be preceded by a carriage return. \begin{itemize} \item{} Allowed {\t parameter\_type}s are \begin{Lentry} \item[{\t INT}] The specification of {\t parameter\_value}s takes the form of any number of comma-separated blocks of the form: {\t \begin{verbatim} [][:[][:[]]][::""] \end{verbatim} } Where an empty field, or a {\t *} in the place of {\tt low-range} or {\t high-range} indicates $-\infty$ and $\infty$ respectively. The default value for {\t step} is 1. A number by itself denotes that this number is the only acceptable value. \item[{\t REAL}] The range specification is the same as integers, except that here, no {\t step} implies a continuum of values. Note that numeric constants should be expressed as in C (e.g. {\t 1e-10}). Note also that one can use the Cactus types such as {\t CCTK\_REAL4} to specify the precision of the parameter. \item[{\t KEYWORD}] Each entry in the list of acceptable values for a keyword has the form {\t \begin{verbatim} "", "" :: "" \end{verbatim} } \item[{\t STRING}] Allowed values for strings should be specified using regular expressions. To allow any string, the regular expression ".*" should be used. \item[{\t BOOLEAN}] No {\t PARAMETER\_VALUES} should be specified for a boolean parameter. The default value for a boolean can be \begin{itemize} \item{} True: {\t 1}, {\t yes}, {\t y}, {\t t}, {\t true} \item{} False: {\t 0}, {\t no}, {\t n}, {\t f}, {\t false} \end{itemize} \end{Lentry} \item{} The {\t parameter name} must be unique within the scope of the thorn. \item{} A thorn can declare that it {\t EXTENDS} a parameter of another thorn. This allows it to declare additional acceptable values. By default it is acceptable for two thorns to declare the same value as acceptable. \item{} If the thorn wants to simply use a parameter from another thorn, without declaring additional values, use {\t USES} instead. \item{} {\tt [integer]}, if present, specifies that this is an {\bf array} parameter. (Note that the notation used above for the parameter specification breaks down here, there must be square brackets around the given integer). The parameter is then a one-dimensional array of values of the specified type. \item{} {\t alias} allows a parameter to appear as a different name in this thorn than its original name in another thorn. The name as seen in the parameter file is unchanged. \item{} {\t STEERABLE} specifies when a parameter value may be changed. By default parameters may not be changed after the parameter file has been read, or on restarting from checkpoint. This option relaxes this restricting, specifying that the parameter may be changed at recovery time or at any time. \item{} {\t ACCUMULATOR} specifies that this is an {\bf accumulator} parameter. Such parameters cannot be set directly, but are set by other parameters who specify this one as an {\bf ACCUMULATOR-BASE}. The expression is a two parameter arithemetical expression of $X$ and $y$. Setting the parameter consists of evaluating this expression successively, with $x$ being the current value of the parameter (at the first iteration this is the default value) and $y$ the value of the setting parameter. This procedure is repeated, starting from the default value of the parameter, each time one of the setting parameters changes. \item{} {\t ACCUMULATOR-BASE} specifies the name of an {\bf ACCUMULATOR} parameter which this parameter sets. \end{itemize} \section{schedule.ccl} \label{sec:sc} (A more extensive discussion of Cactus scheduling is provided in Chapter \ref{chap:scheduling}.) A schedule configuration file consists of \begin{itemize} \item{} {\it assignment statements} to switch on storage for grid variables for the entire duration of program execution \item{} {\it schedule blocks} to schedule a subroutine from a thorn to be called at specific times during program execution in a given manner \item {} {\it conditional statements} for both assignment statements and schedule blocks to allow them to be processed depending on parameter values \end{itemize} \subsection{Assignment Statements} {\it Assignment statements}, currently only assign storage. These lines have the form: {\t \begin{verbatim}[STORAGE: [timelevels], [timelevels]] \end{verbatim} } If the thorn is active, storage will be allocated for the given groups for the duration of program execution (unless storage is explicitly switched off by some call to {\tt CCTK\_DisableGroupStorage} within a thorn). The storage line includes the number of timelevels to activate storage for, this number can be from 1 up to the maximum number or timelevels for the group as specified in the defining {\tt interface.ccl} file. If the maximum number of timelevels is 1 (the default), this number may be omitted. The behaviour of an assignment statement is independent of its position in the schedule file (so long as it is outside a schedule block). \subsection{Schedule Blocks} Each {\it schedule block} in the file {\t schedule.ccl} must have the syntax: {\t \begin{verbatim}schedule [GROUP] AT|IN