summaryrefslogtreecommitdiff
path: root/doc/UsersGuide/ThornWriters.tex
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-23 07:29:11 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-23 07:29:11 +0000
commit577c775a314995a19d2cee7dee9ab52eb80fce65 (patch)
tree97dac52adb1d0cf497196187414e7275239cc6b8 /doc/UsersGuide/ThornWriters.tex
parent102ef61000d063b2d76833bb4bc93416a13d3a8b (diff)
Added datatypes
git-svn-id: http://svn.cactuscode.org/flesh/trunk@563 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'doc/UsersGuide/ThornWriters.tex')
-rw-r--r--doc/UsersGuide/ThornWriters.tex72
1 files changed, 72 insertions, 0 deletions
diff --git a/doc/UsersGuide/ThornWriters.tex b/doc/UsersGuide/ThornWriters.tex
index b397ae64..41359d04 100644
--- a/doc/UsersGuide/ThornWriters.tex
+++ b/doc/UsersGuide/ThornWriters.tex
@@ -24,6 +24,78 @@ behavior of someone else's thorn.)
e) Understanding the RFR concept
f) Understanding the GH concept
+\section{Data Types and Sizes}
+
+Cactus supports the following fixed size data types
+
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Data Type & Size (bytes) & Variable Type & Fortran Equivalent\\
+\hline
+{\t CCTK\_INT4} & 4 & {\t CCTK\_VARIABLE\_INT4} & {\t integer*4}\\
+{\t CCTK\_INT8} & 8 & {\t CCTK\_VARIABLE\_INT8} & {\t integer*8}\\
+{\t CCTK\_INT16} & 16 & {\t CCTK\_VARIABLE\_INT16} & {\t integer*16}\\
+{\t CCTK\_REAL4} & 4 & {\t CCTK\_VARIABLE\_REAL4} & {\t real*4}\\
+{\t CCTK\_REAL8} & 8 & {\t CCTK\_VARIABLE\_REAL8} & {\t real*8}\\
+{\t CCTK\_REAL16} & 16 & {\t CCTK\_VARIABLE\_REAL16} & {\t real*16}\\
+{\t CCTK\_COMPLEX4} & 4 & {\t CCTK\_VARIABLE\_COMPLEX4} & \\
+{\t CCTK\_COMPLEX8} & 8 & {\t CCTK\_VARIABLE\_COMPLEX8} & \\
+{\t CCTK\_COMPLEX16} & 16 & {\t CCTK\_VARIABLE\_COMPLEX16} & \\
+{\t CCTK\_CHAR} & 4 & {\t CCTK\_VARIABLE\_CHAR} & {\t char} \\ \hline
+\end{tabular}
+\end{center}
+
+In addition Cactus provides three data types whose size is chosen
+during the compilation process (at configuration time). This is to
+allow the code to be easily run at different precisions. Note that
+the effectiveness of running the code at a lower or higher precision
+depends crucially on all thorns being used making consistent use
+of the following data types:
+
+
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Data Type & Default Size (bytes) & Variable Type & Configuration Option\\
+\hline
+{\t CCTK\_INT} & 8 & {\t CCTK\_VARIABLE\_INT} & {\t INT\_PRECISION}\\
+{\t CCTK\_REAL} & 8 & {\t CCTK\_VARIABLE\_REAL} & {\t REAL\_PRECISION}\\
+{\t CCTK\_COMPLEX} & (8,8) & {\t CCTK\_VARIABLE\_COMPLEX} & Same as real precision\\
+\hline
+\end{tabular}
+\end{center}
+
+These variable types must be used by thorn writers to declare variables
+ in the thorn interface files (FIXME: REF), and may be used to declare
+variables in the thorn routines. Note that variable declarations in
+thorns should obviously match with definitions in the interface files
+where appropriate.
+
+Also provided, are a set of (FIXME: What are these called???) which
+are interpreted by the preprocessor at compile time to signify which
+data size is being used:
+
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Data Type & {\t \#define}\\
+{\t CCTK\_INT4} & {\t CCTK\_INT\_PRECISION\_4} \\
+{\t CCTK\_INT8} & {\t CCTK\_INT\_PRECISION\_8} \\
+{\t CCTK\_INT16} & {\t CCTK\_INT\_PRECISION\_16} \\
+{\t CCTK\_REAL4} & {\t CCTK\_REAL\_PRECISION\_4} \\
+{\t CCTK\_REAL8} & {\t CCTK\_REAL\_PRECISION\_8} \\
+{\t CCTK\_REAL16} & {\t CCTK\_REAL\_PRECISION\_16} \\
+{\t CCTK\_COMPLEX4} & {\t CCTK\_COMPLEX\_PRECISION\_4} \\
+{\t CCTK\_COMPLEX8} & {\t CCTK\_COMPLEX\_PRECISION\_8} \\
+{\t CCTK\_COMPLEX16} & {\t CCTK\_COMPLEX\_PRECISION\_16} \\
+\hline
+\end{tabular}
+\end{center}
+
+Note that Cactus does not provide unsigned character or integer types, and
+that the corresponding C data types are platform dependent.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%