diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-10-05 00:07:00 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-10-05 00:07:00 +0000 |
commit | b78c70b7bf73f047d78cd9e066c513b7c003106d (patch) | |
tree | f2dda60e99b8f981b6146da8133554e06be2eb22 /src/main | |
parent | 90f754b042785e7acaaad5a4d40f12aa50cb26a9 (diff) |
grdoc, style-guidelines, ...
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1854 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/ActiveThorns.c | 401 | ||||
-rw-r--r-- | src/main/CactusDefaultEvolve.c | 7 | ||||
-rw-r--r-- | src/main/CallStartupFunctions.c | 2 | ||||
-rw-r--r-- | src/main/CommandLine.c | 82 | ||||
-rw-r--r-- | src/main/Complex.c | 161 | ||||
-rw-r--r-- | src/main/ConfigData.c | 53 | ||||
-rw-r--r-- | src/main/DefaultTimers.c | 291 | ||||
-rw-r--r-- | src/main/FortranWrappers.c | 58 | ||||
-rw-r--r-- | src/main/GHExtensions.c | 317 | ||||
-rw-r--r-- | src/main/InitialiseCactus.c | 4 | ||||
-rw-r--r-- | src/main/InitialiseDataStructures.c | 2 | ||||
-rw-r--r-- | src/main/MainUtils.c | 48 | ||||
-rw-r--r-- | src/main/OverloadMain.c | 1 | ||||
-rw-r--r-- | src/main/ProcessCommandLine.c | 4 | ||||
-rw-r--r-- | src/main/ProcessParameterDatabase.c | 2 | ||||
-rw-r--r-- | src/main/RecordImplementation.c | 74 | ||||
-rw-r--r-- | src/main/ScheduleInterface.c | 675 | ||||
-rw-r--r-- | src/main/SetupCache.c | 9 | ||||
-rw-r--r-- | src/main/Subsystems.c | 27 | ||||
-rw-r--r-- | src/main/Traverse.c | 22 | ||||
-rw-r--r-- | src/main/WarnLevel.c | 371 | ||||
-rw-r--r-- | src/main/flesh.cc | 2 |
22 files changed, 2386 insertions, 227 deletions
diff --git a/src/main/ActiveThorns.c b/src/main/ActiveThorns.c index fb08b177..7347c26c 100644 --- a/src/main/ActiveThorns.c +++ b/src/main/ActiveThorns.c @@ -5,6 +5,7 @@ @desc Stuff to deal with activethorns. @enddesc + @version $Header$ @@*/ #include <stdio.h> @@ -22,10 +23,10 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ActiveThorns_c) -/* Local routine */ -static int RegisterImp(const char *name, const char *thorn); +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ -/* Structures used to store data */ struct THORN { int active; @@ -39,6 +40,19 @@ struct IMPLEMENTATION char *activating_thorn; }; +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +static int RegisterImp(const char *name, const char *thorn); + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ static t_sktree *thornlist = NULL; static t_sktree *implist = NULL; @@ -46,6 +60,10 @@ static t_sktree *implist = NULL; static int n_thorns = 0; static int n_imps = 0; +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTKi_RegisterThorn @date Sun Jul 4 17:44:14 1999 @@ -58,7 +76,29 @@ static int n_imps = 0; @history @endhistory - + @var name + @vdesc Thorn name + @vtype const char * + @vio in + @vcomment + + @endvar + @var imp + @vdesc Implementation name + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + -1 - Duplicate thorn + -2 - memory failure storing thorn + -3 - memory failure storing implementation name + -4 - failed to store thorn in tree + @endreturndesc @@*/ int CCTKi_RegisterThorn(const char *name, const char *imp) { @@ -92,7 +132,10 @@ int CCTKi_RegisterThorn(const char *name, const char *imp) /* Store the data in the tree */ temp = SKTreeStoreData(thornlist, thornlist, name, thorn); - if(!thornlist) thornlist = temp; + if(!thornlist) + { + thornlist = temp; + } if(temp) { @@ -126,76 +169,6 @@ int CCTKi_RegisterThorn(const char *name, const char *imp) } /*@@ - @routine RegisterImp - @date Sun Jul 4 17:44:42 1999 - @author Tom Goodale - @desc - Registers an implementation. - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ -static int RegisterImp(const char *name, const char *thorn) -{ - int retval; - t_sktree *node; - t_sktree *temp; - - struct IMPLEMENTATION *imp; - - /* Does the implementation already exist ? */ - node = SKTreeFindNode(implist, name); - - if(!node) - { - n_imps++; - - /* Create the structure to hold info about it. */ - imp = (struct IMPLEMENTATION *)malloc(sizeof(struct IMPLEMENTATION)); - - if(imp) - { - imp->active = 0; - - /* Store the name of this thorn in a tree */ - imp->thornlist = SKTreeStoreData(NULL,NULL, thorn, NULL); - - /* Store the info in the tree. */ - temp = SKTreeStoreData(implist, implist, name, imp); - - if(!implist) implist = temp; - - if(temp) - { - retval = 0; - } - else - { - retval = -3; - } - } - else - { - retval = -2; - } - } - else - { - imp = (struct IMPLEMENTATION *)(node->data); - SKTreeStoreData(imp->thornlist,imp->thornlist, thorn, NULL); - - retval = -1; - } - - return retval; -} - - - /*@@ @routine CCTKi_ActivateThorn @date Sun Jul 4 17:46:15 1999 @author Tom Goodale @@ -208,7 +181,22 @@ static int RegisterImp(const char *name, const char *thorn) @history @endhistory - + @var name + @vdesc Name of thorn to activate + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + -1 - non-existent thorn + -2 - internal error + -3 - thorn already active + -4 - implementation already active + @endreturndesc @@*/ int CCTKi_ActivateThorn(const char *name) { @@ -289,7 +277,19 @@ int CCTKi_ActivateThorn(const char *name) @history @endhistory + @var name + @vdesc Name of thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - inactive + 1 - active + @endreturndesc @@*/ int CCTK_IsThornActive(const char *name) { @@ -338,7 +338,18 @@ int CCTK_FCALL CCTK_FNAME(CCTK_IsThornActive) @history @endhistory + @var name + @vdesc Name of the thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype const char * + @returndesc + Name of the implementation or NULL + @endreturndesc @@*/ const char *CCTK_ThornImplementation(const char *name) { @@ -374,7 +385,18 @@ const char *CCTK_ThornImplementation(const char *name) @history @endhistory + @var name + @vdesc Name of the implementation + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype const char * + @returndesc + Name of the thorn or NULL + @endreturndesc @@*/ const char *CCTK_ImplementationThorn(const char *name) { @@ -412,7 +434,19 @@ const char *CCTK_ImplementationThorn(const char *name) @history @endhistory + @var name + @vdesc Name of thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - not compiled + 1 - compiled + @endreturndesc @@*/ int CCTK_IsThornCompiled(const char *name) { @@ -453,7 +487,19 @@ void CCTK_FCALL CCTK_FNAME(CCTK_IsThornCompiled) @history @endhistory + @var name + @vdesc Name of implementation + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - inactive + 1 - active + @endreturndesc @@*/ int CCTK_IsImplementationActive(const char *name) { @@ -502,7 +548,32 @@ void CCTK_FCALL CCTK_FNAME(CCTK_IsImplementationActive) @history @endhistory - + @var file + @vdesc File stream to print to + @vtype FILE * + @vio in + @vcomment + + @endvar + @var format + @vdesc format string for file + @vtype const char * + @vio in + @vcomment + + @endvar + @var active + @vdesc Just print active thorns ? + @vtype int + @vio in + @vcomment + Set to 0 to print all thorns. + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_PrintThorns(FILE *file, const char *format, int active) { @@ -541,7 +612,32 @@ int CCTKi_PrintThorns(FILE *file, const char *format, int active) @history @endhistory - + @var file + @vdesc File stream to print to + @vtype FILE * + @vio in + @vcomment + + @endvar + @var format + @vdesc format string for file + @vtype const char * + @vio in + @vcomment + + @endvar + @var active + @vdesc Just print active implementations ? + @vtype int + @vio in + @vcomment + Set to 0 to print all implementations. + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_PrintImps(FILE *file, const char *format, int active) { @@ -580,7 +676,18 @@ int CCTKi_PrintImps(FILE *file, const char *format, int active) @history @endhistory + @var name + @vdesc implementation name + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype const char * + @returndesc + Name of activating thorn or NULL if inactive + @endreturndesc @@*/ const char *CCTK_ActivatingThorn(const char *name) { @@ -623,7 +730,18 @@ const char *CCTK_ActivatingThorn(const char *name) @history @endhistory + @var name + @vdesc Name of implementation + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype t_sktree * + @returndesc + Thornlist + @endreturndesc @@*/ t_sktree *CCTK_ImpThornList(const char *name) { @@ -665,6 +783,10 @@ t_sktree *CCTK_ImpThornList(const char *name) @endhistory + @returntype int + @returndesc + Number of thorns compiled in + @endreturndesc @@*/ int CCTK_NumCompiledThorns(void) { @@ -684,9 +806,20 @@ int CCTK_NumCompiledThorns(void) @history @endhistory + @var tindex + @vdesc thorn index + @vtype int + @vio in + @vcomment + + @endvar + @returntype const char * + @returndesc + Name of thorn + @endreturndesc @@*/ -const char *CCTK_CompiledThorn(int index) +const char *CCTK_CompiledThorn(int tindex) { int i; t_sktree *node; @@ -722,6 +855,10 @@ const char *CCTK_CompiledThorn(int index) @endhistory + @returntype int + @returndesc + Number of implementations compiled in + @endreturndesc @@*/ int CCTK_NumCompiledImplementations(void) { @@ -741,7 +878,18 @@ int CCTK_NumCompiledImplementations(void) @history @endhistory + @var tindex + @vdesc implementation index + @vtype int + @vio in + @vcomment + + @endvar + @returntype const char * + @returndesc + Name of implementation + @endreturndesc @@*/ const char *CCTK_CompiledImplementation(int index) { @@ -764,3 +912,98 @@ const char *CCTK_CompiledImplementation(int index) return ret_val; } + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + + /*@@ + @routine RegisterImp + @date Sun Jul 4 17:44:42 1999 + @author Tom Goodale + @desc + Registers an implementation. + @enddesc + @calls + @calledby + @history + + @endhistory + @var name + @vdesc name of the implementation + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc name of the thorn + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + -1 - failed to store thorn in implementation + -2 - memory failure creating implementation + -3 - failed to store implementtion in tree + @endreturndesc +@@*/ +static int RegisterImp(const char *name, const char *thorn) +{ + int retval; + t_sktree *node; + t_sktree *temp; + + struct IMPLEMENTATION *imp; + + /* Does the implementation already exist ? */ + node = SKTreeFindNode(implist, name); + + if(!node) + { + n_imps++; + + /* Create the structure to hold info about it. */ + imp = (struct IMPLEMENTATION *)malloc(sizeof(struct IMPLEMENTATION)); + + if(imp) + { + imp->active = 0; + + /* Store the name of this thorn in a tree */ + imp->thornlist = SKTreeStoreData(NULL,NULL, thorn, NULL); + + /* Store the info in the tree. */ + temp = SKTreeStoreData(implist, implist, name, imp); + + if(!implist) implist = temp; + + if(temp) + { + retval = 0; + } + else + { + retval = -3; + } + } + else + { + retval = -2; + } + } + else + { + imp = (struct IMPLEMENTATION *)(node->data); + SKTreeStoreData(imp->thornlist,imp->thornlist, thorn, NULL); + + retval = -1; + } + + return retval; +} + diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c index 9064378d..b3c4042e 100644 --- a/src/main/CactusDefaultEvolve.c +++ b/src/main/CactusDefaultEvolve.c @@ -216,8 +216,11 @@ static int DoneMainLoop (CCTK_REAL cctk_time, int iteration) int the main iteration loop. Makes calls to the individual routines for each schedule point. @enddesc - @calls PreStepper, EvolStepper, PostStepper - @calledby main + @calls CCTK_Traverse + @calledby + @history + + @endhistory @@*/ static int StepGH(cGH *GH) diff --git a/src/main/CallStartupFunctions.c b/src/main/CallStartupFunctions.c index a69a1eaa..1116b4ee 100644 --- a/src/main/CallStartupFunctions.c +++ b/src/main/CallStartupFunctions.c @@ -45,7 +45,7 @@ CCTK_FILEVERSION(main_CallStartupFunctions_c) @desc @enddesc - @calls + @calls CCTK_ScheduleTraverse @calledby @history diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index e6415c55..f2e8868f 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -5,6 +5,7 @@ @desc Routines to deal with command line arguments. @enddesc + @version $Header$ @@*/ #include <stdio.h> @@ -35,7 +36,6 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_CommandLine_c) - /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ @@ -78,13 +78,20 @@ int cctki_paramcheck_nprocs; @desc Tests if a given thorn has been compiled. At the moment the given thorn must be in the format - <package name>/<thorn name> + <arrangement name>/<thorn name> @enddesc @calls CCTK_IsThornCompiled @calledby @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ @@ -112,11 +119,18 @@ void CCTKi_CommandLineTestThornCompiled(const char *optarg) @desc Describe all the parameters @enddesc - @calls + @calls CCTK_NumCompiledThorns CCTK_CompiledThorn CCTK_ParameterWalk CommandLinePrintParameter @calledby @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_CommandLineDescribeAllParameters(const char *optarg) @@ -161,8 +175,6 @@ void CCTKi_CommandLineDescribeAllParameters(const char *optarg) } } - /* CCTKi_BindingsParameterHelp(NULL,"%s",stdout);*/ - CCTK_Exit(NULL,0); } @@ -173,11 +185,18 @@ void CCTKi_CommandLineDescribeAllParameters(const char *optarg) @desc Describe a particular parameter. @enddesc - @calls + @calls Util_SplitString CCTK_ParameterData CCTK_ImplementationThorn CommandLinePrintParameter @calledby @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_CommandLineDescribeParameter(const char *optarg) @@ -224,6 +243,13 @@ void CCTKi_CommandLineDescribeParameter(const char *optarg) @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_CommandLineTestParameters(const char *optarg) @@ -252,11 +278,19 @@ void CCTKi_CommandLineTestParameters(const char *optarg) @desc Sets the CCTK warning level from a command line argument. @enddesc - @calls + @calls CCTKi_SetWarningLevel @calledby @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar + @@*/ void CCTKi_CommandLineWarningLevel(const char *optarg) @@ -276,11 +310,18 @@ void CCTKi_CommandLineWarningLevel(const char *optarg) @desc Sets the CCTK error level from a command line argument. @enddesc - @calls + @calls CCTKi_SetErrorLevel @calledby @history @endhistory + @var optarg + @vdesc option argument + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_CommandLineErrorLevel(const char *optarg) @@ -322,7 +363,7 @@ void CCTKi_CommandLineRedirectStdout(void) @desc List the thorns which are compiled in. @enddesc - @calls + @calls CCTKi_PrintThorns @calledby @history @@ -344,7 +385,7 @@ void CCTKi_CommandLineListThorns(void) @desc Prints version info @enddesc - @calls + @calls CCTK_FullVersion @calledby @history @@ -374,7 +415,7 @@ void CCTKi_CommandLineVersion(void) @desc Prints a help message @enddesc - @calls + @calls CCTK_CommandLine @calledby @history @@ -415,7 +456,7 @@ void CCTKi_CommandLineHelp(void) @desc Prints a usage message. @enddesc - @calls + @calls CCTK_CommandLine @calledby @history @@ -468,17 +509,7 @@ void CCTKi_CommandLineFinished(void) } else { - /* FIXME: remove this #ifdef in beta 8 */ -#ifdef NULL_DEVICE sprintf(fname,NULL_DEVICE); -#else -#ifdef WIN32 - /* hack for Windows which doesn't know about /dev/null */ - sprintf(fname,"NUL"); -#else - sprintf(fname,"/dev/null"); -#endif -#endif /* NULL_DEVICE */ } freopen(fname,"w",stdout); @@ -503,6 +534,13 @@ void CCTKi_CommandLineFinished(void) @history @endhistory + @var properties + @vdesc Parameter properties + @vtype const cParamData * + @vio in + @vcomment + + @endvar @@*/ static void CommandLinePrintParameter(const cParamData *properties) diff --git a/src/main/Complex.c b/src/main/Complex.c index 9e04a334..0ff9653b 100644 --- a/src/main/Complex.c +++ b/src/main/Complex.c @@ -5,6 +5,7 @@ @desc Complex variable stuff @enddesc + @version $Header$ @@*/ #include <math.h> @@ -17,6 +18,26 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_Complex_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTK_Cmplx @date Tue Dec 14 12:16:01 1999 @@ -29,7 +50,25 @@ CCTK_FILEVERSION(main_Complex_c) @history @endhistory + @var Re + @vdesc Real part + @vtype CCTK_REAL + @vio in + @vcomment + + @endvar + @var Im + @vdesc Imaginary part + @vtype CCTK_REAL + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The complex number + @endreturndesc @@*/ CCTK_COMPLEX CCTK_Cmplx(CCTK_REAL Re, CCTK_REAL Im) { @@ -53,7 +92,18 @@ CCTK_COMPLEX CCTK_Cmplx(CCTK_REAL Re, CCTK_REAL Im) @history @endhistory + @var complex_number + @vdesc The complex number + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_REAL + @returndesc + The real part + @endreturndesc @@*/ CCTK_REAL CCTK_CmplxReal(CCTK_COMPLEX complex_number) { @@ -72,7 +122,18 @@ CCTK_REAL CCTK_CmplxReal(CCTK_COMPLEX complex_number) @history @endhistory + @var complex_number + @vdesc The complex number + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_REAL + @returndesc + The imaginary part + @endreturndesc @@*/ CCTK_REAL CCTK_CmplxImag(CCTK_COMPLEX complex_number) { @@ -91,7 +152,18 @@ CCTK_REAL CCTK_CmplxImag(CCTK_COMPLEX complex_number) @history @endhistory + @var in + @vdesc The complex number + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The complex conjugate + @endreturndesc @@*/ CCTK_COMPLEX CCTK_CmplxConjg(CCTK_COMPLEX in) { @@ -115,6 +187,18 @@ CCTK_COMPLEX CCTK_CmplxConjg(CCTK_COMPLEX in) @history @endhistory + @var in + @vdesc The complex number + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + + @returntype CCTK_REAL + @returndesc + The absolute value of the complex number + @endreturndesc @@*/ CCTK_REAL CCTK_CmplxAbs(CCTK_COMPLEX in) @@ -138,7 +222,25 @@ CCTK_REAL CCTK_CmplxAbs(CCTK_COMPLEX in) @history @endhistory + @var a + @vdesc First summand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @var b + @vdesc Second summand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The sum + @endreturndesc @@*/ CCTK_COMPLEX CCTK_CmplxAdd(CCTK_COMPLEX a,CCTK_COMPLEX b) { @@ -160,7 +262,25 @@ CCTK_COMPLEX CCTK_CmplxAdd(CCTK_COMPLEX a,CCTK_COMPLEX b) @history @endhistory + @var a + @vdesc First operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @var b + @vdesc Second operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The difference + @endreturndesc @@*/ CCTK_COMPLEX CCTK_CmplxSub(CCTK_COMPLEX a,CCTK_COMPLEX b) { @@ -182,7 +302,25 @@ CCTK_COMPLEX CCTK_CmplxSub(CCTK_COMPLEX a,CCTK_COMPLEX b) @history @endhistory + @var a + @vdesc First operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @var b + @vdesc Second operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The product + @endreturndesc @@*/ CCTK_COMPLEX CCTK_CmplxMul(CCTK_COMPLEX a,CCTK_COMPLEX b) { @@ -204,7 +342,25 @@ CCTK_COMPLEX CCTK_CmplxMul(CCTK_COMPLEX a,CCTK_COMPLEX b) @history @endhistory + @var a + @vdesc First operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @var b + @vdesc Second operand + @vtype CCTK_COMPLEX + @vio in + @vcomment + + @endvar + @returntype CCTK_COMPLEX + @returndesc + The quotient + @endreturndesc @@*/ CCTK_COMPLEX CCTK_CmplxDiv(CCTK_COMPLEX a,CCTK_COMPLEX b) { @@ -238,3 +394,8 @@ CCTK_CmplxLog CCTK_CmplxExp */ + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/main/ConfigData.c b/src/main/ConfigData.c index 5aff3991..36112afe 100644 --- a/src/main/ConfigData.c +++ b/src/main/ConfigData.c @@ -5,6 +5,7 @@ @desc Miscellaneous routines to deal with configuration data @enddesc + @version $Header$ @@*/ #include <stdio.h> @@ -16,6 +17,26 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ConfigData_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTKi_AddGH @date Fri Jan 15 13:43:11 1999 @@ -28,7 +49,34 @@ CCTK_FILEVERSION(main_ConfigData_c) @history @endhistory + @var config + @vdesc Flesh config data + @vtype tFleshConfig + @vio in + @vcomment + + @endvar + @var convergence_level + @vdesc The convergence level + @vtype int + @vio in + @vcomment + + @endvar + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + 1 - memory failure + 2 - duplicate convergence level + @endreturndesc @@*/ int CCTKi_AddGH(tFleshConfig *config, int convergence_level, cGH *GH) { @@ -71,3 +119,8 @@ int CCTKi_AddGH(tFleshConfig *config, int convergence_level, cGH *GH) return retval; } + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/main/DefaultTimers.c b/src/main/DefaultTimers.c index 3eecf7ca..220a11fb 100644 --- a/src/main/DefaultTimers.c +++ b/src/main/DefaultTimers.c @@ -5,6 +5,7 @@ @desc Default Cactus timers @enddesc + @version $Header$ @@*/ #include <stdio.h> @@ -32,16 +33,37 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_DefaultTimers_c) + +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + /* Prototypes for registration functions */ #ifdef HAVE_TIME_GETTIMEOFDAY -void CCTKi_RegisterTimersGetTimeOfDay(void); +static void CCTKi_RegisterTimersGetTimeOfDay(void); #endif #ifdef HAVE_TIME_GETRUSAGE -void CCTKi_RegisterTimersGetrUsage(void); +static void CCTKi_RegisterTimersGetrUsage(void); #endif +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTKi_RegisterDefaultTimerFunctions @date Wed Oct 20 18:27:20 1999 @@ -57,6 +79,10 @@ void CCTKi_RegisterTimersGetrUsage(void); @endhistory + @returntype int + @returndesc + 0 + @endreturndesc @@*/ int CCTKi_RegisterDefaultTimerFunctions(void) { @@ -73,6 +99,11 @@ int CCTKi_RegisterDefaultTimerFunctions(void) } +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + + /********************************************************************* **************** Actual timers ********************* @@ -110,9 +141,20 @@ static char *GetTimeOfDayUnits = "secs"; @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @returntype void * + @returndesc + timer structure + @endreturndesc @@*/ -void *CCTKi_TimerGetTimeOfDayCreate(int timernum) +static void *CCTKi_TimerGetTimeOfDayCreate(int timernum) { t_GetTimeOfDayTimer *this; @@ -139,9 +181,23 @@ void *CCTKi_TimerGetTimeOfDayCreate(int timernum) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var data + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDayDestroy(int timernum, void *data) +static void CCTKi_TimerGetTimeOfDayDestroy(int timernum, void *data) { if(data) { @@ -162,9 +218,23 @@ void CCTKi_TimerGetTimeOfDayDestroy(int timernum, void *data) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDayStart(int timernum, void *idata) +static void CCTKi_TimerGetTimeOfDayStart(int timernum, void *idata) { t_GetTimeOfDayTimer *data; @@ -183,7 +253,7 @@ void CCTKi_TimerGetTimeOfDayStart(int timernum, void *idata) } /*@@ - @routine CCTKi_TimerGetTimeOfDayStart + @routine CCTKi_TimerGetTimeOfDayStop @date Wed Oct 20 18:28:19 1999 @author Tom Goodale @desc @@ -194,9 +264,23 @@ void CCTKi_TimerGetTimeOfDayStart(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDayStop(int timernum, void *idata) +static void CCTKi_TimerGetTimeOfDayStop(int timernum, void *idata) { t_GetTimeOfDayTimer *data; @@ -227,9 +311,23 @@ void CCTKi_TimerGetTimeOfDayStop(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDayReset(int timernum, void *idata) +static void CCTKi_TimerGetTimeOfDayReset(int timernum, void *idata) { t_GetTimeOfDayTimer *data; @@ -254,9 +352,30 @@ void CCTKi_TimerGetTimeOfDayReset(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar + @var vals + @vdesc Timer value structure + @vtype cTimerVal + @vio out + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDayGet(int timernum, void *idata, cTimerVal *vals) +static void CCTKi_TimerGetTimeOfDayGet(int timernum, void *idata, cTimerVal *vals) { t_GetTimeOfDayTimer *data; @@ -280,9 +399,30 @@ void CCTKi_TimerGetTimeOfDayGet(int timernum, void *idata, cTimerVal *vals) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar + @var vals + @vdesc Timer value structure + @vtype cTimerVal + @vio in + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetTimeOfDaySet(int timernum, void *idata, cTimerVal *vals) +static void CCTKi_TimerGetTimeOfDaySet(int timernum, void *idata, cTimerVal *vals) { t_GetTimeOfDayTimer *data; @@ -306,7 +446,7 @@ void CCTKi_TimerGetTimeOfDaySet(int timernum, void *idata, cTimerVal *vals) @endhistory @@*/ -void CCTKi_RegisterTimersGetTimeOfDay(void) +static void CCTKi_RegisterTimersGetTimeOfDay(void) { cTimerFuncs functions; @@ -355,9 +495,21 @@ static char *GetrUsageUnits = "secs"; @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + + @returntype void * + @returndesc + timer structure + @endreturndesc @@*/ -void *CCTKi_TimerGetrUsageCreate(int timernum) +static void *CCTKi_TimerGetrUsageCreate(int timernum) { t_GetrUsageTimer *this; @@ -384,9 +536,23 @@ void *CCTKi_TimerGetrUsageCreate(int timernum) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var data + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetrUsageDestroy(int timernum, void *data) +static void CCTKi_TimerGetrUsageDestroy(int timernum, void *data) { if(data) { @@ -407,9 +573,23 @@ void CCTKi_TimerGetrUsageDestroy(int timernum, void *data) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetrUsageStart(int timernum, void *idata) +static void CCTKi_TimerGetrUsageStart(int timernum, void *idata) { t_GetrUsageTimer *data; @@ -427,7 +607,7 @@ void CCTKi_TimerGetrUsageStart(int timernum, void *idata) } /*@@ - @routine CCTKi_TimerGetrUsageStart + @routine CCTKi_TimerGetrUsageStop @date Wed Oct 20 18:28:19 1999 @author Tom Goodale @desc @@ -438,9 +618,23 @@ void CCTKi_TimerGetrUsageStart(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetrUsageStop(int timernum, void *idata) +static void CCTKi_TimerGetrUsageStop(int timernum, void *idata) { t_GetrUsageTimer *data; @@ -470,9 +664,23 @@ void CCTKi_TimerGetrUsageStop(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetrUsageReset(int timernum, void *idata) +static void CCTKi_TimerGetrUsageReset(int timernum, void *idata) { t_GetrUsageTimer *data; @@ -495,9 +703,31 @@ void CCTKi_TimerGetrUsageReset(int timernum, void *idata) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar + @var vals + @vdesc Timer value structure + @vtype cTimerVal + @vio out + @vcomment + + @endvar + @@*/ -void CCTKi_TimerGetrUsageGet(int timernum, void *idata, cTimerVal *vals) +static void CCTKi_TimerGetrUsageGet(int timernum, void *idata, cTimerVal *vals) { t_GetrUsageTimer *data; @@ -522,9 +752,30 @@ void CCTKi_TimerGetrUsageGet(int timernum, void *idata, cTimerVal *vals) @history @endhistory + @var timernum + @vdesc timer number + @vtype int + @vio in + @vcomment + + @endvar + @var idata + @vdesc timer data + @vtype void * + @vio inout + @vcomment + + @endvar + @var vals + @vdesc Timer value structure + @vtype cTimerVal + @vio in + @vcomment + + @endvar @@*/ -void CCTKi_TimerGetrUsageSet(int timernum, void *idata, cTimerVal *vals) +static void CCTKi_TimerGetrUsageSet(int timernum, void *idata, cTimerVal *vals) { t_GetrUsageTimer *data; @@ -548,7 +799,7 @@ void CCTKi_TimerGetrUsageSet(int timernum, void *idata, cTimerVal *vals) @endhistory @@*/ -void CCTKi_RegisterTimersGetrUsage(void) +static void CCTKi_RegisterTimersGetrUsage(void) { cTimerFuncs functions; diff --git a/src/main/FortranWrappers.c b/src/main/FortranWrappers.c index d0312044..3ebed5c6 100644 --- a/src/main/FortranWrappers.c +++ b/src/main/FortranWrappers.c @@ -5,6 +5,7 @@ @desc File for dealing with fortran wrapper functions. @enddesc + @version $Header$ @@*/ #include <stdlib.h> @@ -18,8 +19,28 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_FortranWrappers_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + static pNamedData *registry = NULL; +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTKi_RegisterFortranWrapper @date Sat Sep 18 00:51:21 1999 @@ -32,9 +53,28 @@ static pNamedData *registry = NULL; @history @endhistory + @var name + @vdesc name of the wrapper function + @vtype const char * + @vio in + @vcomment + + @endvar + @var function + @vdesc Wrapper function + @vtype int (*)(void *, void *) + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + The return code of StoreNamedData + @endreturndesc @@*/ -int CCTKi_RegisterFortranWrapper(const char *name, int (*function)(void *, void *)) +int CCTKi_RegisterFortranWrapper(const char *name, + int (*function)(void *, void *)) { int retcode; retcode = StoreNamedData(®istry, name, (void *)function); @@ -55,9 +95,25 @@ int CCTKi_RegisterFortranWrapper(const char *name, int (*function)(void *, void @history @endhistory + @var name + @vdesc Name of the wrapper + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int (*)(void *,void *) + @returndesc + The wrapper function + @endreturndesc @@*/ int (*CCTKi_FortranWrapper(const char *name))(void *, void *) { return (int (*)(void *,void *))GetNamedData(registry, name); } + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/main/GHExtensions.c b/src/main/GHExtensions.c index d58ec1fe..306f6824 100644 --- a/src/main/GHExtensions.c +++ b/src/main/GHExtensions.c @@ -5,6 +5,7 @@ @desc Functions to deal with GH extensions @enddesc + @version $Header$ @@*/ /*#define DEBUG*/ @@ -22,10 +23,9 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_GHExtensions_c) -/* Local data holding info on extensions..*/ - -static cHandledData *GHExtensions = NULL; -static int num_extensions = 0; +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ /* The GH extension structure. * This contains pointers to functions which the extension requires. @@ -47,6 +47,10 @@ struct GHExtension }; +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + /* Function which checks that all the functions on all extensions have been * filled in. */ @@ -62,6 +66,25 @@ static int DummyScheduleTraverseGH(cGH *GH, const char *where); +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/* Local data holding info on extensions..*/ + +static cHandledData *GHExtensions = NULL; +static int num_extensions = 0; + + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + + /************************************************************************** ************************************************************************** **************************************************************************/ @@ -79,7 +102,20 @@ static int DummyScheduleTraverseGH(cGH *GH, @history @endhistory + @var name + @vdesc Name of the extension + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0+ - the handle + -1 - extension already exists + -2 - out of memory + @endreturndesc @@*/ int CCTK_RegisterGHExtension(const char *name) { @@ -137,19 +173,22 @@ int CCTK_RegisterGHExtension(const char *name) @enddesc @calls @calledby + @history + + @endhistory @var name @vdesc The name of the GH extension to unregister @vtype const char * @vio in @vcomment + @endvar + @returntype int - @returndesc 0 for success, -1 for failure + @returndesc + 0 - success + -1 - failure @endreturndesc - @history - - @endhistory - @@*/ int CCTK_UnregisterGHExtension(const char *name) { @@ -199,7 +238,26 @@ int CCTK_UnregisterGHExtension(const char *name) @history @endhistory + @var handle + @vdesc The extension handle + @vtype int + @vio in + @vcomment + + @endvar + @var func + @vdesc the function used to setup the GH extension + @vtype void *(*)(tFleshConfig *, int, cGH *) + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 1 - success + 0 - extension doesn't exist + @endreturndesc @@*/ int CCTK_RegisterGHExtensionSetupGH(int handle, void *(*func)(tFleshConfig *, int, cGH *)) @@ -235,7 +293,26 @@ int CCTK_RegisterGHExtensionSetupGH(int handle, @history @endhistory + @var handle + @vdesc The extension handle + @vtype int + @vio in + @vcomment + + @endvar + @var func + @vdesc the function used to initialise the GH extension + @vtype void *(*)(cGH *) + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 1 - success + 0 - extension doesn't exist + @endreturndesc @@*/ int CCTK_RegisterGHExtensionInitGH(int handle, int (*func)(cGH *)) @@ -271,7 +348,26 @@ int CCTK_RegisterGHExtensionInitGH(int handle, @history @endhistory + @var handle + @vdesc The extension handle + @vtype int + @vio in + @vcomment + + @endvar + @var func + @vdesc the function used to perform a schedule traverse + @vtype void *(*)(cGH *, const char *) + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 1 - success + 0 - extension doesn't exist + @endreturndesc @@*/ int CCTK_RegisterGHExtensionScheduleTraverseGH(int handle, int (*func)(cGH *, const char *)) @@ -314,7 +410,34 @@ int CCTK_RegisterGHExtensionScheduleTraverseGH(int handle, @history @endhistory + @var config + @vdesc Flesh config data + @vtype tFleshConfig + @vio in + @vcomment + + @endvar + @var convergence_level + @vdesc The convergence level + @vtype int + @vio in + @vcomment + + @endvar + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + 1 - memory failure + 2 - not all extensions properly setup + @endreturndesc @@*/ int CCTKi_SetupGHExtensions(tFleshConfig *config, int convergence_level, @@ -365,10 +488,6 @@ int CCTKi_SetupGHExtensions(tFleshConfig *config, return return_code; } - - - - /*@@ @routine CCTKi_InitGHExtensions @date Wed Feb 3 14:12:18 1999 @@ -381,7 +500,18 @@ int CCTKi_SetupGHExtensions(tFleshConfig *config, @history @endhistory - + @var GH + @vdesc The cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_InitGHExtensions(cGH *GH) { @@ -412,7 +542,25 @@ int CCTKi_InitGHExtensions(cGH *GH) @history @endhistory - + @var GH + @vdesc The cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @var where + @vdesc Schedule point to traverse + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_ScheduleTraverseGHExtensions(cGH *GH, const char *where) @@ -432,6 +580,54 @@ int CCTKi_ScheduleTraverseGHExtensions(cGH *GH, return 0; } +/************************************************************************ + * + * Query functions. + * + ************************************************************************/ + + /*@@ + @routine CCTK_GHExtensionHandle + @date Tue Feb 9 18:23:41 1999 + @author Tom Goodale + @desc + Gets the handle to the GH extension. + @enddesc + @calls + @calledby + @history + + @endhistory + @var name + @vdesc Name of the GH extension + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + The GH extension handle + @endreturndesc +@@*/ +int CCTK_GHExtensionHandle(const char *name) +{ + return Util_GetHandle(GHExtensions, name, NULL); +} + +void CCTK_FCALL CCTK_FNAME(CCTK_GHExtensionHandle) + (int *handle,ONE_FORTSTRING_ARG) +{ + ONE_FORTSTRING_CREATE(name) + *handle = CCTK_GHExtensionHandle(name); + free(name); +} + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + /*************************************************************************** * * Checking routines @@ -451,7 +647,10 @@ int CCTKi_ScheduleTraverseGHExtensions(cGH *GH, @history @endhistory - + @returntype int + @returndesc + 1 - all ok + @endreturndesc @@*/ static int CheckAllExtensionsSetup(void) { @@ -503,38 +702,6 @@ static int CheckAllExtensionsSetup(void) return return_code; } -/************************************************************************ - * - * Query functions. - * - ************************************************************************/ - - /*@@ - @routine CCTK_GHExtensionHandle - @date Tue Feb 9 18:23:41 1999 - @author Tom Goodale - @desc - Gets the handle to the GH extension. - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ -int CCTK_GHExtensionHandle(const char *name) -{ - return Util_GetHandle(GHExtensions, name, NULL); -} - -void CCTK_FCALL CCTK_FNAME(CCTK_GHExtensionHandle) - (int *handle,ONE_FORTSTRING_ARG) -{ - ONE_FORTSTRING_CREATE(name) - *handle = CCTK_GHExtensionHandle(name); - free(name); -} @@ -557,7 +724,32 @@ void CCTK_FCALL CCTK_FNAME(CCTK_GHExtensionHandle) @history @endhistory + @var config + @vdesc Flesh config data + @vtype tFleshConfig + @vio in + @vcomment + + @endvar + @var convergence_level + @vdesc The convergence level + @vtype int + @vio in + @vcomment + + @endvar + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @returntype void * + @returndesc + NULL + @endreturndesc @@*/ static void *DummySetupGH(tFleshConfig *config, int convergence_level, @@ -579,7 +771,18 @@ static void *DummySetupGH(tFleshConfig *config, @history @endhistory + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 + @endreturndesc @@*/ static int DummyInitGH(cGH *GH) { @@ -599,7 +802,25 @@ static int DummyInitGH(cGH *GH) @history @endhistory + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in + @vcomment + + @endvar + @var where + @vdesc Schedule point to traverse + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 + @endreturndesc @@*/ static int DummyScheduleTraverseGH(cGH *GH, const char *where) diff --git a/src/main/InitialiseCactus.c b/src/main/InitialiseCactus.c index 3772f86e..9c2278bb 100644 --- a/src/main/InitialiseCactus.c +++ b/src/main/InitialiseCactus.c @@ -67,7 +67,7 @@ static time_t startuptime; @desc @enddesc - @calls ProcessCommandLine ProcessParameterDatabase CallStartupFunctions + @calls CCTKi_InitialiseSubsystemDefaults CCTKi_ProcessEnvironment CCTKi_ProcessCommandLine CCTKi_CactusBanner CCTKi_InitialiseDataStructures CCTKi_ProcessParameterDatabase CCTKi_BindingsVariablesInitialise CCTKi_InitialiseScheduler CCTKi_CallStartupFunctions CCTKi_PrintBanners @calledby main @history @@ -137,7 +137,7 @@ int CCTKi_InitialiseCactus(int *argc, char ***argv, tFleshConfig *ConfigData) @desc Initialise all scheduled items @enddesc - @calls + @calls CCTKi_SetParameterSetMask CCTKi_BindingsParameterRecoveryInitialise CCTKi_BindingsScheduleInitialise CCTKi_DoScheduleSortAllGroups CCTK_SchedulePrint @calledby @history diff --git a/src/main/InitialiseDataStructures.c b/src/main/InitialiseDataStructures.c index f6ebf907..8c4b7da2 100644 --- a/src/main/InitialiseDataStructures.c +++ b/src/main/InitialiseDataStructures.c @@ -50,7 +50,7 @@ int CCTKi_RegisterDefaultTimerFunctions(void); @desc @enddesc - @calls + @calls CCTKi_ActivateThorn CCTKi_SetupCache @calledby @history diff --git a/src/main/MainUtils.c b/src/main/MainUtils.c index 158159ec..ef1d28a3 100644 --- a/src/main/MainUtils.c +++ b/src/main/MainUtils.c @@ -19,6 +19,28 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_MainUtils_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/* the iteration counter used in the evolution loop */ +static int iteration = 0; + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ /*@@ @routine CCTK_RunTitle @@ -29,7 +51,29 @@ CCTK_FILEVERSION(main_MainUtils_c) @enddesc @calls @calledby + @history + + @endhistory + @var len + @vdesc The length of the title buffer + @vtype int + @vio in + @vcomment + + @endvar + @var title + @vdesc The title buffer + @vtype char * + @vio out + @vcomment + + @endvar + @returntype int + @returndesc + The length of the title + - if title is NULL + @endreturndesc @@*/ int CCTK_RunTitle(int len, char *title) { @@ -62,3 +106,7 @@ int CCTK_RunTitle(int len, char *title) return retval; } +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/main/OverloadMain.c b/src/main/OverloadMain.c index 378ffa64..56d13970 100644 --- a/src/main/OverloadMain.c +++ b/src/main/OverloadMain.c @@ -7,6 +7,7 @@ Uses the overload macros to make sure of consistency and to save typing ! @enddesc + @version $Header$ @@*/ #include <stdio.h> diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c index 69657b7e..9ea4b468 100644 --- a/src/main/ProcessCommandLine.c +++ b/src/main/ProcessCommandLine.c @@ -52,7 +52,7 @@ static char **argv = NULL; @desc Processes the command line arguments. @enddesc - @calls + @calls CCTKi_CommandLineTestThornCompiled CCTKi_CommandLineDescribeAllParameters CCTKi_CommandLineDescribeParameter CCTKi_CommandLineTestParameters CCTKi_CommandLineWarningLevel CCTKi_CommandLineErrorLevel CCTKi_CommandLineRedirectStdout CCTKi_CommandLineListThorns() CCTKi_CommandLineVersion() CCTKi_CommandLineHelp @calledby @history @@ -202,7 +202,7 @@ int CCTK_CommandLine(char ***outargv) @desc Returns the parameter filename @enddesc - @calls + @calls CCTK_Equals @calledby @history diff --git a/src/main/ProcessParameterDatabase.c b/src/main/ProcessParameterDatabase.c index 39a36531..eaf80c8b 100644 --- a/src/main/ProcessParameterDatabase.c +++ b/src/main/ProcessParameterDatabase.c @@ -53,7 +53,7 @@ void CCTKi_SetParameterSetMask(int mask); @desc @enddesc - @calls + @calls CCTKi_SetParameterSetMask ParseFile @calledby @history diff --git a/src/main/RecordImplementation.c b/src/main/RecordImplementation.c index 4a4c2883..84cb1f07 100644 --- a/src/main/RecordImplementation.c +++ b/src/main/RecordImplementation.c @@ -3,8 +3,10 @@ @date Wed Jan 13 21:03:55 1999 @author Tom Goodale @desc - + Keeps a register of implementations and thorns associated + with implementations. @enddesc + @version $Header$ @@*/ #include <stdio.h> @@ -17,14 +19,34 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_RecordImplementation_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + typedef struct { int n_thorns; char **thornlist; } t_ImplementationData; + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + static pNamedData *implementation_data = NULL; +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ /*@@ @routine CCTKi_RegisterImplementation @@ -38,10 +60,32 @@ static pNamedData *implementation_data = NULL; @history @endhistory - + @var implementation + @vdesc The implementation to register + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc A thorn providing this implementation + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + 1 - memory failure realloc of thorn list + 2 - memory failure creating implementation + 3 - memory failure creating thornlist + 4 - memory failure malloc of name of thorn + @endreturndesc @@*/ int CCTKi_RegisterImplementation(const char *implementation, - const char *thorn) + const char *thorn) { int retval; char **temp; @@ -102,7 +146,7 @@ int CCTKi_RegisterImplementation(const char *implementation, } else { - fprintf(stderr, "Unable to allocate memory for new thorn %s\n", thorn); + fprintf(stderr, "Unable to allocate memory for new implementation %s\n", implementation); retval = 2; } @@ -123,7 +167,25 @@ int CCTKi_RegisterImplementation(const char *implementation, @history @endhistory + @var implementation + @vdesc name of the implementation + @vtype const char * + @vio in + @vcomment + + @endvar + @var thornlist + @vdesc Pointer to array holding list of thorns + @vtype char *** + @vio out + @vcomment + + @endvar + @returntype int + @returndesc + Number of thorns providing implementation + @endreturndesc @@*/ int GetImplementationThorns(const char *implementation, char ***thornlist) { @@ -143,3 +205,7 @@ int GetImplementationThorns(const char *implementation, char ***thornlist) return retval; } + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index 5a1f2a12..ab027948 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -196,7 +196,32 @@ static cTimerData *timerinfo = NULL; @history @endhistory + @var function + @vdesc pointer to function + @vtype void * + @vio in + @vcomment + + @endvar + @var fdata + @vdesc data about the function + @vtype cFunctionData * + @vio in + @vcomment + + @endvar + @var data + @vdesc Data to be passed to the function + @vtype void * + @vio inout + @vcomment + + @endvar + @returntype int + @returndesc + 0 - didn't synchronise + @endreturndesc @@*/ int CCTK_CallFunction(void *function, cFunctionData *fdata, @@ -254,7 +279,124 @@ int CCTK_CallFunction(void *function, @history @endhistory - + @var function + @vdesc function to be scheduled + @vtype void * + @vio in + @vcomment + + @endvar + @var name + @vdesc name of function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc name of thorn providing function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var implementation + @vdesc name of implementation thorn belongs to + @vtype const char * + @vio in + @vcomment + + @endvar + @var description + @vdesc desciption of function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var where + @vdesc where to schedule the function + @vtype const char * + @vio in + @vcomment + + @endvar + @var language + @vdesc language of function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var n_mem_groups + @vdesc Number of groups needing memory switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_comm_groups + @vdesc Number of groups needing communication switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_trigger_groups + @vdesc Number of groups to trigger this function on + @vtype int + @vio in + @vcomment + + @endvar + @var n_sync_groups + @vdesc Number of groups needing synchronisation after this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_options + @vdesc Number of options for this schedule block + @vtype int + @vio in + @vcomment + + @endvar + @var n_before + @vdesc Number of functions/groups to schedule before + @vtype int + @vio in + @vcomment + + @endvar + @var n_after + @vdesc Number of functions/groups to schedule after + @vtype int + @vio in + @vcomment + + @endvar + @var n_while + @vdesc Number of vars to schedule while + @vtype int + @vio in + @vcomment + + @endvar + @var ... + @vdesc remaining options + @vtype multiple const char * + @vio in + @vcomment + This should have as many items as the sum of the above n_* options + @endvar + + @returntype int + @returndesc + Return val of DoScheduleFunction or + -1 - memory failure + @endreturndesc @@*/ int CCTKi_ScheduleFunction(void *function, const char *name, @@ -320,7 +462,110 @@ int CCTKi_ScheduleFunction(void *function, @history @endhistory - + @var name + @vdesc name of group to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc name of thorn providing group to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var implementation + @vdesc name of implementation group belongs to + @vtype const char * + @vio in + @vcomment + + @endvar + @var description + @vdesc desciption of group to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var where + @vdesc where to schedule the group + @vtype const char * + @vio in + @vcomment + + @endvar + @var n_mem_groups + @vdesc Number of groups needing memory switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_comm_groups + @vdesc Number of groups needing communication switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_trigger_groups + @vdesc Number of groups to trigger this function on + @vtype int + @vio in + @vcomment + + @endvar + @var n_sync_groups + @vdesc Number of groups needing synchronisation after this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_options + @vdesc Number of options for this schedule block + @vtype int + @vio in + @vcomment + + @endvar + @var n_before + @vdesc Number of functions/groups to schedule before + @vtype int + @vio in + @vcomment + + @endvar + @var n_after + @vdesc Number of functions/groups to schedule after + @vtype int + @vio in + @vcomment + + @endvar + @var n_while + @vdesc Number of vars to schedule while + @vtype int + @vio in + @vcomment + + @endvar + @var ... + @vdesc remaining options + @vtype multiple const char * + @vio in + @vcomment + This should have as many items as the sum of the above n_* options + @endvar + + @returntype int + @returndesc + Return val of DoScheduleGroup or + -1 - memory failure + @endreturndesc @@*/ int CCTKi_ScheduleGroup(const char *name, const char *thorn, @@ -384,7 +629,18 @@ int CCTKi_ScheduleGroup(const char *name, @history @endhistory - + @var group + @vdesc group name + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + Group index or + -1 - memory failure + @endreturndesc @@*/ int CCTKi_ScheduleGroupStorage(const char *group) { @@ -425,7 +681,18 @@ int CCTKi_ScheduleGroupStorage(const char *group) @history @endhistory - + @var group + @vdesc group name + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + Group index or + -1 - memory failure + @endreturndesc @@*/ int CCTKi_ScheduleGroupComm(const char *group) { @@ -455,7 +722,7 @@ int CCTKi_ScheduleGroupComm(const char *group) /*@@ - @routine CCTK_ScheduleTraveres + @routine CCTK_ScheduleTraverse @date Tue Apr 4 08:05:27 2000 @author Tom Goodale @desc @@ -466,7 +733,33 @@ int CCTKi_ScheduleGroupComm(const char *group) @history @endhistory - + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @var GH + @vdesc GH data + @vtype void * + @vio inout + @vcomment + + @endvar + @var CallFunction + @vdesc Function called to call a function + @vtype int (*)(void *, cFubctionData, void *) + @vio in + @vcomment + Set to NULL to use the default + @endvar + + @returntype int + @returndesc + 0 - success + 1 - memory failure + @endreturndesc @@*/ int CCTK_ScheduleTraverse(const char *where, void *GH, @@ -544,7 +837,18 @@ int CCTK_ScheduleTraverse(const char *where, @history @endhistory + @var GH + @vdesc GH data + @vtype void * + @vio inout + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_ScheduleGHInit(void *GH) { @@ -575,7 +879,18 @@ int CCTKi_ScheduleGHInit(void *GH) @history @endhistory + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_SchedulePrint(const char *where) { @@ -633,6 +948,31 @@ int CCTK_SchedulePrint(const char *where) return 0; } +/*@@ + @routine CCTK_SchedulePrintTimes + @date Fri Sep 17 21:52:44 1999 + @author Tom Goodale + @desc + Prints out the schedule timings. + @enddesc + @calls + @calledby + @history + + @endhistory + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc +@@*/ int CCTK_SchedulePrintTimes(const char *where) { t_sched_data data; @@ -702,7 +1042,18 @@ int CCTK_SchedulePrintTimes(const char *where) @history @endhistory + @var sval + @vdesc Language + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype cLanguage + @returndesc + The language + @endreturndesc @@*/ cLanguage CCTK_TranslateLanguage(const char *sval) { @@ -741,7 +1092,32 @@ cLanguage CCTK_TranslateLanguage(const char *sval) @history @endhistory - + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @var GH + @vdesc GH data + @vtype void * + @vio inout + @vcomment + + @endvar + @var CallFunction + @vdesc Function called to call a function + @vtype int (*)(void *, cFubctionData, void *) + @vio in + @vcomment + Set to NULL to use the default + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ static int ScheduleTraverse(const char *where, @@ -774,15 +1150,12 @@ static int ScheduleTraverse(const char *where, calling_function = CCTKi_ScheduleCallFunction; - CCTKi_DoScheduleTraverse - ( - where, + CCTKi_DoScheduleTraverse(where, (int (*)(void *, void *)) CCTKi_ScheduleCallEntry, (int (*)(void *, void *)) CCTKi_ScheduleCallExit, (int (*)(int, char **, void *, void *))CCTKi_ScheduleCallWhile, (int (*)(void *, void *, void *)) calling_function, - (void *)&data - ); + (void *)&data); return 0; } @@ -799,7 +1172,81 @@ static int ScheduleTraverse(const char *where, @history @endhistory - + @var description + @vdesc desciption of function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var language + @vdesc language of function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc name of thorn providing function to be scheduled + @vtype const char * + @vio in + @vcomment + + @endvar + @var implementation + @vdesc name of implementation thorn belongs to + @vtype const char * + @vio in + @vcomment + + @endvar + @var n_mem_groups + @vdesc Number of groups needing memory switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_comm_groups + @vdesc Number of groups needing communication switched on during this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_trigger_groups + @vdesc Number of groups to trigger this function on + @vtype int + @vio in + @vcomment + + @endvar + @var n_sync_groups + @vdesc Number of groups needing synchronisation after this function + @vtype int + @vio in + @vcomment + + @endvar + @var n_options + @vdesc Number of options for this schedule block + @vtype int + @vio in + @vcomment + + @endvar + @var ap + @vdesc options + @vtype va_list of multiple const char * + @vio inout + @vcomment + This should have as many items as the sum of the above n_* options + @endvar + + @returntype t_attribute + @returndesc + The attribute + @endreturndesc @@*/ static t_attribute *CreateAttribute(const char *description, const char *language, @@ -897,7 +1344,39 @@ static t_attribute *CreateAttribute(const char *description, @history @endhistory - + @var n_before + @vdesc Number of functions/groups to schedule before + @vtype int + @vio in + @vcomment + + @endvar + @var n_after + @vdesc Number of functions/groups to schedule after + @vtype int + @vio in + @vcomment + + @endvar + @var n_while + @vdesc Number of vars to schedule while + @vtype int + @vio in + @vcomment + + @endvar + @var ap + @vdesc options + @vtype va_list of multiple const char * + @vio inout + @vcomment + This should have as many items as the sum of the above n_* options + @endvar + + @returntype t_sched_modifier * + @returndesc + the schedule modifier + @endreturndesc @@*/ static t_sched_modifier *CreateModifiers(int n_before, int n_after, @@ -926,7 +1405,32 @@ static t_sched_modifier *CreateModifiers(int n_before, @history @endhistory + @var n_items + @vdesc number of items on the list + @vtype int + @vio in + @vcomment + + @endvar + @var array + @vdesc array of indices + @vtype int * + @vio out + @vcomment + + @endvar + @var ap + @vdesc argument list + @vtype va_list of const char * + @vio inout + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ static int CreateGroupIndexList(int n_items, int *array, va_list *ap) { @@ -957,7 +1461,32 @@ static int CreateGroupIndexList(int n_items, int *array, va_list *ap) @history @endhistory + @var n_items + @vdesc number of items on the list + @vtype int + @vio in + @vcomment + + @endvar + @var attribute + @vdesc attribute list + @vtype t_attribute * + @vio inout + @vcomment + + @endvar + @var ap + @vdesc argument list + @vtype va_list of const char * + @vio inout + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ static int ParseOptionList(int n_items, t_attribute *attribute, @@ -988,7 +1517,18 @@ static int ParseOptionList(int n_items, @history @endhistory + @var attribute + @vdesc option attribute + @vtype t_attribute * + @vio out + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int InitialiseOptionList(t_attribute *attribute) { @@ -1009,7 +1549,25 @@ int InitialiseOptionList(t_attribute *attribute) @history @endhistory + @var attribute + @vdesc option attribute + @vtype t_attribute * + @vio out + @vcomment + + @endvar + @var option + @vdesc Option + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ static int ParseOption(t_attribute *attribute, const char *option) @@ -1040,6 +1598,39 @@ static int ParseOption(t_attribute *attribute, @history @endhistory + @var modifier + @vdesc base schedule modifier + @vtype t_sched_modifier + @vio inout + @vcomment + This is a list which gets expanded by this function + @endvar + @var type + @vdesc modifier type + @vtype const char * + @vio in + @vcomment + before, after, while + @endvar + @var n_items + @vdesc Number of items on list + @vtype int + @vio in + @vcomment + + @endvar + @var ap + @vdesc argument list + @vtype va_list of const char * + @vio inout + @vcomment + + @endvar + + @returntype t_sched_modifier * + @returndesc + modifier list + @endreturndesc @@*/ static t_sched_modifier *CreateTypedModifier(t_sched_modifier *modifier, @@ -1074,7 +1665,18 @@ static t_sched_modifier *CreateTypedModifier(t_sched_modifier *modifier, @history @endhistory + @var where + @vdesc schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype cFunctionType + @returndesc + The function type + @endreturndesc @@*/ static cFunctionType TranslateFunctionType(const char *where) { @@ -1128,7 +1730,19 @@ static cFunctionType TranslateFunctionType(const char *where) @history @endhistory + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + return of DoScheduleTravers or + 0 - where is NULL + @endreturndesc @@*/ static int SchedulePrint(const char *where) { @@ -1141,15 +1755,12 @@ static int SchedulePrint(const char *where) if(where) { - retcode = CCTKi_DoScheduleTraverse - ( - where, + retcode = CCTKi_DoScheduleTraverse(where, (int (*)(void *, void *)) CCTKi_SchedulePrintEntry, (int (*)(void *, void *)) CCTKi_SchedulePrintExit, (int (*)(int, char **, void *, void *))CCTKi_SchedulePrintWhile, (int (*)(void *, void *, void *)) CCTKi_SchedulePrintFunction, - (void *)&data - ); + (void *)&data); } else { @@ -1171,7 +1782,26 @@ static int SchedulePrint(const char *where) @history @endhistory + @var where + @vdesc Schedule point + @vtype const char * + @vio in + @vcomment + + @endvar + @var data + @vdesc schedule data + @vtype t_sched_data + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + return of DoScheduleTravers or + 0 - where is NULL + @endreturndesc @@*/ static int SchedulePrintTimes(const char *where, t_sched_data *data) { @@ -1179,15 +1809,12 @@ static int SchedulePrintTimes(const char *where, t_sched_data *data) if(where) { - retcode = CCTKi_DoScheduleTraverse - ( - where, + retcode = CCTKi_DoScheduleTraverse(where, (int (*)(void *, void *)) CCTKi_SchedulePrintTimesEntry, (int (*)(void *, void *)) CCTKi_SchedulePrintTimesExit, (int (*)(int, char **, void *, void *))CCTKi_SchedulePrintTimesWhile, (int (*)(void *, void *, void *)) CCTKi_SchedulePrintTimesFunction, - (void *)data - ); + (void *)data); } else { diff --git a/src/main/SetupCache.c b/src/main/SetupCache.c index e1d400e3..2918e70c 100644 --- a/src/main/SetupCache.c +++ b/src/main/SetupCache.c @@ -5,6 +5,7 @@ @desc Sets up cache stuff for the CCTK @enddesc + @version $Header$ @@*/ #include <stdlib.h> @@ -38,7 +39,7 @@ CCTK_FILEVERSION(main_SetupCache_c) @returntype int @returndesc - 0 + 0 - success @endreturndesc @@*/ @@ -62,14 +63,8 @@ int CCTKi_SetupCache(void) } else { - /* FIXME: Remove this check for release */ -#ifdef CCTK_L2_CACHE_SIZE cache_size = CCTK_L2_CACHE_SIZE; cacheline_bytes = CCTK_L2_CACHELINE_BYTES; -#else - cache_size = 0; - cacheline_bytes = 0; -#endif } Utili_CacheDataSet(cacheline_bytes, cache_size); diff --git a/src/main/Subsystems.c b/src/main/Subsystems.c index 5f63456e..691b5620 100644 --- a/src/main/Subsystems.c +++ b/src/main/Subsystems.c @@ -5,6 +5,7 @@ @desc Misc stuff for the subsystems. @enddesc + @version $Header$ @@*/ #include "cctk_Flesh.h" @@ -14,6 +15,26 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_Subsystems_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTKi_InitialiseSubsystemDefaults @date Fri Jul 23 14:39:53 1999 @@ -21,7 +42,7 @@ CCTK_FILEVERSION(main_Subsystems_c) @desc Sets up the defaults for the overloadable functions in the subsystems. @enddesc - @calls + @calls CCTKi_SetupMainFunctions CCTKi_SetupCommFunctions CCTKi_SetupIOFunctions CCTKi_BindingsImplementationsInitialise CCTKi_BindingsParametersInitialise @calledby @history @@ -46,3 +67,7 @@ int CCTKi_InitialiseSubsystemDefaults(void) return 0; } +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/main/Traverse.c b/src/main/Traverse.c index c9cf75d3..2d0853ec 100644 --- a/src/main/Traverse.c +++ b/src/main/Traverse.c @@ -17,6 +17,10 @@ static char *rcsid="$Header$"; CCTK_FILEVERSION(main_Traverse_c) +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + /*@@ @routine CCTK_Traverse @date Thu Jan 27 14:42:16 2000 @@ -29,7 +33,25 @@ CCTK_FILEVERSION(main_Traverse_c) @history @endhistory + @var GH + @vdesc The cGH the functions operate on. + @vtype cGH + @vio inout + @vcomment + + @endvar + @var where + @vdesc The schedule group to traverse + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + Returns the return value of CCTKi_ScheduleTraverse + @endreturndesc @@*/ int CCTK_Traverse(cGH *GH, const char *where) { diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c index 403b2428..9c2ec491 100644 --- a/src/main/WarnLevel.c +++ b/src/main/WarnLevel.c @@ -5,9 +5,9 @@ @desc Routines to deal with warning levels. @enddesc + @version $Header$ @@*/ - #include "cctk_Config.h" #include <stdio.h> @@ -24,12 +24,28 @@ #include "cctk_Comm.h" #include "cctk_Flesh.h" -int CactusDefaultMyProc(void *GH); - static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_WarnLevel_c) +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +int CactusDefaultMyProc(void *GH); + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + /* Store the number of parameter errors */ static int param_errors = 0; @@ -54,6 +70,14 @@ static int n_formats = 0; static pKeyedData *formatlist = NULL; +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + /*@@ @routine CCTKi_SetWarnLevel @date Wed Feb 17 00:42:16 1999 @@ -66,7 +90,20 @@ static pKeyedData *formatlist = NULL; @history @endhistory - + @var level + @vdesc level to set + @vtype int + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 1 - increased warning level + 0 - warning level unchanged + -1 - decreased warning level + @endreturndesc @@*/ int CCTKi_SetWarnLevel(int level) { @@ -104,6 +141,7 @@ int CCTKi_SetWarnLevel(int level) sprintf(warning_message, "Decreasing error level to warning_level\n"); CCTK_Warn(2, __LINE__,__FILE__,"Cactus",warning_message); } + return retval; } @@ -119,7 +157,46 @@ int CCTKi_SetWarnLevel(int level) @history @endhistory + @var level + @vdesc The warning level + @vtype int + @vio in + @vcomment + + @endvar + @var line + @vdesc Line number of warning in originating file + @vtype int + @vio in + @vcomment + + @endvar + @var file + @vdesc Name of originating file + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var message + @vdesc Warning message + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_Warn(int level, int line, const char *file, const char *thorn, const char *message) { @@ -172,21 +249,72 @@ void CCTK_FCALL CCTK_FNAME(CCTK_Warn) @desc Used by CCTKi_EXPCTERR macro (src/include/cctk.h) allows testing for error return value, will return a - warnign statement if error is found. + warning statement if error is found. @enddesc @calls @calledby @history @endhistory - + @var in + @vdesc FIXME + @vtype int + @vio in + @vcomment + + @endvar + @var err + @vdesc FIXME + @vtype int + @vio in + @vcomment + + @endvar + @var warnonerr + @vdesc The warning level + @vtype int + @vio in + @vcomment + + @endvar + @var line + @vdesc Line number of warning in originating file + @vtype int + @vio in + @vcomment + + @endvar + @var file + @vdesc Name of originating file + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var message + @vdesc Warning message + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_ExpectError(int in, int err, int warnonerr, int line, const char *file, const char *thorn, const char *message) { - if (in==err) CCTK_Warn(warnonerr, line, file, thorn, message); + if (in==err) + { + CCTK_Warn(warnonerr, line, file, thorn, message); + } } @@ -217,14 +345,65 @@ void CCTK_FCALL CCTK_FNAME(CCTKi_ExpectError) @history @endhistory - + @var in + @vdesc FIXME + @vtype int + @vio in + @vcomment + + @endvar + @var ok + @vdesc FIXME + @vtype int + @vio in + @vcomment + + @endvar + @var warnonerr + @vdesc The warning level + @vtype int + @vio in + @vcomment + + @endvar + @var line + @vdesc Line number of warning in originating file + @vtype int + @vio in + @vcomment + + @endvar + @var file + @vdesc Name of originating file + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var message + @vdesc Warning message + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ void CCTKi_ExpectOK(int in, int ok, int warnonerr, int line, const char *file, const char *thorn, const char *message) { - if (in!=ok) CCTK_Warn(warnonerr, line, file, thorn, message); + if (in != ok) + { + CCTK_Warn(warnonerr, line, file, thorn, message); + } } void CCTK_FCALL CCTK_FNAME(CCTKi_ExpectOK) @@ -253,7 +432,53 @@ void CCTK_FCALL CCTK_FNAME(CCTKi_ExpectOK) @history @endhistory + @var level + @vdesc The warning level + @vtype int + @vio in + @vcomment + + @endvar + @var line + @vdesc Line number of warning in originating file + @vtype int + @vio in + @vcomment + + @endvar + @var file + @vdesc Name of originating file + @vtype const char * + @vio in + @vcomment + + @endvar + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var format + @vdesc Format string for following arguments + @vtype const char * + @vio in + @vcomment + + @endvar + @var ... + @vdesc arguments for format string + @vtype multiple arguments + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_VWarn(int level, int line, const char *file, const char *thorn, const char *format, ...) @@ -311,7 +536,25 @@ int CCTK_VWarn(int level, int line, const char *file, const char *thorn, const c @history @endhistory + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var message + @vdesc Warning message + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_ParamWarn(const char *thorn, const char *message) { @@ -360,7 +603,25 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ParamWarn) @history @endhistory + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var message + @vdesc Warning message + @vtype const char * + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_Info(const char *thorn, const char *message) @@ -394,7 +655,32 @@ void CCTK_FCALL CCTK_FNAME(CCTK_Info) @history @endhistory + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @vcomment + + @endvar + @var format + @vdesc format string for message + @vtype const char * + @vio in + @vcomment + + @endvar + @var ... + @vdesc arguments for format string + @vtype multiple arguments + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTK_VInfo (const char *thorn, const char *format, ...) @@ -426,7 +712,20 @@ int CCTK_VInfo (const char *thorn, const char *format, ...) @history @endhistory - + @var level + @vdesc New level + @vtype int + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 1 - increased error level + 0 - error error unchanged + -1 - decreased error level + @endreturndesc @@*/ int CCTKi_SetErrorLevel(int level) { @@ -530,7 +829,18 @@ void CCTKi_FinaliseParamWarn(void) @history @endhistory + @var ONE_FORTRSTRING_ARG + @vdesc Format string + @vtype Fortran string macro + @vio in + @vcomment + + @endvar + @returntype int + @returndesc + number of previous formats + @endreturndesc @@*/ int CCTK_FCALL CCTK_FNAME(CCTK_MessageFormat) (ONE_FORTSTRING_ARG) @@ -542,6 +852,38 @@ int CCTK_FCALL CCTK_FNAME(CCTK_MessageFormat) return n_formats-1; } + /*@@ + @routine CCTK_VINFO + @date Wed Oct 4 21:03:08 2000 + @author Tom Goodale + @desc + Fortran version of CCTK_VInfo + @enddesc + @calls + @calledby + @history + + @endhistory + @var format_number + @vdesc format string handle + @vtype int + @vio in + @vcomment + + @endvar + @var ... + @vdesc arguments for format string + @vtype multiple arguments + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + FIXME - UNFINISHED + @endreturndesc +@@*/ void CCTK_FCALL CCTK_FNAME(CCTK_VInfo) (int format_number, ...) { @@ -574,7 +916,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_VInfo) } else { - + /* FIXME */ } } @@ -595,6 +937,13 @@ void CCTK_FCALL CCTK_FNAME(CCTK_VInfo) @history @endhistory + @var message + @vdesc Message to be printed + @vtype const char * + @vio in + @vcomment + + @endvar @@*/ diff --git a/src/main/flesh.cc b/src/main/flesh.cc index 58edc68c..5d7653e3 100644 --- a/src/main/flesh.cc +++ b/src/main/flesh.cc @@ -26,7 +26,7 @@ CCTK_FILEVERSION(main_flesh_cc) going to be any c++ at all in your program. @enddesc - @calls CCTKi_InitialiseCactus Initialise Evolve Shutdown ShutdownCactus + @calls CCTKi_InitialiseCactus CCTKi_ShutdownCactus @calledby @history |