diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-11-05 14:58:55 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-11-05 14:58:55 +0000 |
commit | 7429addb5b7f80c1035b59afa239996ff1a58c65 (patch) | |
tree | 1ba6dde297325a705161420eacd2a2151db10fa5 | |
parent | 295247798ad3e1ef841ac7e04d219ac3cb146e8b (diff) |
Adding a const qualifier to the 'cGH *' argument of some flesh routines
and for I/O method registration.
You will also need to update the I/O thorns which I will commit changes to now.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2452 17b73243-c579-4c4c-a9d2-2d5706c11dac
27 files changed, 713 insertions, 776 deletions
diff --git a/src/IO/FortranBindingsIO.c b/src/IO/FortranBindingsIO.c index c5d54933..2fa32e72 100644 --- a/src/IO/FortranBindingsIO.c +++ b/src/IO/FortranBindingsIO.c @@ -3,8 +3,9 @@ @date Thu Feb 18 14:27:18 1999 @author Gabrielle Allen @desc - Fortran bindings for the IO functions + Fortran bindings for the IO functions @enddesc + @version $Id$ @@*/ #include <stdlib.h> @@ -17,18 +18,24 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(IO_FortranBindingsIO_c) -void CCTK_FCALL CCTK_FNAME(CCTK_OutputGH) - (int *istat,cGH *GH) + +void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH) + (int *istat, const cGH *GH); +void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod) + (int *handle, TWO_FORTSTRING_ARG); + + +void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH) + (int *istat, const cGH *GH) { - *istat = CCTK_OutputGH(GH); + *istat = CCTK_OutputGH (GH); } -void CCTK_FCALL CCTK_FNAME(CCTKi_RegisterIOMethod) - (int *handle, TWO_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod) + (int *handle, TWO_FORTSTRING_ARG) { - TWO_FORTSTRING_CREATE(thorn,name); - *handle = CCTKi_RegisterIOMethod(thorn,name); - free(thorn); - free(name); + TWO_FORTSTRING_CREATE (thorn, name); + *handle = CCTKi_RegisterIOMethod (thorn, name); + free (thorn); + free (name); } - diff --git a/src/IO/IOMethods.c b/src/IO/IOMethods.c index 2222984a..cd245cf0 100644 --- a/src/IO/IOMethods.c +++ b/src/IO/IOMethods.c @@ -27,36 +27,32 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION (IO_IOMethods_c) /******************************************************************** - ********************* Local Data Types *********************** - ********************************************************************/ - -/******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ /* Dummy registerable function prototypes. */ -static int DummyOutputGH(cGH *GH); -static int DummyOutputVarAs(cGH *GH, - const char *var, - const char *alias); -static int DummyTriggerOutput(cGH *GH, int var); -static int DummyTimeToOutput(cGH *GH, int var); - -int CactusDefaultOutputGH (cGH *GH); -int CactusDefaultOutputVarAsByMethod (cGH *GH, - const char *var, - const char *methodname, - const char *alias); +static int DummyOutputGH (const cGH *GH); +static int DummyOutputVarAs (const cGH *GH, + const char *var, + const char *alias); +static int DummyTriggerOutput (const cGH *GH, int var); +static int DummyTimeToOutput (const cGH *GH, int var); /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ +int CactusDefaultOutputGH (const cGH *GH); +int CactusDefaultOutputVarAsByMethod (const cGH *GH, + const char *var, + const char *methodname, + const char *alias); + void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) - (int *ierr, cGH *GH, THREE_FORTSTRING_ARG); + (int *ierr, const cGH *GH, THREE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarByMethod) - (int *ierr, cGH *GH, TWO_FORTSTRING_ARG); -int CCTKi_TriggerSaysGo (cGH *GH, int variable); + (int *ierr, const cGH *GH, TWO_FORTSTRING_ARG); +int CCTKi_TriggerSaysGo (const cGH *GH, int variable); int CCTKi_TriggerAction (void *GH, int variable); @@ -101,27 +97,27 @@ static int num_methods = 0; -2 if memory allocation failed @endreturndesc @@*/ -int CCTKi_RegisterIOMethod(const char *thorn, const char *name) +int CCTKi_RegisterIOMethod (const char *thorn, const char *name) { int handle; struct IOMethod *new_method; /* Check that the method hasn't already been registered */ - handle = Util_GetHandle(IOMethods, name, NULL); + handle = Util_GetHandle (IOMethods, name, NULL); - if(handle < 0) + if (handle < 0) { /* New extension. */ - new_method = (struct IOMethod *)malloc(sizeof(struct IOMethod)); + new_method = (struct IOMethod *) malloc (sizeof (struct IOMethod)); - if(new_method) + if (new_method) { /* Get a handle for it. */ - handle = Util_NewHandle(&IOMethods, name, new_method); + handle = Util_NewHandle (&IOMethods, name, new_method); /* Initialise the I/O method structure with dummy routines */ - new_method->implementation = CCTK_ThornImplementation(thorn); + new_method->implementation = CCTK_ThornImplementation (thorn); new_method->OutputGH = DummyOutputGH; new_method->OutputVarAs = DummyOutputVarAs; new_method->TriggerOutput = DummyTriggerOutput; @@ -160,9 +156,9 @@ int CCTKi_RegisterIOMethod(const char *thorn, const char *name) @vtype int @vio in @endvar - @var func - @vdesc name of the routine for implementing OutputGH - @vtype (* func)(cGH *) + @var OutputGH + @vdesc reference to the routine implementing OutputGH + @vtype int (*) (const cGH *) @vio in @endvar @@ -172,7 +168,7 @@ int CCTKi_RegisterIOMethod(const char *thorn, const char *name) -1 if function did not register @endreturndesc @@*/ -int CCTK_RegisterIOMethodOutputGH(int handle, int (*func)(cGH *)) +int CCTK_RegisterIOMethodOutputGH (int handle, int (*OutputGH) (const cGH *GH)) { struct IOMethod *method; @@ -181,7 +177,7 @@ int CCTK_RegisterIOMethodOutputGH(int handle, int (*func)(cGH *)) method = Util_GetHandledData (IOMethods, handle); if (method) { - method->OutputGH = func; + method->OutputGH = OutputGH; } return (method ? 0 : -1); @@ -202,9 +198,9 @@ int CCTK_RegisterIOMethodOutputGH(int handle, int (*func)(cGH *)) @vtype int @vio in @endvar - @var func - @vdesc name of the routine for implementing OutputVarAs - @vtype (* func)(cGH *, const char *,const char *) + @var OutputVarAs + @vdesc reference to the routine implementing OutputVarAs + @vtype int (*) (const cGH *, const char *, const char *) @vio in @endvar @@ -214,8 +210,10 @@ int CCTK_RegisterIOMethodOutputGH(int handle, int (*func)(cGH *)) -1 if function did not register @endreturndesc @@*/ -int CCTK_RegisterIOMethodOutputVarAs(int handle, int (*func)(cGH *, - const char *,const char *)) +int CCTK_RegisterIOMethodOutputVarAs (int handle, + int (*OutputVarAs) (const cGH *GH, + const char *vname, + const char *alias)) { struct IOMethod *method; @@ -224,23 +222,51 @@ int CCTK_RegisterIOMethodOutputVarAs(int handle, int (*func)(cGH *, method = Util_GetHandledData (IOMethods, handle); if (method) { - method->OutputVarAs = func; + method->OutputVarAs = OutputVarAs; } return (method ? 0 : -1); } -int CCTK_RegisterIOMethodTriggerOutput(int handle, int (*func)(cGH *, int)) + /*@@ + @routine CCTK_RegisterIOMethodTriggerOutput + @date Wed Feb 3 13:34:12 1999 + @author Tom Goodale + @desc + Registers a function to register a routine for TriggerOutput + @enddesc + @calls Util_GetHandledData + + @var handle + @vdesc identifies the method in the stored data + @vtype int + @vio in + @endvar + @var TriggerOutput + @vdesc reference to the routine implementing TriggerOutput + @vtype int (*) (const cGH *, int) + @vio in + @endvar + + @returntype int + @returndesc + 0 if function was successfully registered, or<BR> + -1 if function did not register + @endreturndesc +@@*/ +int CCTK_RegisterIOMethodTriggerOutput (int handle, + int (*TriggerOutput) (const cGH *GH, + int vindex)) { struct IOMethod *method; /* Get the extension. */ - method = Util_GetHandledData(IOMethods, handle); + method = Util_GetHandledData (IOMethods, handle); if (method) { - method->TriggerOutput = func; + method->TriggerOutput = TriggerOutput; } return (method != NULL); @@ -261,9 +287,9 @@ int CCTK_RegisterIOMethodTriggerOutput(int handle, int (*func)(cGH *, int)) @vtype int @vio in @endvar - @var func - @vdesc name of the routine for implementing TimeToOutput - @vtype (* func)(cGH *, int) + @var TimeToOutput + @vdesc reference to the routine implementing TimeToOutput + @vtype int (*) (const cGH *, int) @vio in @endvar @@ -273,7 +299,9 @@ int CCTK_RegisterIOMethodTriggerOutput(int handle, int (*func)(cGH *, int)) -1 if function did not register @endreturndesc @@*/ -int CCTK_RegisterIOMethodTimeToOutput (int handle, int (*func)(cGH *, int)) +int CCTK_RegisterIOMethodTimeToOutput (int handle, + int (*TimeToOutput) (const cGH *GH, + int vindex)) { struct IOMethod *method; @@ -282,7 +310,7 @@ int CCTK_RegisterIOMethodTimeToOutput (int handle, int (*func)(cGH *, int)) method = Util_GetHandledData (IOMethods, handle); if (method) { - method->TimeToOutput = func; + method->TimeToOutput = TimeToOutput; } return (method ? 0 : -1); @@ -308,7 +336,7 @@ int CCTK_RegisterIOMethodTimeToOutput (int handle, int (*func)(cGH *, int)) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var var @@ -325,12 +353,12 @@ int CCTK_RegisterIOMethodTimeToOutput (int handle, int (*func)(cGH *, int)) @returntype int @returndesc - logical or'ed return codes of all I/O methods' - OutputVarAs() routines, or<BR> - -2 if no I/O methods were found + positive for the number of I/O methods which successfully + did output for var, or<BR> + -1 if no I/O methods were found @endreturndesc @@*/ -int CCTK_OutputVarAs (cGH *GH, const char *var, const char *alias) +int CCTK_OutputVarAs (const cGH *GH, const char *var, const char *alias) { int handle, retval; struct IOMethod *method; @@ -338,19 +366,18 @@ int CCTK_OutputVarAs (cGH *GH, const char *var, const char *alias) if (num_methods > 0) { - retval = 0; - for (handle = 0; handle < num_methods; handle++) + for (handle = retval = 0; handle < num_methods; handle++) { method = (struct IOMethod *) Util_GetHandledData (IOMethods, handle); - if (method) + if (method && method->OutputVarAs (GH, var, alias) > 0) { - method->OutputVarAs(GH, var, alias); + retval++; } } } else { - retval = -2; + retval = -1; } return (retval); @@ -368,7 +395,7 @@ int CCTK_OutputVarAs (cGH *GH, const char *var, const char *alias) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var var @@ -382,7 +409,7 @@ int CCTK_OutputVarAs (cGH *GH, const char *var, const char *alias) return code of @seeroutine CCTK_OutputVarAs @endreturndesc @@*/ -int CCTK_OutputVar (cGH *GH, const char *var) +int CCTK_OutputVar (const cGH *GH, const char *var) { int retval; @@ -404,7 +431,7 @@ int CCTK_OutputVar (cGH *GH, const char *var) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var var @@ -424,7 +451,7 @@ int CCTK_OutputVar (cGH *GH, const char *var) return code of @seeroutine CCTK_OutputVarAsByMethod @endreturndesc @@*/ -int CCTK_OutputVarByMethod (cGH *GH, const char *var, const char *method) +int CCTK_OutputVarByMethod (const cGH *GH, const char *var, const char *method) { int retval; @@ -435,12 +462,12 @@ int CCTK_OutputVarByMethod (cGH *GH, const char *var, const char *method) } void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarByMethod) - (int *ierr, cGH *GH, TWO_FORTSTRING_ARG) + (int *ierr, const cGH *GH, TWO_FORTSTRING_ARG) { - TWO_FORTSTRING_CREATE(var,method); - *ierr = CCTK_OutputVarByMethod(GH, var, method); - free(var); - free(method); + TWO_FORTSTRING_CREATE (var, method); + *ierr = CCTK_OutputVarByMethod (GH, var, method); + free (var); + free (method); } @@ -458,37 +485,38 @@ void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarByMethod) @endreturndesc @@*/ -int CCTK_NumIOMethods() +int CCTK_NumIOMethods (void) { - return num_methods; + return (num_methods); } + /*@@ @routine CCTK_IOMethodImplementation @date Sat Oct 20 2001 @author Gabrielle Allen @desc - Provide the implementation which registered a method + Provide the implementation which registered a method @enddesc - @returntype int + @var handle + @vdesc handle of I/O method + @vtype int + @vio in + @endvar + + @returntype const char * @returndesc - Implementation which registered this method + Implementation which registered this method @endreturndesc @@*/ - -const char *CCTK_IOMethodImplementation(int handle) +const char *CCTK_IOMethodImplementation (int handle) { struct IOMethod *method; - const char *implementation=NULL; + method = (struct IOMethod *) Util_GetHandledData (IOMethods, handle); - - if (method) - { - implementation = method->implementation; - } - return implementation; + return (method ? method->implementation : NULL); } @@ -510,7 +538,7 @@ const char *CCTK_IOMethodImplementation(int handle) Dummy for OutputGH functions. @enddesc @@*/ -static int DummyOutputGH(cGH *GH) +static int DummyOutputGH (const cGH *GH) { GH = GH; return 0; @@ -525,7 +553,7 @@ static int DummyOutputGH(cGH *GH) Dummy for TimeToOutput function. @enddesc @@*/ -static int DummyTimeToOutput(cGH *GH, int var) +static int DummyTimeToOutput (const cGH *GH, int var) { GH = GH; var = var; @@ -541,9 +569,9 @@ static int DummyTimeToOutput(cGH *GH, int var) Dummy for OutputVarAs functions. @enddesc @@*/ -static int DummyOutputVarAs(cGH *GH, - const char *var, - const char *alias) +static int DummyOutputVarAs (const cGH *GH, + const char *var, + const char *alias) { GH = GH; var = var; @@ -552,7 +580,7 @@ static int DummyOutputVarAs(cGH *GH, } -static int DummyTriggerOutput(cGH *GH, int var) +static int DummyTriggerOutput (const cGH *GH, int var) { GH = GH; var = var; @@ -578,18 +606,21 @@ static int DummyTriggerOutput(cGH *GH, int var) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @returntype int @returndesc + positive for the number of I/O methods which successfully + did output for GH, or<BR> + -1 if no I/O methods were found logical or'ed return codes of all I/O methods' OutputGH() routines, or<BR> -2 if no I/O methods were found @endreturndesc @@*/ -int CactusDefaultOutputGH (cGH *GH) +int CactusDefaultOutputGH (const cGH *GH) { int handle, retval; struct IOMethod *method; @@ -597,24 +628,18 @@ int CactusDefaultOutputGH (cGH *GH) if (num_methods > 0) { - retval = 0; - for (handle = 0; handle < num_methods; handle++) + for (handle = retval = 0; handle < num_methods; handle++) { method = (struct IOMethod *) Util_GetHandledData (IOMethods, handle); - if (method) + if (method && method->OutputGH (GH) > 0) { - -#ifdef DEBUG_IO - printf("Calling I/O method with handle %d \n",handle); -#endif - - retval |= method->OutputGH (GH); + retval++; } } } else { - retval = -2; + retval = -1; } return (retval); @@ -631,7 +656,7 @@ int CactusDefaultOutputGH (cGH *GH) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var var @@ -657,7 +682,7 @@ int CactusDefaultOutputGH (cGH *GH) -1 if no such I/O method was found @endreturndesc @@*/ -int CactusDefaultOutputVarAsByMethod (cGH *GH, +int CactusDefaultOutputVarAsByMethod (const cGH *GH, const char *var, const char *methodname, const char *alias) @@ -673,20 +698,19 @@ int CactusDefaultOutputVarAsByMethod (cGH *GH, } else { - CCTK_VWarn(8,__LINE__,__FILE__,"Cactus", - "CactusDefaultOutputVarAsByMethod: Method %s not found " - "for output of %s",methodname,var); + CCTK_VWarn (8, __LINE__, __FILE__, "Cactus", + "CactusDefaultOutputVarAsByMethod: I/O method '%s' not found " + "for output of variable '%s'", methodname, var); retval = -1; } return (retval); } - void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) - (int *ierr, cGH *GH, THREE_FORTSTRING_ARG) + (int *ierr, const cGH *GH, THREE_FORTSTRING_ARG) { - THREE_FORTSTRING_CREATE(var, methodname, alias); + THREE_FORTSTRING_CREATE (var, methodname, alias); *ierr = CCTK_OutputVarAsByMethod (GH, var, methodname, alias); @@ -716,7 +740,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var variable @@ -731,7 +755,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) 1 if trigger says output me this iteration @endreturndesc @@*/ -int CCTKi_TriggerSaysGo (cGH *GH, int variable) +int CCTKi_TriggerSaysGo (const cGH *GH, int variable) { int handle; struct IOMethod *method; @@ -768,7 +792,7 @@ int CCTKi_TriggerSaysGo (cGH *GH, int variable) @var GH @vdesc Pointer to Grid Hierachy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var variable @@ -781,7 +805,7 @@ int CCTKi_TriggerSaysGo (cGH *GH, int variable) @returndesc 0 = This should never happen, since at least one I/O method should have been found by - CCTKi_TriggerSaysGo + CCTKi_TriggerSaysGo<BR> >0 = Number of I/O methods called for output for this variable @endreturndesc diff --git a/src/IO/OverloadIO.c b/src/IO/OverloadIO.c index cff4eebe..4f240e6e 100644 --- a/src/IO/OverloadIO.c +++ b/src/IO/OverloadIO.c @@ -16,6 +16,7 @@ #include "cctk_Flesh.h" #include "OverloadMacros.h" +#include "CactusRegister.h" #include "cctk_WarnLevel.h" static const char *rcsid="$Header$"; diff --git a/src/comm/OverloadComm.c b/src/comm/OverloadComm.c index 9b5d6fbc..9d0b80da 100644 --- a/src/comm/OverloadComm.c +++ b/src/comm/OverloadComm.c @@ -2,27 +2,27 @@ @file Overload.c @date Wed Feb 3 23:27:18 1999 @author Tom Goodale - @desc - Contains routines to overload the communication functions. - Uses the overload macros to make sure of consistency and - to save typing ! - @enddesc + @desc + Contains routines to overload the communication functions. + Uses the overload macros to make sure of consistency and + to save typing ! + @enddesc + @version $Id$ @@*/ #include <stdio.h> #include <stdlib.h> -#include <stdarg.h> -#include <string.h> #include "cctk_Flesh.h" #include "cctk_FortranString.h" -#include "OverloadMacros.h" #include "cctk_WarnLevel.h" +#include "CactusRegister.h" +#include "OverloadMacros.h" -static const char *rcsid="$Header$"; - +static const char *rcsid = "$Header$"; CCTK_FILEVERSION(comm_OverloadComm_c) + /* Define the prototypes for the dummy functions. */ #define OVERLOADABLE(name) OVERLOADABLE_DUMMYPROTOTYPE(name) @@ -107,74 +107,76 @@ int CCTKi_SetupCommFunctions(void) -/* Fortran bindings for the comm functions */ - +/* Fortran bindings prototypes for the comm functions */ +int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH *GH); +int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH *GH); +void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierr, const cGH *GH); +void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierr, cGH *GH, const int *retval); +void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierr, cGH *GH, const int *retval); +void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG); -int CCTK_FCALL CCTK_FNAME(CCTK_Exit)(cGH *GH, int *retval) +/* Fortran bindings definitions for the comm functions */ +int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH *GH) { - return CCTK_Exit(GH, *retval); + return (CCTK_nProcs (GH)); } - -int CCTK_FCALL CCTK_FNAME(CCTK_ParallelInit)(cGH *GH) + +int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH *GH) { - return CCTK_ParallelInit(GH); + return (CCTK_MyProc (GH)); } - -int CCTK_FCALL CCTK_FNAME(CCTK_Abort)(cGH *GH, int *retval) + +void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierr, const cGH *GH) { - CCTK_Abort(GH, *retval); - return 0; + *ierr = CCTK_Barrier (GH); } -int CCTK_FCALL CCTK_FNAME(CCTK_SyncGroup)(cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierr, cGH *GH, const int *retval) { - ONE_FORTSTRING_CREATE(group_name) - CCTK_SyncGroup(GH,group_name); - free(group_name); - return 0; + *ierr = CCTK_Exit (GH, *retval); } -void CCTK_FCALL CCTK_FNAME(CCTK_EnableGroupComm)(int *ierr, cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierr, cGH *GH, const int *retval) { - ONE_FORTSTRING_CREATE(group_name) - *ierr = CCTK_EnableGroupComm(GH, group_name); - free(group_name); + *ierr = CCTK_Abort (GH, *retval); } -void CCTK_FCALL CCTK_FNAME(CCTK_DisableGroupComm)(int *ierr, cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG) { - ONE_FORTSTRING_CREATE(group_name) - *ierr = CCTK_DisableGroupComm(GH, group_name); - free(group_name); + ONE_FORTSTRING_CREATE (group_name) + *ierr = CCTK_SyncGroup (GH, group_name); + free (group_name); } -void CCTK_FCALL CCTK_FNAME(CCTK_EnableGroupStorage)(int *ierr, cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG) { - ONE_FORTSTRING_CREATE(group_name) - *ierr = CCTK_EnableGroupStorage(GH, group_name); - free(group_name); + ONE_FORTSTRING_CREATE (group_name) + *ierr = CCTK_EnableGroupComm (GH, group_name); + free (group_name); } -void CCTK_FCALL CCTK_FNAME(CCTK_DisableGroupStorage)(int *ierr, cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG) { - ONE_FORTSTRING_CREATE(group_name) - *ierr = CCTK_DisableGroupStorage(GH, group_name); - free(group_name); + ONE_FORTSTRING_CREATE (group_name) + *ierr = CCTK_DisableGroupComm (GH, group_name); + free (group_name); } -int CCTK_FCALL CCTK_FNAME(CCTK_nProcs)(const cGH *GH) +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG) { - return CCTK_nProcs(GH); + ONE_FORTSTRING_CREATE (group_name) + *ierr = CCTK_EnableGroupStorage (GH, group_name); + free (group_name); } - -int CCTK_FCALL CCTK_FNAME(CCTK_MyProc)(const cGH *GH) -{ - return CCTK_MyProc(GH); -} - -int CCTK_FCALL CCTK_FNAME(CCTK_Barrier)(const cGH *GH) + +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierr, cGH *GH, ONE_FORTSTRING_ARG) { - return CCTK_Barrier(GH); + ONE_FORTSTRING_CREATE (group_name) + *ierr = CCTK_DisableGroupStorage (GH, group_name); + free (group_name); } - diff --git a/src/include/CommOverloadables.h b/src/include/CommOverloadables.h index a4b2c604..96d9741a 100644 --- a/src/include/CommOverloadables.h +++ b/src/include/CommOverloadables.h @@ -70,19 +70,19 @@ OVERLOADABLE(Abort) OVERLOADABLE(SetupGH) #undef ARGUMENTS -#define ARGUMENTS cGH *GH, int dir, int group, const char *groupname +#define ARGUMENTS const cGH *GH, int dir, int group, const char *groupname #undef RETURN_TYPE #define RETURN_TYPE const int * OVERLOADABLE(ArrayGroupSizeB) #undef ARGUMENTS -#define ARGUMENTS cGH *GH, int group, const char *groupname +#define ARGUMENTS const cGH *GH, int group, const char *groupname #undef RETURN_TYPE #define RETURN_TYPE int OVERLOADABLE(QueryGroupStorageB) #undef ARGUMENTS -#define ARGUMENTS cGH *GH, int group, cGroupDynamicData *data +#define ARGUMENTS const cGH *GH, int group, cGroupDynamicData *data #undef RETURN_TYPE #define RETURN_TYPE int OVERLOADABLE(GroupDynamicData) diff --git a/src/include/IOOverloadables.h b/src/include/IOOverloadables.h index ee838f07..cbdbcfea 100644 --- a/src/include/IOOverloadables.h +++ b/src/include/IOOverloadables.h @@ -2,11 +2,11 @@ @header IOOverloadables.h @date Thu Feb 4 09:59:34 1999 @author Tom Goodale - @desc - The overloadable functions for the IO layer. - See OverloadMacros.h to see how to use these. - @enddesc - @version $Header$ + @desc + The overloadable functions for the IO layer. + See OverloadMacros.h to see how to use these. + @enddesc + @version $Header$ @@*/ #ifdef OVERLOADABLE_CALL @@ -34,11 +34,11 @@ #endif #define RETURN_TYPE int -#define ARGUMENTS cGH *GH +#define ARGUMENTS const cGH *GH OVERLOADABLE(OutputGH) #undef ARGUMENTS -#define ARGUMENTS cGH *GH, \ +#define ARGUMENTS const cGH *GH, \ const char *var, \ const char *method, \ const char *alias diff --git a/src/include/cctk_Comm.h b/src/include/cctk_Comm.h index d0cc6eff..d2c839b5 100644 --- a/src/include/cctk_Comm.h +++ b/src/include/cctk_Comm.h @@ -2,20 +2,22 @@ @header cctk_Comm.h @date Sat Feb 13 19:42:29 1999 @author Tom Goodale - @desc - Header defining the variables holding the overloaded communication functions - @enddesc - @version $Header$ + @desc + Header defining the variables holding the overloaded + communication functions + @enddesc + @version $Header$ @@*/ #ifndef _CCTK_COMM_H_ -#define _CCTK_COMM_H_ +#define _CCTK_COMM_H_ 1 #include "OverloadMacros.h" #ifdef __cplusplus extern "C" { #endif + /* Define the prototypes for the functions. */ #define OVERLOADABLE(name) OVERLOADABLE_PROTOTYPE(name) @@ -30,17 +32,13 @@ extern "C" { #undef OVERLOADABLE -int CCTK_QueryGroupStorage(cGH *,const char *); -int CCTK_QueryGroupStorageI(cGH *,int); -const int *CCTK_ArrayGroupSize(cGH *,int, const char *); -const int *CCTK_ArrayGroupSizeI(cGH *,int,int); +int CCTK_QueryGroupStorage (const cGH *GH, const char *groupname); +int CCTK_QueryGroupStorageI (const cGH *GH, int groupindex); +const int *CCTK_ArrayGroupSize (const cGH *GH, int dir, const char *groupname); +const int *CCTK_ArrayGroupSizeI (const cGH *GH, int dir, int groupindex); #ifdef __cplusplus } #endif -#endif - - - - +#endif /* _CCTK_COMM_H_ */ diff --git a/src/include/cctk_Flesh.h b/src/include/cctk_Flesh.h index 5aac1a5d..733b2cc1 100644 --- a/src/include/cctk_Flesh.h +++ b/src/include/cctk_Flesh.h @@ -56,7 +56,7 @@ int CCTKi_ProcessParameterDatabase(tFleshConfig *ConfigData); int CCTKi_CallStartupFunctions(tFleshConfig *ConfigData); -int CCTKi_AddGH(tFleshConfig *config, int convergence_level, cGH *GH); +int CCTKi_AddGH(tFleshConfig *config, unsigned int convergence_level, cGH *GH); int CCTKi_InitialiseCactus(int *argc, char ***argv, tFleshConfig *ConfigData); diff --git a/src/include/cctk_GroupsOnGH.h b/src/include/cctk_GroupsOnGH.h index c6449ff5..9f9158a9 100644 --- a/src/include/cctk_GroupsOnGH.h +++ b/src/include/cctk_GroupsOnGH.h @@ -37,35 +37,35 @@ int CCTK_DisableGroupCommI(void *GH, int group); int CCTK_EnableGroupStorageI(void *GH, int group); int CCTK_EnableGroupCommI(void *GH, int group); -int CCTK_GrouplbndGN(cGH *GH, int dim, int *lbnd, const char *groupname); -int CCTK_GrouplbndVN(cGH *GH, int dim, int *lbnd, const char *varname); -int CCTK_GrouplbndGI(cGH *GH, int dim, int *lbnd, int groupindex); -int CCTK_GrouplbndVI(cGH *GH, int dim, int *lbnd, int varindex); +int CCTK_GrouplbndGN(const cGH *GH, int dim, int *lbnd, const char *groupname); +int CCTK_GrouplbndVN(const cGH *GH, int dim, int *lbnd, const char *varname); +int CCTK_GrouplbndGI(const cGH *GH, int dim, int *lbnd, int groupindex); +int CCTK_GrouplbndVI(const cGH *GH, int dim, int *lbnd, int varindex); -int CCTK_GroupubndGN(cGH *GH, int dim, int *ubnd, const char *groupname); -int CCTK_GroupubndVN(cGH *GH, int dim, int *ubnd, const char *varname); -int CCTK_GroupubndGI(cGH *GH, int dim, int *ubnd, int groupindex); -int CCTK_GroupubndVI(cGH *GH, int dim, int *ubnd, int varindex); +int CCTK_GroupubndGN(const cGH *GH, int dim, int *ubnd, const char *groupname); +int CCTK_GroupubndVN(const cGH *GH, int dim, int *ubnd, const char *varname); +int CCTK_GroupubndGI(const cGH *GH, int dim, int *ubnd, int groupindex); +int CCTK_GroupubndVI(const cGH *GH, int dim, int *ubnd, int varindex); -int CCTK_GrouplshGN(cGH *GH, int dim, int *lsh, const char *groupname); -int CCTK_GrouplshVN(cGH *GH, int dim, int *lsh, const char *varname); -int CCTK_GrouplshGI(cGH *GH, int dim, int *lsh, int groupindex); -int CCTK_GrouplshVI(cGH *GH, int dim, int *lsh, int varindex); +int CCTK_GrouplshGN(const cGH *GH, int dim, int *lsh, const char *groupname); +int CCTK_GrouplshVN(const cGH *GH, int dim, int *lsh, const char *varname); +int CCTK_GrouplshGI(const cGH *GH, int dim, int *lsh, int groupindex); +int CCTK_GrouplshVI(const cGH *GH, int dim, int *lsh, int varindex); -int CCTK_GroupgshGN(cGH *GH, int dim, int *gsh, const char *groupname); -int CCTK_GroupgshVN(cGH *GH, int dim, int *gsh, const char *varname); -int CCTK_GroupgshGI(cGH *GH, int dim, int *gsh, int groupindex); -int CCTK_GroupgshVI(cGH *GH, int dim, int *gsh, int varindex); +int CCTK_GroupgshGN(const cGH *GH, int dim, int *gsh, const char *groupname); +int CCTK_GroupgshVN(const cGH *GH, int dim, int *gsh, const char *varname); +int CCTK_GroupgshGI(const cGH *GH, int dim, int *gsh, int groupindex); +int CCTK_GroupgshVI(const cGH *GH, int dim, int *gsh, int varindex); -int CCTK_GroupbboxGI(cGH *cctkGH, int size, int *bbox, int groupindex); -int CCTK_GroupbboxGN(cGH *cctkGH, int size, int *bbox, const char *groupname); -int CCTK_GroupbboxVI(cGH *cctkGH, int size, int *bbox, int varindex); -int CCTK_GroupbboxVN(cGH *cctkGH, int size, int *bbox, const char *varname); +int CCTK_GroupbboxGI(const cGH *cctkGH, int size, int *bbox, int groupindex); +int CCTK_GroupbboxGN(const cGH *cctkGH, int size, int *bbox, const char *groupname); +int CCTK_GroupbboxVI(const cGH *cctkGH, int size, int *bbox, int varindex); +int CCTK_GroupbboxVN(const cGH *cctkGH, int size, int *bbox, const char *varname); -int CCTK_GroupnghostzonesGN(cGH *GH, int dim, int *nghostzones, const char *groupname); -int CCTK_GroupnghostzonesVN(cGH *GH, int dim, int *nghostzones, const char *varname); -int CCTK_GroupnghostzonesGI(cGH *GH, int dim, int *nghostzones, int groupindex); -int CCTK_GroupnghostzonesVI(cGH *GH, int dim, int *nghostzones, int varindex); +int CCTK_GroupnghostzonesGN(const cGH *GH, int dim, int *nghostzones, const char *groupname); +int CCTK_GroupnghostzonesVN(const cGH *GH, int dim, int *nghostzones, const char *varname); +int CCTK_GroupnghostzonesGI(const cGH *GH, int dim, int *nghostzones, int groupindex); +int CCTK_GroupnghostzonesVI(const cGH *GH, int dim, int *nghostzones, int varindex); #ifdef __cplusplus } diff --git a/src/include/cctk_IO.h b/src/include/cctk_IO.h index 10cfcd23..fbabb0d3 100644 --- a/src/include/cctk_IO.h +++ b/src/include/cctk_IO.h @@ -1,15 +1,16 @@ /*@@ @header cctk_IO.h - @date + @date 1999/07/22 @author Tom Goodale - @desc - Header defining the variables holding the overloaded communication functions - @enddesc - @version $Header$ + @desc + Header defining the variables holding the overloaded + communication functions + @enddesc + @version $Header$ @@*/ #ifndef _CCTK_IO_H_ -#define _CCTK_IO_H_ +#define _CCTK_IO_H_ 1 #include "OverloadMacros.h" @@ -32,16 +33,12 @@ extern "C" { #undef OVERLOADABLE -int CCTK_OutputVarAs (cGH *GH, const char *var, const char *alias); -int CCTK_OutputVar (cGH *GH, const char *var); -int CCTK_OutputVarByMethod (cGH *GH, const char *var, const char *method); +int CCTK_OutputVarAs (const cGH *GH, const char *var, const char *alias); +int CCTK_OutputVar (const cGH *GH, const char *var); +int CCTK_OutputVarByMethod (const cGH *GH, const char *var, const char *method); #ifdef __cplusplus } #endif #endif - - - - diff --git a/src/include/cctk_IOMethods.h b/src/include/cctk_IOMethods.h index 1420a230..1d4aef77 100644 --- a/src/include/cctk_IOMethods.h +++ b/src/include/cctk_IOMethods.h @@ -18,30 +18,31 @@ extern "C" { struct IOMethod { const char *implementation; - int (*OutputGH)(cGH *); - int (*OutputVarAs)(cGH *, const char *, const char *); - int (*TriggerOutput)(cGH *, int); - int (*TimeToOutput)(cGH *,int); + int (*OutputGH) (const cGH *GH); + int (*OutputVarAs) (const cGH *GH, const char *vname, const char *alias); + int (*TriggerOutput) (const cGH *GH, int vindex); + int (*TimeToOutput) (const cGH *GH, int vindex); }; -#define CCTK_RegisterIOMethod(a) CCTKi_RegisterIOMethod(CCTK_THORNSTRING, a) -int CCTKi_RegisterIOMethod(const char *thorn, const char *name); - -int CCTK_RegisterIOMethodOutputGH(int handle, int (*func)(cGH *)); - -int CCTK_RegisterIOMethodTimeToOutput(int handle, int (*func)(cGH *, int)); - -int CCTK_RegisterIOMethodTriggerOutput(int handle, int (*func)(cGH *, int)); - -int CCTK_RegisterIOMethodOutputVarAs(int handle, int (*func)(cGH *, - const char *,const char *)); - -const char *CCTK_IOMethodImplementation(int handle); - -int CCTK_NumIOMethods(void); +#define CCTK_RegisterIOMethod(a) CCTKi_RegisterIOMethod (CCTK_THORNSTRING, a) +int CCTKi_RegisterIOMethod (const char *thorn, const char *name); +int CCTK_RegisterIOMethodOutputGH (int handle, int (*OutputGH) (const cGH *GH)); +int CCTK_RegisterIOMethodTimeToOutput (int handle, + int (*TimeToOutput) (const cGH *GH, + int vindex)); +int CCTK_RegisterIOMethodTriggerOutput (int handle, + int (*TriggerOutput) (const cGH *GH, + int vindex)); +int CCTK_RegisterIOMethodOutputVarAs (int handle, + int (*OutputVarAs) (const cGH *GH, + const char *vname, + const char *alias)); + +const char *CCTK_IOMethodImplementation (int handle); +int CCTK_NumIOMethods (void); #ifdef __cplusplus } #endif -#endif +#endif /* _CCTK_IOMETHODS_H_ */ diff --git a/src/main/Banner.c b/src/main/Banner.c index 90a4474d..896f9c1a 100644 --- a/src/main/Banner.c +++ b/src/main/Banner.c @@ -2,13 +2,13 @@ @file Banner.c @date July 16 00:11:26 1999 @author Gabrielle Allen - @desc - Routines to deal with the Cactus banners. - @enddesc - @version $Header$ + @desc + Routines to deal with the Cactus banners. + @enddesc + @version $Id$ @@*/ -/*#define DEBUG_BANNER*/ +/* #define DEBUG_BANNER 1 */ #include <stdio.h> #include <stdlib.h> @@ -22,6 +22,7 @@ #include "cctk_Version.h" #include "cctk_CommandLine.h" #include "util_Network.h" +#include "util_String.h" static const char *rcsid = "$Header$"; @@ -37,14 +38,10 @@ CCTK_FILEVERSION(main_Banner_c) ********************* Local Routine Prototypes ********************* ********************************************************************/ -int CCTKi_PrintBanners(void); -void CCTKi_CactusBanner(void); -void CCTK_FCALL CCTK_FNAME(CCTK_RegisterBanner) - (int *ierr,ONE_FORTSTRING_ARG); - -/******************************************************************** - ********************* Other Routine Prototypes ********************* - ********************************************************************/ +int CCTKi_PrintBanners (void); +void CCTKi_CactusBanner (void); +void CCTK_FCALL CCTK_FNAME (CCTK_RegisterBanner) + (int *ierr, ONE_FORTSTRING_ARG); /******************************************************************** ********************* Local Data ***************************** @@ -52,6 +49,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_RegisterBanner) static int number_banners = 0; static char **banner_strings = NULL; +static const char *delimiter = "--------------------------------------------------------------------------------\n"; /******************************************************************** ********************* External Routines ********************** @@ -62,52 +60,47 @@ static char **banner_strings = NULL; @routine CCTKi_CactusBanner @date Wed Oct 13 21:41:28 CEST 1999 @author Gabrielle Allen - @desc - Prints the Cactus Banner - @enddesc - @calls - @calledby - @history - - @endhistory + @desc + Prints the Cactus Banner + @enddesc + @calls CCTK_FullVersion + CCTK_CompileDate + CCTK_CompileTime + Util_CurrentDate + Util_CurrentTime + Util_GetHostName + CCTK_ParameterFilename @@*/ - -void CCTKi_CactusBanner(void) +void CCTKi_CactusBanner (void) { - - const char *string; char buffer[DATALENGTH+1]; - -#define B_1 " 10 " -#define B_2 " 1 0101 ************************ " -#define B_3 " 01 1010 10 The Cactus Code V4.0 " -#define B_4 " 1010 1101 011 www.cactuscode.org " -#define B_5 " 1001 100101 ************************ " -#define B_6 " 00010101 " -#define B_7 " 100011 (c) Copyright The Authors " -#define B_8 " 0100 GNU Licensed. No Warranty " -#define B_9 " 0101 " - -#define B_ANNERLINE B_1 "\n" B_2 "\n" B_3 "\n" B_4 "\n" B_5 "\n" B_6 "\n" B_7 "\n" B_8 "\n" B_9 "\n" - - string = B_ANNERLINE; - - printf("--------------------------------------------------------------------------------\n"); - printf("%s\n",string); - printf("--------------------------------------------------------------------------------\n"); - printf("Cactus version: %s\n",CCTK_FullVersion()); - printf("Compile date: %s (%s)\n",CCTK_CompileDate(),CCTK_CompileTime()); + const char *banner = " 10 \n" + " 1 0101 ************************ \n" + " 01 1010 10 The Cactus Code V4.0 \n" + " 1010 1101 011 www.cactuscode.org \n" + " 1001 100101 ************************ \n" + " 00010101 \n" + " 100011 (c) Copyright The Authors \n" + " 0100 GNU Licensed. No Warranty \n" + " 0101 \n"; + + + puts (delimiter); + puts (banner); + puts (delimiter); + + printf ("Cactus version: %s\n", CCTK_FullVersion ()); + printf ("Compile date: %s (%s)\n", CCTK_CompileDate (), CCTK_CompileTime()); Util_CurrentDate (DATALENGTH, buffer); - printf("Run date: %s",buffer); + printf ("Run date: %s", buffer); Util_CurrentTime (DATALENGTH, buffer); - printf(" (%s)\n",buffer); - Util_GetHostName(buffer,DATALENGTH); - printf("Run host: %s\n",buffer); - CCTK_ParameterFilename(DATALENGTH,buffer); - printf("Parameter file: %s\n",buffer); - - printf("--------------------------------------------------------------------------------\n"); + printf (" (%s)\n", buffer); + Util_GetHostName (buffer, DATALENGTH); + printf ("Run host: %s\n", buffer); + CCTK_ParameterFilename (DATALENGTH, buffer); + printf ("Parameter file: %s\n", buffer); + puts (delimiter); } @@ -115,133 +108,113 @@ void CCTKi_CactusBanner(void) @routine CCTK_RegisterBanner @date July 16 00:11:26 1999 @author Gabrielle Allen - @desc - Registers a string as a banner - @enddesc - @calls - @calledby - @history - - @endhistory - @var string - @vdesc The banner as a C string - @vtype const char * - @vio in - @vcomment - - @endvar + @desc + Registers a string as a banner + @enddesc + + @var banner + @vdesc The banner as a C string + @vtype const char * + @vio in + @endvar @returntype int @returndesc - 0 -- success + 0 for success, or -1 if memory allocation failed @endreturndesc @@*/ - -int CCTK_RegisterBanner(const char *string) +int CCTK_RegisterBanner (const char *banner) { - char **temp = NULL; - char *newstring; + int retval; + char **old_banner_strings; + + + retval = 0; number_banners++; /* Resize the array of banner strings */ if (number_banners == 1) { - banner_strings = (char **)malloc( number_banners*sizeof(char *)); - temp = banner_strings; + banner_strings = (char **) malloc (number_banners * sizeof (char *)); } else { - temp = (char **)realloc( banner_strings, number_banners*sizeof(char *)); - - if(temp) - { - banner_strings = temp; - } - else + old_banner_strings = banner_strings; + banner_strings = (char **) realloc (banner_strings, + number_banners * sizeof (char *)); + if (banner_strings == NULL) { + banner_strings = old_banner_strings; number_banners--; } } /* If this was succesful, copy the data into the array */ - if(temp) + if (banner_strings) { - newstring = (char *)malloc((strlen(string)+1)*sizeof(char)); - if(newstring) - { - strcpy(newstring, string); - banner_strings[number_banners-1] = newstring; - } - else + banner_strings[number_banners - 1] = Util_Strdup (banner); + if (banner_strings[number_banners - 1] == NULL) { number_banners--; + retval = -1; } } + else + { + retval = -1; + } #ifdef DEBUG_BANNER printf("Registering banner .... \n%s\n",banner_strings[number_banners-1]); #endif - return 0; - + return (retval); } -void CCTK_FCALL CCTK_FNAME(CCTK_RegisterBanner) - (int *ierr,ONE_FORTSTRING_ARG) + +void CCTK_FCALL CCTK_FNAME (CCTK_RegisterBanner) + (int *ierr, + ONE_FORTSTRING_ARG) { - ONE_FORTSTRING_CREATE(message) - *ierr=CCTK_RegisterBanner(message); - free(message); + ONE_FORTSTRING_CREATE (message) + *ierr = CCTK_RegisterBanner (message); + free (message); } + /*@@ @routine CCTKi_PrintBanners @date July 16 00:11:26 1999 @author Gabrielle Allen - @desc - Print all registered banners - @enddesc - @calls - @calledby - @history - - @endhistory + @desc + Print all registered banners + @enddesc + @calls CCTK_ParameterGet @returntype int @returndesc - 0 -- success + 0 -- success @endreturndesc @@*/ - -int CCTKi_PrintBanners(void) +int CCTKi_PrintBanners (void) { int i; - int param_type; - CCTK_INT *cctk_show_banners; + const CCTK_INT *cctk_show_banners; - cctk_show_banners = (CCTK_INT *)CCTK_ParameterGet("cctk_show_banners", - "Cactus",¶m_type); + cctk_show_banners = (const CCTK_INT *) + CCTK_ParameterGet ("cctk_show_banners", "Cactus", &i); if (*cctk_show_banners) { - for (i=0;i<number_banners;i++) + for (i = 0; i < number_banners; i++) { if (banner_strings[i]) { - printf("--------------------------------------------------------------------------------\n"); - printf("%s\n",banner_strings[i]); + printf ("%s%s\n", delimiter, banner_strings[i]); } } - printf("--------------------------------------------------------------------------------\n"); + puts (delimiter); } - return 0; - + return (0); } - -/******************************************************************** - ********************* Local Routines ************************* - ********************************************************************/ - - - diff --git a/src/main/CactusDefaultMainLoopIndex.c b/src/main/CactusDefaultMainLoopIndex.c index 6de38f74..29a5b683 100644 --- a/src/main/CactusDefaultMainLoopIndex.c +++ b/src/main/CactusDefaultMainLoopIndex.c @@ -3,11 +3,12 @@ @date Wed Oct 04 16:53:58 2000 @author Gabrielle Allen @desc - The default main loop index routines + The default main loop index routines @enddesc + @version $Id$ @@*/ -#include "cctk.h" +#include "cctk_Flesh.h" static const char *rcsid = "$Header$"; @@ -15,21 +16,24 @@ CCTK_FILEVERSION(main_CactusDefaultMainLoopIndex_c) static int iteration = 0; +int CactusDefaultMainLoopIndex (void); +int CactusDefaultSetMainLoopIndex (int main_loop_index); + + /*@@ @routine CactusDefaultMainLoopIndex @date Wed Oct 04 16:53:58 2000 @author Gabrielle Allen @desc - Default main loop index routine + Default main loop index routine @enddesc - @calls - @calledby - @history - - @endhistory + @returntype int + @returndesc + current value of the iteration counter + @endreturndesc @@*/ -int CactusDefaultMainLoopIndex(void) +int CactusDefaultMainLoopIndex (void) { return (iteration); } @@ -42,14 +46,15 @@ int CactusDefaultMainLoopIndex(void) @desc Sets the iteration counter variable of the evolution loop. This is used for recovery. - @enddesc - @calls - @calledby + @enddesc + @returntype int + @returndesc + value of the new iteration counter + @endreturndesc @@*/ int CactusDefaultSetMainLoopIndex (int main_loop_index) { iteration = main_loop_index; - return iteration; + return (iteration); } - diff --git a/src/main/CactusDefaultShutdown.c b/src/main/CactusDefaultShutdown.c index 69382106..024bb7f8 100644 --- a/src/main/CactusDefaultShutdown.c +++ b/src/main/CactusDefaultShutdown.c @@ -9,11 +9,9 @@ #include <stdio.h> -#include "cctk.h" - #include "cctk_Flesh.h" - #include "cctk_Comm.h" +#include "CactusMainDefaults.h" #ifdef CCTK_MPI #include "mpi.h" @@ -65,7 +63,8 @@ extern char MPI_Active; @@*/ int CactusDefaultShutdown(tFleshConfig *config) { - int myproc,conv_level; + int myproc; + unsigned int conv_level; myproc = CCTK_MyProc(config->GH[0]); diff --git a/src/main/CallStartupFunctions.c b/src/main/CallStartupFunctions.c index 48cbc592..e977cbf6 100644 --- a/src/main/CallStartupFunctions.c +++ b/src/main/CallStartupFunctions.c @@ -2,10 +2,10 @@ @file CCTKi_CallStartupFunctions.c @date Mon Sep 28 14:16:19 1998 @author Tom Goodale - @desc - Contains routines to deal with thorn startup functions. - @enddesc - @version $Header$ + @desc + Contains routines to deal with thorn startup functions. + @enddesc + @version $Id$ @@*/ #include <stdio.h> @@ -19,22 +19,6 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_CallStartupFunctions_c) /******************************************************************** - ********************* Local Data Types *********************** - ********************************************************************/ - -/******************************************************************** - ********************* Local Routine Prototypes ********************* - ********************************************************************/ - -/******************************************************************** - ********************* Other Routine Prototypes ********************* - ********************************************************************/ - -/******************************************************************** - ********************* Local Data ***************************** - ********************************************************************/ - -/******************************************************************** ********************* External Routines ********************** ********************************************************************/ @@ -42,37 +26,28 @@ CCTK_FILEVERSION(main_CallStartupFunctions_c) @routine CCTKi_CallStartupFunctions @date Mon Sep 28 14:24:39 1998 @author Tom Goodale - @desc - - @enddesc - @calls CCTK_ScheduleTraverse - @calledby - @history - - @endhistory - @var ConfigData - @vdesc Flesh configuration data - @vtype tFleshConfig - @vio in - @vcomment - - @endvar + @desc + Calls CCTK_ScheduleTraverse() on "CCTK_STARTUP" + @enddesc + @calls CCTK_ScheduleTraverse + + @var ConfigData + @vdesc Flesh configuration data + @vtype tFleshConfig * + @vio in + @endvar @returntype int @returndesc - 0 - success + 0 - success @endreturndesc @@*/ -int CCTKi_CallStartupFunctions(tFleshConfig *ConfigData) +int CCTKi_CallStartupFunctions (tFleshConfig *ConfigData) { + ConfigData = ConfigData; - CCTK_ScheduleTraverse("CCTK_STARTUP", NULL, NULL); + CCTK_ScheduleTraverse ("CCTK_STARTUP", NULL, NULL); - return 0; + return (0); } - -/******************************************************************** - ********************* Local Routines ************************* - ********************************************************************/ - diff --git a/src/main/ConfigData.c b/src/main/ConfigData.c index ec0fb572..8534acac 100644 --- a/src/main/ConfigData.c +++ b/src/main/ConfigData.c @@ -2,10 +2,10 @@ @file ConfigData.c @date Fri Jan 15 13:27:50 1999 @author Tom Goodale - @desc - Miscellaneous routines to deal with configuration data + @desc + Miscellaneous routines to deal with configuration data @enddesc - @version $Header$ + @version $Id$ @@*/ #include <stdio.h> @@ -17,74 +17,45 @@ static const 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 @author Tom Goodale @desc - Adds a GH to the config_data structure at a particular convergence level. + Adds a GH to the config_data structure at a particular + convergence level. @enddesc - @calls - @calledby - @history - - @endhistory - @var config - @vdesc Flesh config data - @vtype tFleshConfig - @vio in - @vcomment + @var config + @vdesc Flesh config data + @vtype tFleshConfig * + @vio in @endvar - @var convergence_level - @vdesc The convergence level - @vtype int - @vio in - @vcomment - + @var convergence_level + @vdesc The convergence level + @vtype unsigned int + @vio in @endvar - @var GH - @vdesc the cctk GH - @vtype cGH * - @vio in - @vcomment - + @var GH + @vdesc the cctk GH + @vtype cGH * + @vio in @endvar @returntype int @returndesc - 0 - success - 1 - memory failure - 2 - duplicate convergence level + 0 - success + 1 - memory failure + 2 - duplicate convergence level @endreturndesc @@*/ -int CCTKi_AddGH(tFleshConfig *config, int convergence_level, cGH *GH) +int CCTKi_AddGH (tFleshConfig *config, unsigned int convergence_level, cGH *GH) { int retval; - + unsigned int i; cGH **temp; - int i; retval = 0; @@ -117,10 +88,5 @@ int CCTKi_AddGH(tFleshConfig *config, int convergence_level, cGH *GH) retval = 2; } - return retval; + return (retval); } - -/******************************************************************** - ********************* Local Routines ************************* - ********************************************************************/ - diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c index 33779192..bc6dcba6 100644 --- a/src/main/GroupsOnGH.c +++ b/src/main/GroupsOnGH.c @@ -28,145 +28,145 @@ CCTK_FILEVERSION(main_GroupsOnGH_c) void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG); @@ -486,22 +486,22 @@ int CCTK_DisableGroupStorageI(void *GH, int group) } -const int *CCTK_ArrayGroupSizeI(cGH *GH, int dir, int groupi) +const int *CCTK_ArrayGroupSizeI(const cGH *GH, int dir, int groupi) { return CCTK_ArrayGroupSizeB(GH,dir,groupi,NULL); } -const int *CCTK_ArrayGroupSize(cGH *GH, int dir, const char *groupn) +const int *CCTK_ArrayGroupSize(const cGH *GH, int dir, const char *groupn) { return CCTK_ArrayGroupSizeB(GH,dir,-1,groupn); } -int CCTK_QueryGroupStorageI(cGH *GH, int groupi) +int CCTK_QueryGroupStorageI(const cGH *GH, int groupi) { return CCTK_QueryGroupStorageB(GH,groupi,NULL); } -int CCTK_QueryGroupStorage(cGH *GH, const char *groupn) +int CCTK_QueryGroupStorage(const cGH *GH, const char *groupn) { return CCTK_QueryGroupStorageB(GH, -1, groupn); } @@ -525,7 +525,7 @@ int CCTK_QueryGroupStorage(cGH *GH, const char *groupn) @@*/ -int CCTK_GrouplbndGI(cGH *cctkGH, +int CCTK_GrouplbndGI(const cGH *cctkGH, int dim, int *lbnd, int groupindex) @@ -570,7 +570,7 @@ int CCTK_GrouplbndGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, const int *groupindex) @@ -580,7 +580,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGI) -int CCTK_GrouplbndGN(cGH *cctkGH, +int CCTK_GrouplbndGN(const cGH *cctkGH, int dim, int *lbnd, const char *groupname) @@ -604,7 +604,7 @@ int CCTK_GrouplbndGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG) @@ -616,7 +616,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGN) -int CCTK_GrouplbndVI(cGH *cctkGH, +int CCTK_GrouplbndVI(const cGH *cctkGH, int dim, int *lbnd, int varindex) @@ -641,7 +641,7 @@ int CCTK_GrouplbndVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, const int *varindex) @@ -651,7 +651,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVI) -int CCTK_GrouplbndVN(cGH *cctkGH, +int CCTK_GrouplbndVN(const cGH *cctkGH, int dim, int *lbnd, const char *varname) @@ -675,7 +675,7 @@ int CCTK_GrouplbndVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG) @@ -706,7 +706,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVN) @@*/ -int CCTK_GroupubndGI(cGH *cctkGH, +int CCTK_GroupubndGI(const cGH *cctkGH, int dim, int *ubnd, int groupindex) @@ -752,7 +752,7 @@ int CCTK_GroupubndGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, const int *groupindex) @@ -762,7 +762,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGI) -int CCTK_GroupubndGN(cGH *cctkGH, +int CCTK_GroupubndGN(const cGH *cctkGH, int dim, int *ubnd, const char *groupname) @@ -786,7 +786,7 @@ int CCTK_GroupubndGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG) @@ -798,7 +798,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGN) -int CCTK_GroupubndVI(cGH *cctkGH, +int CCTK_GroupubndVI(const cGH *cctkGH, int dim, int *ubnd, int varindex) @@ -823,7 +823,7 @@ int CCTK_GroupubndVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, const int *varindex) @@ -833,7 +833,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVI) -int CCTK_GroupubndVN(cGH *cctkGH, +int CCTK_GroupubndVN(const cGH *cctkGH, int dim, int *ubnd, const char *varname) @@ -857,7 +857,7 @@ int CCTK_GroupubndVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG) @@ -888,7 +888,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVN) @@*/ -int CCTK_GrouplshGI(cGH *cctkGH, +int CCTK_GrouplshGI(const cGH *cctkGH, int dim, int *lsh, int groupindex) @@ -934,7 +934,7 @@ int CCTK_GrouplshGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, const int *groupindex) @@ -944,7 +944,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGI) -int CCTK_GrouplshGN(cGH *cctkGH, +int CCTK_GrouplshGN(const cGH *cctkGH, int dim, int *lsh, const char *groupname) @@ -968,7 +968,7 @@ int CCTK_GrouplshGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG) @@ -980,7 +980,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGN) -int CCTK_GrouplshVI(cGH *cctkGH, +int CCTK_GrouplshVI(const cGH *cctkGH, int dim, int *lsh, int varindex) @@ -1005,7 +1005,7 @@ int CCTK_GrouplshVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, const int *varindex) @@ -1015,7 +1015,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVI) -int CCTK_GrouplshVN(cGH *cctkGH, +int CCTK_GrouplshVN(const cGH *cctkGH, int dim, int *lsh, const char *varname) @@ -1039,7 +1039,7 @@ int CCTK_GrouplshVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG) @@ -1070,7 +1070,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) @@*/ -int CCTK_GroupgshGI(cGH *cctkGH, +int CCTK_GroupgshGI(const cGH *cctkGH, int dim, int *gsh, int groupindex) @@ -1116,7 +1116,7 @@ int CCTK_GroupgshGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, const int *groupindex) @@ -1126,7 +1126,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) -int CCTK_GroupgshGN(cGH *cctkGH, +int CCTK_GroupgshGN(const cGH *cctkGH, int dim, int *gsh, const char *groupname) @@ -1150,7 +1150,7 @@ int CCTK_GroupgshGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG) @@ -1162,7 +1162,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGN) -int CCTK_GroupgshVI(cGH *cctkGH, +int CCTK_GroupgshVI(const cGH *cctkGH, int dim, int *gsh, int varindex) @@ -1187,7 +1187,7 @@ int CCTK_GroupgshVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, const int *varindex) @@ -1197,7 +1197,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVI) -int CCTK_GroupgshVN(cGH *cctkGH, +int CCTK_GroupgshVN(const cGH *cctkGH, int dim, int *gsh, const char *varname) @@ -1221,7 +1221,7 @@ int CCTK_GroupgshVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG) @@ -1252,7 +1252,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVN) @@*/ -int CCTK_GroupnghostzonesGI(cGH *cctkGH, +int CCTK_GroupnghostzonesGI(const cGH *cctkGH, int dim, int *nghostzones, int groupindex) @@ -1299,7 +1299,7 @@ int CCTK_GroupnghostzonesGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, const int *groupindex) @@ -1309,7 +1309,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGI) -int CCTK_GroupnghostzonesGN(cGH *cctkGH, +int CCTK_GroupnghostzonesGN(const cGH *cctkGH, int dim, int *nghostzones, const char *groupname) @@ -1333,7 +1333,7 @@ int CCTK_GroupnghostzonesGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG) @@ -1345,7 +1345,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGN) -int CCTK_GroupnghostzonesVI(cGH *cctkGH, +int CCTK_GroupnghostzonesVI(const cGH *cctkGH, int dim, int *nghostzones, int varindex) @@ -1370,7 +1370,7 @@ int CCTK_GroupnghostzonesVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, const int *varindex) @@ -1380,7 +1380,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVI) -int CCTK_GroupnghostzonesVN(cGH *cctkGH, +int CCTK_GroupnghostzonesVN(const cGH *cctkGH, int dim, int *nghostzones, const char *varname) @@ -1404,7 +1404,7 @@ int CCTK_GroupnghostzonesVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG) @@ -1434,7 +1434,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVN) @@*/ -int CCTK_GroupbboxGI(cGH *cctkGH, +int CCTK_GroupbboxGI(const cGH *cctkGH, int size, int *bbox, int groupindex) @@ -1480,7 +1480,7 @@ int CCTK_GroupbboxGI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, const int *groupindex) @@ -1490,7 +1490,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGI) -int CCTK_GroupbboxGN(cGH *cctkGH, +int CCTK_GroupbboxGN(const cGH *cctkGH, int size, int *bbox, const char *groupname) @@ -1514,7 +1514,7 @@ int CCTK_GroupbboxGN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG) @@ -1526,7 +1526,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGN) -int CCTK_GroupbboxVI(cGH *cctkGH, +int CCTK_GroupbboxVI(const cGH *cctkGH, int size, int *bbox, int varindex) @@ -1551,7 +1551,7 @@ int CCTK_GroupbboxVI(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVI) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, const int *varindex) @@ -1561,7 +1561,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVI) -int CCTK_GroupbboxVN(cGH *cctkGH, +int CCTK_GroupbboxVN(const cGH *cctkGH, int size, int *bbox, const char *varname) @@ -1585,7 +1585,7 @@ int CCTK_GroupbboxVN(cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVN) (int *ierr, - cGH *cctkGH, + const cGH *cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG) diff --git a/src/main/InitialiseCactus.c b/src/main/InitialiseCactus.c index efb69cb9..1713d50d 100644 --- a/src/main/InitialiseCactus.c +++ b/src/main/InitialiseCactus.c @@ -3,9 +3,9 @@ @date Fri Sep 18 14:04:02 1998 @author Tom Goodale @desc - Responsible for doing any cactus specific initialisations + Responsible for doing any cactus specific initialisations @enddesc - @version $Header$ + @version $Id$ @@*/ #include <stdio.h> @@ -16,6 +16,7 @@ #include "cctk_Parameter.h" #include "cctk_Schedule.h" #include "cctk_WarnLevel.h" +#include "cctk_Misc.h" #include "cctki_Banner.h" #include "cctki_Bindings.h" @@ -34,18 +35,19 @@ CCTK_FILEVERSION(main_InitialiseCactus_c) ********************* Local Routine Prototypes ********************* ********************************************************************/ -static int CCTKi_InitialiseScheduler(tFleshConfig *ConfigData); +static int CCTKi_InitialiseScheduler (tFleshConfig *ConfigData); /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ -int CCTKi_InitialiseSubsystemDefaults(void); -int CCTKi_ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData); -int CCTKi_BindingsParameterRecoveryInitialise(void); +int CCTKBindings_RegisterThornFunctions (void); +int CCTKi_InitialiseSubsystemDefaults (void); +int CCTKi_ProcessEnvironment (int *argc, char ***argv,tFleshConfig *ConfigData); +int CCTKi_BindingsParameterRecoveryInitialise (void); -int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData); -int CCTKi_ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData); +int CCTKi_ProcessCommandLine (int *inargc, char ***inargv, tFleshConfig *ConfigData); +int CCTKi_ProcessEnvironment (int *argc, char ***argv,tFleshConfig *ConfigData); /******************************************************************** ********************* Local Data ***************************** @@ -67,65 +69,65 @@ static time_t startuptime; @desc @enddesc - @calls CCTKi_InitialiseSubsystemDefaults CCTKi_ProcessEnvironment CCTKi_ProcessCommandLine CCTKi_CactusBanner CCTKi_InitialiseDataStructures CCTKi_ProcessParameterDatabase CCTKi_BindingsVariablesInitialise CCTKi_InitialiseScheduler CCTKi_CallStartupFunctions CCTKi_PrintBanners - @calledby main - @history + @calls CCTKi_InitialiseSubsystemDefaults + CCTKi_ProcessEnvironment + CCTKi_ProcessCommandLine + CCTKi_CactusBanner + CCTKi_InitialiseDataStructures + CCTKi_ProcessParameterDatabase + CCTKi_BindingsVariablesInitialise + CCTKi_InitialiseScheduler + CCTKi_CallStartupFunctions + CCTKi_PrintBanners - @endhistory - @var argc - @vdesc The number of command line arguments - @vtype int * - @vio inout - @vcomment - + @var argc + @vdesc The number of command line arguments + @vtype int * + @vio inout @endvar - @var argv - @vdesc The command line arguments - @vtype char ** - @vio inout - @vcomment - + @var argv + @vdesc The command line arguments + @vtype char *** + @vio inout @endvar - @var ConfigData - @vdesc Flesh configuration data - @vtype tFleshConfig - @vio inout - @vcomment - + @var ConfigData + @vdesc Flesh configuration data + @vtype tFleshConfig * + @vio inout @endvar @returntype int @returndesc - 0 - success + 0 - success @endreturndesc @@*/ -int CCTKi_InitialiseCactus(int *argc, char ***argv, tFleshConfig *ConfigData) +int CCTKi_InitialiseCactus (int *argc, char ***argv, tFleshConfig *ConfigData) { - startuptime = time(NULL); + startuptime = time (NULL); - CCTKi_InitialiseSubsystemDefaults(); + CCTKi_InitialiseSubsystemDefaults (); - CCTKi_ProcessEnvironment(argc, argv, ConfigData); + CCTKi_ProcessEnvironment (argc, argv, ConfigData); - CCTKi_ProcessCommandLine(argc, argv, ConfigData); + CCTKi_ProcessCommandLine (argc, argv, ConfigData); - CCTKi_CactusBanner(); + CCTKi_CactusBanner (); - CCTKi_InitialiseDataStructures(ConfigData); + CCTKi_InitialiseDataStructures (ConfigData); - CCTKi_ProcessParameterDatabase(ConfigData); + CCTKi_ProcessParameterDatabase (ConfigData); - CCTKi_BindingsVariablesInitialise(); + CCTKi_BindingsVariablesInitialise (); - CCTKBindings_RegisterThornFunctions(); + CCTKBindings_RegisterThornFunctions (); - CCTKi_InitialiseScheduler(ConfigData); + CCTKi_InitialiseScheduler (ConfigData); - CCTKi_CallStartupFunctions(ConfigData); + CCTKi_CallStartupFunctions (ConfigData); - CCTKi_PrintBanners(); + CCTKi_PrintBanners (); - return 0; + return (0); } /******************************************************************** @@ -137,55 +139,59 @@ int CCTKi_InitialiseCactus(int *argc, char ***argv, tFleshConfig *ConfigData) @date Fri Sep 17 19:34:55 1999 @author Tom Goodale @desc - Initialise all scheduled items + Initialise all scheduled items @enddesc - @calls CCTKi_SetParameterSetMask CCTKi_BindingsParameterRecoveryInitialise CCTKi_BindingsScheduleInitialise CCTKi_DoScheduleSortAllGroups CCTK_SchedulePrint - @calledby - @history - - @endhistory - @var ConfigData - @vdesc Flesh configuration data - @vtype tFleshConfig - @vio in - @vcomment - + @calls CCTKi_SetParameterSetMask + CCTKi_BindingsParameterRecoveryInitialise + CCTKi_BindingsScheduleInitialise + CCTKi_DoScheduleSortAllGroups + CCTK_SchedulePrint + + @var ConfigData + @vdesc Flesh configuration data + @vtype tFleshConfig * + @vio unused @endvar @returntype int @returndesc - 0 - success + 0 - success @endreturndesc @@*/ - -static int CCTKi_InitialiseScheduler(tFleshConfig *ConfigData) +static int CCTKi_InitialiseScheduler (tFleshConfig *ConfigData) { - int retcode; - int param_type; - int cctk_show_schedule; - extern void CCTKi_SetParameterSetMask(int mask); + int i, retcode; + const CCTK_INT *cctk_show_schedule; + extern void CCTKi_SetParameterSetMask (int mask); + - CCTKi_SetParameterSetMask(PARAMETER_RECOVERY_IN); + /* avoid compiler warning about unused arguments */ + ConfigData = ConfigData; - if(CCTKi_BindingsParameterRecoveryInitialise() < 0) - CCTK_Warn(0,__LINE__,__FILE__,"Cactus","Failed to recover parameters"); + CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_IN); - CCTKi_SetParameterSetMask(PARAMETER_RECOVERY_POST); + if (CCTKi_BindingsParameterRecoveryInitialise () < 0) + { + CCTK_Warn (0, __LINE__, __FILE__, "Cactus", "Failed to recover parameters"); + } - CCTKi_BindingsScheduleInitialise(); + CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_POST); - retcode = CCTKi_DoScheduleSortAllGroups(); + CCTKi_BindingsScheduleInitialise (); - cctk_show_schedule = *((CCTK_INT *)CCTK_ParameterGet("cctk_show_schedule","Cactus",¶m_type)); + retcode = CCTKi_DoScheduleSortAllGroups (); - if (cctk_show_schedule) + cctk_show_schedule = (const CCTK_INT *) + CCTK_ParameterGet ("cctk_show_schedule", "Cactus", &i); + + if (*cctk_show_schedule) { CCTK_PRINTSEPARATOR - CCTK_SchedulePrint(NULL); + CCTK_SchedulePrint (NULL); CCTK_PRINTSEPARATOR } - return retcode; + return (retcode); } @@ -194,28 +200,15 @@ static int CCTKi_InitialiseScheduler(tFleshConfig *ConfigData) @date Tue Oct 3 2000 @author Gabrielle Allen @desc - Seconds since startup + Seconds since startup @enddesc - @calls - @calledby - @history - - @endhistory @returntype int @returndesc - The number of seconds since the run started. + The number of seconds since the run started. @endreturndesc @@*/ - -int CCTK_RunTime(void) +int CCTK_RunTime (void) { - int retval; - time_t currenttime; - - currenttime = time(NULL); - - retval = (int)(currenttime-startuptime); - - return retval; + return ((int) (time (NULL) - startuptime)); } diff --git a/src/main/OverloadMain.c b/src/main/OverloadMain.c index 7bf038c9..5d1d1aa9 100644 --- a/src/main/OverloadMain.c +++ b/src/main/OverloadMain.c @@ -16,6 +16,7 @@ #include "cctk_Flesh.h" #include "cctk_WarnLevel.h" +#include "CactusRegister.h" #include "OverloadMacros.h" static const char *rcsid="$Header$"; diff --git a/src/main/ProcessEnvironment.c b/src/main/ProcessEnvironment.c index 8e561189..c6e7e272 100644 --- a/src/main/ProcessEnvironment.c +++ b/src/main/ProcessEnvironment.c @@ -32,6 +32,7 @@ CCTK_FILEVERSION(main_ProcessEnvironment_c) /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ +int CCTKi_ProcessEnvironment (int *argc, char ***argv,tFleshConfig *ConfigData); /******************************************************************** ********************* Local Data ***************************** @@ -110,6 +111,8 @@ char MPI_Active = 0; @@*/ int CCTKi_ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData) { + /* avoid compiler warning about unused argument */ + ConfigData = ConfigData; /* Check if MPI compiled in but choosing not to use MPI. */ diff --git a/src/main/SetParams.c b/src/main/SetParams.c index 5574b7fb..5facd328 100644 --- a/src/main/SetParams.c +++ b/src/main/SetParams.c @@ -90,9 +90,11 @@ static int ReallySetParameter(const char *parameter, int CCTKi_SetParameter(const char *parameter, const char *value) { int retval; +#if 0 char thornname[101]; const char *position; int length; +#endif int n_errors; int parameter_check; @@ -266,6 +268,9 @@ static int ReallySetParameter(const char *parameter, const char *value) char *param; char *imp; + + retval = 0; + Util_SplitString(&imp, ¶m, parameter, "::"); if (!param) diff --git a/src/main/SetupCache.c b/src/main/SetupCache.c index f0bd427c..e380f283 100644 --- a/src/main/SetupCache.c +++ b/src/main/SetupCache.c @@ -3,16 +3,14 @@ @date Tue Nov 30 10:30:09 1999 @author Tom Goodale @desc - Sets up cache stuff for the CCTK + Sets up cache stuff for the CCTK @enddesc - @version $Header$ + @version $Id$ @@*/ -#include <stdlib.h> - #include "cctk_Config.h" #include "cctk_Flesh.h" -#include "cctk_Parameter.h" +#include "cctk_Parameters.h" #include "cctki_Cache.h" @@ -29,37 +27,26 @@ CCTK_FILEVERSION(main_SetupCache_c) @date Tue Nov 30 10:50:02 1999 @author Tom Goodale @desc - Sets the cache information. + Sets the cache information. @enddesc - @calls - @calledby - @history - - @endhistory + @calls Utili_CacheDataSet @returntype int @returndesc - 0 - success + 0 - success @endreturndesc - @@*/ -int CCTKi_SetupCache(void) +int CCTKi_SetupCache (void) { - int param_type; - int manual_cache_setup; - unsigned long cache_size; unsigned long cacheline_bytes; + DECLARE_CCTK_PARAMETERS - manual_cache_setup = (*(CCTK_INT *)CCTK_ParameterGet("manual_cache_setup", - "Cactus",¶m_type)); - if(manual_cache_setup) + if (manual_cache_setup) { - cache_size = (*(CCTK_INT *)CCTK_ParameterGet("manual_cache_size", - "Cactus",¶m_type)); - cacheline_bytes = (*(CCTK_INT *)CCTK_ParameterGet("manual_cacheline_bytes", - "Cactus",¶m_type)); + cache_size = manual_cache_size; + cacheline_bytes = manual_cacheline_bytes; } else { @@ -67,8 +54,7 @@ int CCTKi_SetupCache(void) cacheline_bytes = CCTK_L2_CACHELINE_BYTES; } - Utili_CacheDataSet(cacheline_bytes, cache_size); - - return 0; + Utili_CacheDataSet (cacheline_bytes, cache_size); + return (0); } diff --git a/src/main/ShutdownCactus.c b/src/main/ShutdownCactus.c index 95409e9f..2ab058ee 100644 --- a/src/main/ShutdownCactus.c +++ b/src/main/ShutdownCactus.c @@ -2,9 +2,10 @@ @file ShutdownCactus.c @date Mon Sep 28 14:25:48 1998 @author Tom Goodale - @desc - Contains routines to shutdown cactus. - @enddesc + @desc + Contains routines to shutdown cactus. + @enddesc + @version $Id$ @@*/ #include <stdio.h> @@ -12,7 +13,7 @@ #include "cctk_Flesh.h" #include "cctk_Misc.h" -#include "cctk_Parameter.h" +#include "cctk_Parameters.h" #include "cctk_Schedule.h" static const char *rcsid = "$Header$"; @@ -23,28 +24,34 @@ CCTK_FILEVERSION(main_ShutdownCactus_c) @routine CCTKi_ShutdownCactus @date Mon Sep 28 14:50:50 1998 @author Tom Goodale - @desc - Cactus specific shutdown stuff. - @enddesc - @calls - @calledby - @history - - @endhistory - + @desc + Cactus specific shutdown stuff. + @enddesc + @calls CCTK_SchedulePrintTimes + + @var ConfigData + @vdesc Flesh configuration data + @vtype tFleshConfig * + @vio unused + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc @@*/ int CCTKi_ShutdownCactus(tFleshConfig *ConfigData) { - int param_type; - const char *cctk_timer_output; + DECLARE_CCTK_PARAMETERS + - cctk_timer_output = (*(const char **)CCTK_ParameterGet("cctk_timer_output","Cactus",¶m_type)); + /* avoid compiler warning about unused argument */ + ConfigData = ConfigData; - if (CCTK_Equals(cctk_timer_output,"full")) + if (CCTK_Equals (cctk_timer_output, "full")) { - CCTK_SchedulePrintTimes(NULL); + CCTK_SchedulePrintTimes (NULL); } return 0; - } diff --git a/src/main/Stagger.c b/src/main/Stagger.c index ecd48ce8..95991e3a 100644 --- a/src/main/Stagger.c +++ b/src/main/Stagger.c @@ -27,11 +27,22 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_Stagger_c) /******************************************************************** - ********************* Local Data ***************************** + ********************* Fortran Wrappers *********************** ********************************************************************/ - - /* none */ - +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGI) + (int *stagcode, int *gindex); +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGN) + (int *scode, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerIndex) + (int *scode, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirIndex) + (int *dsi, int *dir, int *gsi); +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArray) + (int *ierr, int *dindex, int *dim, int *gsc); +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArrayGI) + (int *ierr, int *dindex, int *dim, int *gi); +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirName) + (int *dsc, int *dir, ONE_FORTSTRING_ARG); /******************************************************************** ********************* External Routines ********************** @@ -62,8 +73,8 @@ int CCTK_GroupStaggerIndexGI(int gindex) return(sc); } -void CCTK_FCALL CCTK_FNAME(CCTK_GroupStaggerIndexGI) - (int *stagcode, int *gindex) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGI) + (int *stagcode, int *gindex) { *stagcode = CCTK_GroupStaggerIndexGI(*gindex); } @@ -90,8 +101,8 @@ int CCTK_GroupStaggerIndexGN(const char *gname) return(CCTK_GroupStaggerIndexGI(gindex)); } -void CCTK_FCALL CCTK_FNAME(CCTK_GroupStaggerIndexGN) - (int *scode, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGN) + (int *scode, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE(gname) int gindex; @@ -143,8 +154,8 @@ int CCTK_StaggerIndex(const char *stype) return(scode); } -void CCTK_FCALL CCTK_FNAME(CCTK_StaggerIndex) - (int *scode, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerIndex) + (int *scode, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE(sname); *scode = CCTK_StaggerIndex(sname); @@ -197,8 +208,8 @@ int CCTK_StaggerDirIndex(int dir, int si) -void CCTK_FCALL CCTK_FNAME(CCTK_StaggerDirIndex) - ( int *dsi, int *dir, int *gsi) +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirIndex) + (int *dsi, int *dir, int *gsi) { /* accept fortran indexing [1..]: decrease the directional index for the call to the C routine. */ @@ -254,8 +265,8 @@ int CCTK_StaggerDirArray(int *dindex , int dim, int sindex) } -void CCTK_FCALL CCTK_FNAME(CCTK_GroupStaggerDirArray) - (int *ierr, int *dindex, int *dim, int *gsc) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArray) + (int *ierr, int *dindex, int *dim, int *gsc) { /* accept fortran indexing [1..]: decrease the directional index for the call to the C routine. */ @@ -287,8 +298,8 @@ int CCTK_GroupStaggerDirArrayGI(int *dindex, int dim, int gi) return ierr; } -void CCTK_FCALL CCTK_FNAME(CCTK_GroupStaggerDirArrayGI) - (int *ierr, int *dindex, int *dim, int *gi) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArrayGI) + (int *ierr, int *dindex, int *dim, int *gi) { *ierr = CCTK_GroupStaggerDirArrayGI(dindex, *dim, *gi); } @@ -317,7 +328,7 @@ int CCTK_StaggerDirName(int dir, const char *stype) sprintf(hs,"%s",stype); - if (dir>strlen(hs)) + if (dir> (int) strlen(hs)) { CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", "CCTK_StaggerDirName: Stagger name too short for direction %d", @@ -337,8 +348,8 @@ int CCTK_StaggerDirName(int dir, const char *stype) return(scode); } -void CCTK_FCALL CCTK_FNAME(CCTK_StaggerDirName) - (int *dsc, int *dir, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirName) + (int *dsc, int *dir, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE(sname); @@ -400,7 +411,7 @@ int CCTKi_ParseStaggerString(int dim, } else { - if (strlen(stype)!=dim) + if ((int) strlen(stype)!=dim) { CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", "CCTKi_ParseStaggerString: Staggering %s for %s unequal to group dimension %d", diff --git a/src/main/Subsystems.c b/src/main/Subsystems.c index b8e21f56..1a5bd875 100644 --- a/src/main/Subsystems.c +++ b/src/main/Subsystems.c @@ -2,72 +2,53 @@ @file Subsystems.c @date Fri Jul 23 14:38:25 1999 @author Tom Goodale - @desc - Misc stuff for the subsystems. - @enddesc - @version $Header$ + @desc + Misc stuff for the subsystems. + @enddesc + @version $Id$ @@*/ #include "cctk_Flesh.h" #include "CactusRegister.h" +#include "cctk_Schedule.h" static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_Subsystems_c) /******************************************************************** - ********************* Local Data Types *********************** - ********************************************************************/ - -/******************************************************************** - ********************* Local Routine Prototypes ********************* - ********************************************************************/ - -/******************************************************************** - ********************* Other Routine Prototypes ********************* - ********************************************************************/ - -/******************************************************************** - ********************* Local Data ***************************** - ********************************************************************/ - -/******************************************************************** ********************* External Routines ********************** ********************************************************************/ +int CCTKBindings_SetupThornFunctions (void); +int CCTKi_InitialiseSubsystemDefaults (void); /*@@ @routine CCTKi_InitialiseSubsystemDefaults @date Fri Jul 23 14:39:53 1999 @author Tom Goodale - @desc - Sets up the defaults for the overloadable functions in the subsystems. - @enddesc - @calls CCTKi_SetupMainFunctions CCTKi_SetupCommFunctions CCTKi_SetupIOFunctions CCTKi_BindingsImplementationsInitialise CCTKi_BindingsParametersInitialise - @calledby - @history - - @endhistory + @desc + Sets up the defaults for the overloadable functions + in the subsystems. + @enddesc + @calls CCTKi_SetupMainFunctions + CCTKi_SetupCommFunctions + CCTKi_SetupIOFunctions + CCTKi_BindingsImplementationsInitialise + CCTKi_BindingsParametersInitialise @returntype int @returndesc - 0 - success + 0 - success @endreturndesc - @@*/ - -int CCTKi_InitialiseSubsystemDefaults(void) +int CCTKi_InitialiseSubsystemDefaults (void) { - CCTKi_SetupMainFunctions(); - CCTKi_SetupCommFunctions(); - CCTKi_SetupIOFunctions(); - CCTKBindings_SetupThornFunctions(); - CCTKi_BindingsImplementationsInitialise(); - CCTKi_BindingsParametersInitialise(); - - return 0; + CCTKi_SetupMainFunctions (); + CCTKi_SetupCommFunctions (); + CCTKi_SetupIOFunctions (); + CCTKBindings_SetupThornFunctions (); + CCTKi_BindingsImplementationsInitialise (); + CCTKi_BindingsParametersInitialise (); + + return (0); } - -/******************************************************************** - ********************* Local Routines ************************* - ********************************************************************/ - diff --git a/src/schedule/ScheduleSorter.c b/src/schedule/ScheduleSorter.c index 37f42e66..2871d4ca 100644 --- a/src/schedule/ScheduleSorter.c +++ b/src/schedule/ScheduleSorter.c @@ -381,6 +381,7 @@ int *CCTKi_ScheduleCreateIVec(int size) @@*/ void CCTKi_ScheduleDestroyIVec(int size, int *vector) { + size = size; free(vector); } diff --git a/src/util/Time.c b/src/util/Time.c index 745d9b51..f094e563 100644 --- a/src/util/Time.c +++ b/src/util/Time.c @@ -14,6 +14,7 @@ #include <string.h> #include "cctk_Flesh.h" +#include "cctk_Misc.h" static const char *rcsid = "$Header$"; |