summaryrefslogtreecommitdiff
path: root/doc/UsersGuide/Appendices.tex
blob: 185dc2a7aeb9ddd71fcd5410aa2bcf375ccfb4d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
\part{Appendices}

\appendix

\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{} interface.ccl
\item{} param.ccl
\item{} schedule.ccl
\end{itemize}
These files are written in the {\it Cactus Configuration Language} which is
case insensitive.

\section{interface.ccl}
\label{sec:in}

The interface configuration file consists of a header block giving details 
of the thorns relationship with other thorns, and then a series of blocks 
listing the thorn's global variables.
The header block has the form:
{\t 
\begin{verbatim}
implements: <implementation>
[inherits: <implementation>, <implementation>]
[friend: <implentation>, <implementation>]
\end{verbatim}
}
where
\begin{itemize}
\item{} The implentation name must be unique among all thorns, except between 
        thorns which have the same public and protected variables and 
        parameters.
\item{} Inheriting from another implentation makes all that implentations 
        public variables available to your thorn. At least one thorn 
        providing any inherited implentation must be present at compile time.
        A thorn cannot inherit from itself. Inheritance is associative and 
        recursive, but not commutative.
\item{} Being a friend of another implementation makes all that 
        implementations 
        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 thorns friend's friends.
\end{itemize} 

The thorn's variables are defined by:
{\t
\begin{verbatim}
[<access>:]

VTYPE <group name> [TYPE=<gtype>] [DIM=<dim>] 
[{
   <variable name>[,]<variable name>
   <variable name>
}] [``<group description>'']
\end{verbatim}}

\begin{itemize}
\item{} {\t access} defines which thorns have can use the following 
        groups, and can be either {\t public}, {\t protected} or {\t private}.
\item{} {\t VTYPE} defines the data type of the variables in the group.
Supported data types are {\t LOGICAL}, {\t INTEGER}, {\t CHAR} and {\t REAL}.
(In the future {\t COMPLEX} will also be supported.)
\item{} {\t group name} must be a alpha-numeric name (which may also 
contain underscores) which is unique 
within the scope of the thorn. A group name is compulsory.
\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 if the group is of type
{\t ARRAY} or {\t GF}, and can take the value {\t 1}, {\t 2}, or {\t 3}.
The default value is {\t DIM=3}.
\item{} The 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 and dimension. 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.
\item{} An optional description of the group can be given on the last line, 
        at the moment this description is not used for any purpose.
\end{itemize} 

\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.

