From 61da3a6c15e53532f849763e4fc7133f415b038e Mon Sep 17 00:00:00 2001 From: allen Date: Tue, 25 Jan 2000 09:45:35 +0000 Subject: CCTK function name changes git-svn-id: http://svn.cactuscode.org/flesh/trunk@1292 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/main/ProcessCommandLine.c | 9 +- src/main/ProcessEnvironment.c | 2 +- src/main/ProcessParameterDatabase.c | 4 +- src/main/RecordImplementation.c | 4 +- src/main/ScheduleInterface.c | 138 +++++++++++++------------ src/main/SetParams.c | 25 +++-- src/main/SetupCache.c | 8 +- src/main/Stagger.c | 194 +++++++++++++++++++++++++++++++++--- src/main/Startup.c | 7 +- src/main/Subsystems.c | 9 +- src/main/flesh.cc | 6 +- 11 files changed, 296 insertions(+), 110 deletions(-) (limited to 'src') diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c index 347302f9..62fd8c23 100644 --- a/src/main/ProcessCommandLine.c +++ b/src/main/ProcessCommandLine.c @@ -20,7 +20,7 @@ static int argc; static char **argv; /*@@ - @routine ProcessCommandLine + @routine CCTKi_ProcessCommandLine @date Thu Sep 24 10:33:31 1998 @author Tom Goodale @desc @@ -33,11 +33,10 @@ static char **argv; @endhistory @@*/ -int ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) +int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) { int option_index = 0; - int test_nprocs = 1; int c; /* Store the command line */ @@ -111,7 +110,7 @@ int ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) /*@@ - @routine CCTK_GetCommandLine + @routine CCTK_CommandLine @date Wed Feb 17 00:19:30 1999 @author Tom Goodale @desc @@ -124,7 +123,7 @@ int ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) @endhistory @@*/ -int CCTK_GetCommandLine(char ***outargv) +int CCTK_CommandLine(char ***outargv) { *outargv = argv; diff --git a/src/main/ProcessEnvironment.c b/src/main/ProcessEnvironment.c index 0b040b1b..acfed99e 100644 --- a/src/main/ProcessEnvironment.c +++ b/src/main/ProcessEnvironment.c @@ -39,7 +39,7 @@ static char *rcsid = "$Header$"; char MPI_Active = 0; #endif -int ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData) +int CCTKi_ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData) { /* Check if MPI compiled in but choosing not to use MPI. */ diff --git a/src/main/ProcessParameterDatabase.c b/src/main/ProcessParameterDatabase.c index c75ee5f6..a7489d3b 100644 --- a/src/main/ProcessParameterDatabase.c +++ b/src/main/ProcessParameterDatabase.c @@ -20,7 +20,7 @@ int ParseFile(FILE *ifp, /*@@ - @routine ProcessParameterDatabase + @routine CCTKi_ProcessParameterDatabase @date Thu Sep 24 10:37:07 1998 @author Tom Goodale @desc @@ -33,7 +33,7 @@ int ParseFile(FILE *ifp, @endhistory @@*/ -int ProcessParameterDatabase(tFleshConfig *ConfigData) +int CCTKi_ProcessParameterDatabase(tFleshConfig *ConfigData) { int retval; FILE *parameter_file; diff --git a/src/main/RecordImplementation.c b/src/main/RecordImplementation.c index b5bdf9f1..600b4371 100644 --- a/src/main/RecordImplementation.c +++ b/src/main/RecordImplementation.c @@ -25,7 +25,7 @@ static pNamedData *implementation_data = NULL; /*@@ - @routine CCTK_RecordImplementation + @routine CCTKi_RegisterImplementation @date Wed Jan 13 23:23:00 1999 @author Tom Goodale @desc @@ -38,7 +38,7 @@ static pNamedData *implementation_data = NULL; @endhistory @@*/ -int CCTK_RecordImplementation(const char *implementation, +int CCTKi_RegisterImplementation(const char *implementation, const char *thorn) { int retval; diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index 677c8ac7..cb98c5df 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -25,7 +25,7 @@ static char *rcsid = "$Header$"; #include "rfrInterface.h" -#include "cctk_FortranWrappers.h" +#include "cctki_FortranWrappers.h" #include "CactusTimers.h" @@ -159,7 +159,7 @@ static t_TimerInfo *timerinfo = NULL; ********************************************************************/ /*@@ - @routine CCTK_ScheduleFunction + @routine CCTKi_ScheduleFunction @date Thu Sep 16 18:19:01 1999 @author Tom Goodale @desc @@ -172,20 +172,21 @@ static t_TimerInfo *timerinfo = NULL; @endhistory @@*/ -int CCTK_ScheduleFunction(void *function, - const char *name, - const char *thorn, - const char *implementation, - const char *description, - const char *where, - const char *language, - int n_mem_groups, - int n_comm_groups, - int n_trigger_groups, - int n_before, - int n_after, - int n_while, - ...) +int CCTKi_ScheduleFunction(void *function, + const char *name, + const char *thorn, + const char *implementation, + const char *description, + const char *where, + const char *language, + int n_mem_groups, + int n_comm_groups, + int n_trigger_groups, + int n_before, + int n_after, + int n_while, + ... + ) { int retcode; t_attribute *attribute; @@ -204,7 +205,8 @@ int CCTK_ScheduleFunction(void *function, { attribute->FunctionData.type = TranslateFunctionType(where); - retcode = CCTKi_ScheduleFunction(where, name, function, modifier, (void *)attribute); + retcode = CCTKi_DoScheduleFunction(where, name, function, modifier, (void *)attribute); + #ifdef DEBUG fprintf(stderr, "Scheduled %s at %s\n", name, where); #endif @@ -220,7 +222,7 @@ int CCTK_ScheduleFunction(void *function, } /*@@ - @routine CCTK_ScheduleGroup + @routine CCTKi_ScheduleGroup @date Thu Sep 16 18:19:18 1999 @author Tom Goodale @desc @@ -233,18 +235,19 @@ int CCTK_ScheduleFunction(void *function, @endhistory @@*/ -int CCTK_ScheduleGroup(const char *name, - const char *thorn, - const char *implementation, - const char *description, - const char *where, - int n_mem_groups, - int n_comm_groups, - int n_trigger_groups, - int n_before, - int n_after, - int n_while, - ...) +int CCTKi_ScheduleGroup(const char *name, + const char *thorn, + const char *implementation, + const char *description, + const char *where, + int n_mem_groups, + int n_comm_groups, + int n_trigger_groups, + int n_before, + int n_after, + int n_while, + ... + ) { int retcode; t_attribute *attribute; @@ -261,7 +264,7 @@ int CCTK_ScheduleGroup(const char *name, if(attribute && (modifier || (n_before == 0 && n_after == 0 && n_while == 0))) { - retcode = CCTKi_ScheduleGroup(where, name, modifier, (void *)attribute); + retcode = CCTKi_DoScheduleGroup(where, name, modifier, (void *)attribute); #ifdef DEBUG fprintf(stderr, "Scheduled %s at %s\n", name, where); #endif @@ -278,8 +281,9 @@ int CCTK_ScheduleGroup(const char *name, } + /*@@ - @routine CCTK_ScheduleGroupStorage + @routine CCTKi_ScheduleGroupStorage @date Fri Sep 17 18:55:59 1999 @author Tom Goodale @desc @@ -292,7 +296,7 @@ int CCTK_ScheduleGroup(const char *name, @endhistory @@*/ -int CCTK_ScheduleGroupStorage(const char *group) +int CCTKi_ScheduleGroupStorage(const char *group) { int retcode; int *temp; @@ -318,8 +322,9 @@ int CCTK_ScheduleGroupStorage(const char *group) } + /*@@ - @routine CCTK_ScheduleGroupComm + @routine CCTKi_ScheduleGroupComm @date Fri Sep 17 18:55:59 1999 @author Tom Goodale @desc @@ -332,7 +337,7 @@ int CCTK_ScheduleGroupStorage(const char *group) @endhistory @@*/ -int CCTK_ScheduleGroupComm(const char *group) +int CCTKi_ScheduleGroupComm(const char *group) { int retcode; int *temp; @@ -358,8 +363,9 @@ int CCTK_ScheduleGroupComm(const char *group) } + /*@@ - @routine CCTK_ScheduleTraverse + @routine CCTKi_ScheduleTraverse @date Fri Sep 17 21:52:44 1999 @author Tom Goodale @desc @@ -372,9 +378,10 @@ int CCTK_ScheduleGroupComm(const char *group) @endhistory @@*/ -int CCTK_ScheduleTraverse(const char *where, - void *GH, - int (*calling_function)(void *, void *, void *)) + +int CCTKi_ScheduleTraverse(const char *where, + void *GH, + int (*calling_function)(void *, void *, void *)) { t_sched_data data; @@ -401,18 +408,21 @@ int CCTK_ScheduleTraverse(const char *where, data.schedpoint = schedpoint_misc; } - CCTKi_ScheduleTraverse(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); + 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 + ); return 0; } /*@@ - @routine CCTK_ScheduleGHInit + @routine CCTKi_ScheduleGHInit @date Fri Sep 17 21:25:13 1999 @author Tom Goodale @desc @@ -425,7 +435,7 @@ int CCTK_ScheduleTraverse(const char *where, @endhistory @@*/ -int CCTK_ScheduleGHInit(void *GH) +int CCTKi_ScheduleGHInit(void *GH) { int i; @@ -624,7 +634,7 @@ static t_attribute *CreateAttribute(const char *description, { this->type = sched_function; this->FunctionData.language = CCTK_TranslateLanguage(language); - this->FunctionData.FortranCaller = (int (*)(cGH *,void *))CCTK_FortranWrapper(thorn); + this->FunctionData.FortranCaller = (int (*)(cGH *,void *))CCTKi_FortranWrapper(thorn); } else { @@ -742,7 +752,7 @@ static t_sched_modifier *CreateTypedModifier(t_sched_modifier *modifier, { item = va_arg(*ap, const char *); - modifier = CCTKi_ScheduleAddModifier(modifier, type, item); + modifier = CCTKi_DoScheduleAddModifier(modifier, type, item); } return modifier; @@ -806,12 +816,15 @@ static int SchedulePrint(const char *where) if(where) { - retcode = CCTKi_ScheduleTraverse(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); + 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 + ); } else { @@ -841,12 +854,15 @@ static int SchedulePrintTimes(const char *where, t_sched_data *data) if(where) { - retcode = CCTKi_ScheduleTraverse(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); + 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 + ); } else { diff --git a/src/main/SetParams.c b/src/main/SetParams.c index a5f9ba2d..29276ce2 100644 --- a/src/main/SetParams.c +++ b/src/main/SetParams.c @@ -14,17 +14,22 @@ #include "SKBinTree.h" #include "cctk_Types.h" +#include "cctki_ActiveThorns.h" #include "cctk_ActiveThorns.h" #include "cctk_WarnLevel.h" #include "cctk_Misc.h" #include "ParameterBindings.h" - -int CCTKi_ReallySetParameter(const char *parameter, const char *value); -int ParameterSet(const char *name, - const char *thorn, - const char *value); +static int ReallySetParameter( + const char *parameter, + const char *value + ); +int CCTK_ParameterSet( + const char *name, + const char *thorn, + const char *value + ); static char *rcsid = "$Id$"; @@ -85,7 +90,7 @@ int CCTKi_SetParameter(const char *parameter, const char *value) else { /* retval = CCTKi_BindingsParameterSet(parameter, value);*/ - retval = CCTKi_ReallySetParameter(parameter, value); + retval = ReallySetParameter(parameter, value); } if(retval) @@ -103,7 +108,7 @@ int CCTKi_SetParameter(const char *parameter, const char *value) return retval; } -int CCTKi_ReallySetParameter(const char *parameter, const char *value) +static int ReallySetParameter(const char *parameter, const char *value) { int retval; const char *thorn; @@ -125,7 +130,7 @@ int CCTKi_ReallySetParameter(const char *parameter, const char *value) if(!param) { - retval = ParameterSet(parameter, imp, value); + retval = CCTK_ParameterSet(parameter, imp, value); } else { @@ -133,7 +138,7 @@ int CCTKi_ReallySetParameter(const char *parameter, const char *value) if(CCTK_IsImplementationActive(imp)) { thorn = CCTK_ActivatingThorn(imp); - retval_imp = ParameterSet(param, thorn, value); + retval_imp = CCTK_ParameterSet(param, thorn, value); } else { @@ -147,7 +152,7 @@ int CCTKi_ReallySetParameter(const char *parameter, const char *value) { if(CCTK_IsThornActive(imp)) { - retval_thorn = ParameterSet(param, imp, value); + retval_thorn = CCTK_ParameterSet(param, imp, value); } else { diff --git a/src/main/SetupCache.c b/src/main/SetupCache.c index c29a62ef..93553fc9 100644 --- a/src/main/SetupCache.c +++ b/src/main/SetupCache.c @@ -9,9 +9,11 @@ static char *rcsid = "$Header$"; -#include "cctk.h" +#include + +#include "cctk_Config.h" #include "cctki_Cache.h" -#include "cctk_parameters.h" +#include "cctk_Parameters.h" /******************************************************************** ********************* CCTK Local Routines ********************** @@ -60,7 +62,7 @@ int CCTKi_SetupCache(void) #endif } - CCTKi_CacheDataSet(cacheline_bytes, cache_size); + Utili_CacheDataSet(cacheline_bytes, cache_size); return 0; diff --git a/src/main/Stagger.c b/src/main/Stagger.c index 56f7c174..68286e3f 100644 --- a/src/main/Stagger.c +++ b/src/main/Stagger.c @@ -12,24 +12,74 @@ static int staggered = 0; -int CCTK_StaggeredGrids(void) { + /*@@ + @routine CCTK_StaggerVars + @date + @author Gerd Lanfermann + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +int CCTK_StaggerVars(void) +{ return(staggered); } -int CCTK_StaggerCodeGrpIdx(int gindex) { + + /*@@ + @routine + @date + @author + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +int CCTK_StaggerCodeGrpIdx(int gindex) +{ cGroup group; int sc; CCTK_GroupData(gindex, &group); sc = group.stagtype; return(sc); } - -void FMODIFIER FORTRAN_NAME(CCTK_StaggerCodeGrpIdx)(int *stagcode, int *gindex) + +void FMODIFIER FORTRAN_NAME(CCTK_StaggerCodeGrpIdx) + (int *stagcode, int *gindex) { *stagcode = CCTK_StaggerCodeGrpIdx(*gindex); } -int CCTK_StaggerCodeGrp(const char *gname) { + /*@@ + @routine + @date + @author Gerd Lanfermann + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +int CCTK_StaggerCodeGrp(const char *gname) +{ int gindex; gindex = CCTK_GroupIndex(gname); return(CCTK_StaggerCodeGrpIdx(gindex)); @@ -45,7 +95,23 @@ void FMODIFIER FORTRAN_NAME(CCTK_StaggerCodeGrp)(int *stagcode, ONE_FORTSTRING_A } -int CCTK_StaggerCodeName(const char *stype) { + /*@@ + @routine + @date + @author Gerd Lanfermann + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +int CCTK_StaggerCodeName(const char *stype) +{ int i,scode,base,dim,m; char *info; @@ -53,7 +119,8 @@ int CCTK_StaggerCodeName(const char *stype) { scode=0; dim =strlen(stype); - for (i=0;i=0;b--) { + for (b=3;b>=0;b--) + { val = (int)(sc / hash[b]); sc = sc % hash[b]; - if (dir==b) { + if (dir==b) + { dsc = val; break; } @@ -113,13 +199,31 @@ void FMODIFIER FORTRAN_NAME(CCTK_DirStaggerCodeVal) + /*@@ + @routine + @date + @author Gerd Lanfermann + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + int CCTK_DirStaggerCodeName(int dir, const char *stype) { int scode; char hs[7]="MMMMMM",*info; sprintf(hs,"%s",stype); - if (dir>strlen(hs)) CCTK_Warn(1,__LINE__,__FILE__,"Cactus","Not enough letters in stagger code"); + if (dir>strlen(hs)) + { + CCTK_Warn(1,__LINE__,__FILE__,"Cactus","Not enough letters in stagger code"); + } switch (hs[dir]) { @@ -142,7 +246,71 @@ void FMODIFIER FORTRAN_NAME(CCTK_DirStaggerCodeName) ONE_FORTSTRING_CREATE(sname); *ierr= 0; *dsc = CCTK_DirStaggerCodeName((*dir)-1,sname); - if ((*dsc)>=0) (*dsc)++; + if ((*dsc)>=0) + { + (*dsc)++; + } free(sname); } + /*@@ + @routine + @date + @author Gerd Lanfermann + @desc + + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +int CCTKi_ParseStaggerString(int dim, + const char *imp, + const char *gname, + const char *stype) +{ + int i,m; + int base = 1; + int scode = 0; + char hs[7]="MMMMMM", *info; + + /* change possible SHORTCUTS into the official notation, allow for dim=6 */ + if (strcmp(stype,"NONE")==0) + { + strncpy(hs,"MMMMMM",dim); + } + else if (strcmp(stype,"CELL")==0) + { + strncpy(hs,"CCCCCC",dim); + } + else + { + sprintf(hs,"%s",stype); + } + + for (i=0;i%s< for group: >%s::%s< \n", + stype,imp,gname); + CCTK_Warn(1,__LINE__,__FILE__,"Cactus",info); + free(info); + return(-1); + } + scode+= m*base; + base = 3 * base; + } + + return(scode); +} diff --git a/src/main/Startup.c b/src/main/Startup.c index 3c62d4b4..2cddd3fa 100644 --- a/src/main/Startup.c +++ b/src/main/Startup.c @@ -7,16 +7,11 @@ @enddesc @@*/ -int Cactus_Startup(void) +int CactusStartup(void) { const char *string; -#if 0 - /* Old startup */ - string = " \\ |/\n /--\\\n \\| .|- \\ | | | / \n | . |\n | . |- - Cactus 4.0 -\n -| |\n | / | / | | | \\\n \\| |/\n | . | Thorny problems in Numerical Relativity and Beyond\n | |-\n \\ / Credits: Tom Goodale, Joan Masso, Paul Walker and Gabrielle Allen\n -------- Including contributions from many worldwide collaborators\n \\______/\n "; -#endif - #define B_1 " 10 " #define B_2 " 1 0101 ************************ " #define B_3 " 01 1010 10 The Cactus Code V4.0 " diff --git a/src/main/Subsystems.c b/src/main/Subsystems.c index 0d55aa17..9c225632 100644 --- a/src/main/Subsystems.c +++ b/src/main/Subsystems.c @@ -13,7 +13,7 @@ static char *rcsid = "$Header$"; /*@@ - @routine InitialiseSubsystemDefaults + @routine CCTKi_InitialiseSubsystemDefaults @date Fri Jul 23 14:39:53 1999 @author Tom Goodale @desc @@ -26,10 +26,11 @@ static char *rcsid = "$Header$"; @endhistory @@*/ -int InitialiseSubsystemDefaults(void) + +int CCTKi_InitialiseSubsystemDefaults(void) { - SetupMainFunctions(); - SetupCommFunctions(); + CCTKi_SetupMainFunctions(); + CCTKi_SetupCommFunctions(); SetupIOFunctions(); CCTKi_BindingsImplementationsInitialise(); diff --git a/src/main/flesh.cc b/src/main/flesh.cc index 2644fcb8..ac02a272 100644 --- a/src/main/flesh.cc +++ b/src/main/flesh.cc @@ -23,7 +23,7 @@ static char *rcsid = "$Id$"; going to be any c++ at all in your program. @enddesc - @calls InitialiseCactus Initialise Evolve Shutdown ShutdownCactus + @calls CCTKi_InitialiseCactus Initialise Evolve Shutdown ShutdownCactus @calledby @history @@ -50,7 +50,7 @@ int main(int argc, char **argv) /* Initialise any cactus specific stuff. */ - InitialiseCactus(&argc, &argv, &ConfigData); + CCTKi_InitialiseCactus(&argc, &argv, &ConfigData); /* This is a (c-linkage) routine which has been registered by a thorn. */ @@ -66,7 +66,7 @@ int main(int argc, char **argv) /* Shut down any cactus specific stuff. */ - ShutdownCactus(&ConfigData); + CCTKi_ShutdownCactus(&ConfigData); return 0; } -- cgit v1.2.3