\subsection{Parameter Data Scoping Items}
{\t
\begin{verbatim}
<access>:
\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. {\t access} can take the values:
\begin{itemize}
\item{} {\t public} --- all thorns have access to public parameters
\item{} {\t protected} --- other thorns can have access to these 
                           parameters if they specifically request
                           it in their own param.ccl
\item{} {\t private} --- only your thorn has access to private parameters
\item{} {\t friend} --- in this case an {\t implementation} name must follow
                        the colon. It declare that all the parameters in 
                        the following scoping block are protected variables
                        from the specified {\t implementation}.
\end{itemize}


\subsection{Parameter Object Specification Items}
\label{sec:paobspit}

{\t
\begin{verbatim}
[EXTENDS] <parameter type> <parameter name> ``<parameter description>'' 
{
  <PARAMETER VALUES>
} <default value>
\end{verbatim}
}
\begin{itemize}
\item{} Allowed {\t parameter types} are 
  \begin{itemize}
     \item{} {\t INTEGER} The specification of parameter values takes 
     the form of any number of comma-separated blocks of the form:
{\t
\begin{verbatim}
[<low-range>][:[<high-range>][:[<step>]]][::``<range description>'']
\end{verbatim}
}
Where an empty field, or a {\t *} in the place of {\t 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.
     \item{} {\t KEYWORD} Each entry in the list of acceptable values 
             for a keyword has the form 
{\t
\begin{verbatim}
``<keyword value>'', ``<keyword value>'' :: ``<description>''
\end{verbatim}
}
     \item{} {\t STRING}  No allowed values should be specified for a logical 
             parameter.
     \item{} {\t LOGICAL} No allowed values should be specified for a logical 
             parameter. The default value for a logical 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{itemize}

\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 that it is a 
        friend of. This allows it to declare additional acceptable values.
        By default it is acceptable for two thorns to declare the same 
        value as acceptable. 
\end{itemize}


\section{schedule.ccl}
\label{sec:sc}

The schedule configuration files consists of 
\begin{itemize}
\item{} assignments to switch on storage and communications 
        for array variables at the start of program execution.
\item{} {\it schedule blocks} which schedule a subroutine from the
        thorn to be called at a specified time during program 
        executation. Statements within the schedule block can
        be used to switch on storage and communication for groups
        of variables during the duration that the subroutine is called.
\item{} Conditional statements
\end{itemize}

{\it assignments statements} have the form:
{\t
\begin{verbatim}
[STORAGE: <group>, <group>]
[COMMUNICATION: <group>, <group>]
\end{verbatim}
}

Each {\it schedule block} in the file {\t schedule.ccl} must have
the syntax:
{\t
\begin{verbatim}
schedule <function name> at <time>
{
  LANG: <language>
  [STORAGE: <group>,<group>]
  [COMMUNICATION: <group>,<group>]
  [TRIGGER: <grid function>,<grid function>]
} ``Description of function''
\end{verbatim}
}

Any schedule block or assignment statements can be optionally 
surrounded by conditional {\t if-elseif-else}
constructs using the parameter data base. These can be nested,
and have the general form:
{\t
\begin{verbatim}
if (CCTK_Equals(<parameter>,<string>)) 
{
  [<assignments>]
  [<schedule blocks>]
}
\end{verbatim}
}

Conditional constructs cannot be used inside of a schedule block.


\chapter{CCTK Parameters}
\label{sec:ccpa}

\chapter{Using GNATS}
\label{sec:usgn}

\chapter{Using CVS}
\label{sec:uscv}

\chapter{Using TAGS}
\label{sec:usta}
Finding your way around in the Cactus structure can be pretty
difficult to handle. To make life easier there is support for TAGS,
which lets you browse the code easily from within Emacs/XEmacs or vi. 
A TAGS database can be generated with by gmake:

\section{TAGS with emacs}
\label{sec:tawiem}

{\tt gmake TAGS} will create a database for a routine reference
table to be used within Emacs. This database can be accessed within
emacs if you add either of the following lines to your {\tt .emacs} file:\\
{\tt (setq tags-file-name "CCTK\_dir/TAGS")} XOR \\
{\tt (setq tag-table-alist '(("CCTK\_dir" . "CCTK\_dir/TAGS")))}\\
where {\tt CCTK\_dir } is your CCTK directory.\\

You can now easily navigate the CCTK and Toolkits by searching for
functions or ``tags'':
\begin{enumerate}
\item \textbf{ Alt.} will find a tag
\item \textbf{ Alt,} will find the next matching tag
\item \textbf{ Alt*} will go back to the last matched tag
\end{enumerate}
If you add the following lines to your {\tt .emacs} file, the
files found with TAGS will opened in {\em read-only} mode:
\begin{verbatim}
(defun find-tag-readonly (&rest a)
  (interactive)
  (call-interactively `find-tag a)
  (if (eq nil buffer-read-only) (setq buffer-read-only t))  )

(defun find-tag-readonly-next (&rest a)
  (interactive)
  (call-interactively `tags-loop-continue a)
  (if (eq nil buffer-read-only) (setq buffer-read-only t))  )

(global-set-key [(control meta \.)] 'find-tag-readonly)
(global-set-key [(control meta \,)] 'find-tag-readonly-next)
\end{verbatim}
The Key strokes to use when you want to browse in read-only mode are:
\begin{enumerate}
\item{CTRL Alt.} will find a tag and open the file in read-only mode
\item{CTRL Alt,} will find the next matching tag in read-only mode
\end{enumerate}

\section{TAGS with vi}
\label{sec:tawivi}

The commands available are highly dependent upon the version of {\bf vi}, but
the following is a selection of commands which may work.


\begin{enumerate}

\item \textbf{vi -t tag} 
Start vi and position the cursor at  the  file and line where `tag' is defined.

\item \textbf{Control-]} 
Find the tag under the cursor.

\item \textbf{:ta tag} 
Find a tag.

\item \textbf{:tnext} 
Find the next matching tag.

\item \textbf{:pop} 
Return to previous location before jump to tag.

\item \textbf{Control-T} 
Return to previous location before jump to tag (not widely implemented).

\end{enumerate}



\chapter{Thorn-Flesh Interface}
\label{sec:thflin}