summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-01-27 23:18:16 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-01-27 23:18:16 +0000
commit1a53d2c962018be2fa3f7299f4fbdae342149768 (patch)
tree3c3b8afc80b4190cfe2839d172fa1391b6dbf4f6 /src/include
parent56543d22f0bdfe6c45d557ecf1d7872b4ad47a98 (diff)
Added the mechanism for allowing drivers to specify a function to be
called at the bottm of a schedule traverse, and changed the flesh to use the new calls. rfrTraverse is now obsolete and will be removed soon. Drivers may now call int CCTK_RegisterGHExtensionScheduleTraverseGH(int handle, int (*func)(cGH *, const char *)) to register a ScheduleTraverse function. This is precisely equivalent to the deprecated CCTK_RegisterGHExtensionrfrTraverseGH except the registered function now takes a string and not a constant. The registered function should then fill out the cGH as per normal, and call int CCTK_ScheduleTraverse(const char *where, void *GH, int (*CallFunction)(void *, cFunctionData *, void *)) with the string and GH passed in, and either NULL or a function which takes a function pointer, a cFunctionData data structure, and a cGH. This function, in turn, may call int CCTK_CallFunction(void *function, cFunctionData *fdata, void *data) with these arguments, or may call the function in some other way if it desires. This allows a driver to loop over all sub-grids at a particular level filling out the cGH at this level of the schedule tree rather than at the top, which was the only option available before. Unigrid drivers should probably still fill out at the top and pass NULL down as it's more efficient to fill out the cGH only once, but AMR or multi-block/patch drivers can now use this mechanism. The old CCTK_rfrTraverse routine has similarly been replaced by int CCTK_Traverse(cGH *GH, const char *where) which loops over all GH extensions calling their registered ScheduleTraverseGH routines. Tom NB these names may change at the next naming meeting, but the functionality should remain. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1317 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cctk_Flesh.h2
-rw-r--r--src/include/cctk_GHExtensions.h47
-rw-r--r--src/include/cctk_Schedule.h16
-rw-r--r--src/include/cctki_GHExtensions.h7
-rw-r--r--src/include/cctki_ScheduleBindings.h4
5 files changed, 36 insertions, 40 deletions
diff --git a/src/include/cctk_Flesh.h b/src/include/cctk_Flesh.h
index 5144be00..e2d44688 100644
--- a/src/include/cctk_Flesh.h
+++ b/src/include/cctk_Flesh.h
@@ -36,6 +36,8 @@ extern "C"
{
#endif
+int CCTK_Traverse(cGH *GH, const char *where);
+
int CCTKi_SetParameter(const char *parameter, const char *value);
int CCTKi_ProcessCommandLine(int *argc, char ***argv, tFleshConfig *ConfigData);
diff --git a/src/include/cctk_GHExtensions.h b/src/include/cctk_GHExtensions.h
index 8b6072a9..853eb2eb 100644
--- a/src/include/cctk_GHExtensions.h
+++ b/src/include/cctk_GHExtensions.h
@@ -12,40 +12,29 @@
#define _CCTK_GHEXTENSIONS_H_
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-int CCTK_RegisterGHExtension
- (
- const char *name
- );
-
-int CCTK_RegisterGHExtensionSetupGH
- (
- int handle,
- void *(*func)(tFleshConfig *, int, cGH *)
- );
-
-int CCTK_RegisterGHExtensionInitGH
- (
- int handle,
- int (*func)(cGH *)
- );
-
-int CCTK_RegisterGHExtensionrfrTraverseGH
- (
- int handle,
- int (*func)(cGH *, int)
- );
-
-int CCTK_GHExtensionHandle
- (
- const char *name
- );
+int CCTK_RegisterGHExtension(const char *name);
+
+int CCTK_RegisterGHExtensionSetupGH(int handle,
+ void *(*func)(tFleshConfig *, int, cGH *));
+
+int CCTK_RegisterGHExtensionInitGH(int handle,
+ int (*func)(cGH *));
+
+int CCTK_RegisterGHExtensionrfrTraverseGH(int handle,
+ int (*func)(cGH *, int));
+
+int CCTK_RegisterGHExtensionScheduleTraverseGH(int handle,
+ int (*func)(cGH *, const char *));
+
+int CCTK_GHExtensionHandle(const char *name);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _CCTK_GHEXTENSIONS_H_ */
diff --git a/src/include/cctk_Schedule.h b/src/include/cctk_Schedule.h
index 8e14fc2b..107e297f 100644
--- a/src/include/cctk_Schedule.h
+++ b/src/include/cctk_Schedule.h
@@ -30,9 +30,19 @@ typedef struct
} cFunctionData;
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
+int CCTK_ScheduleTraverse(const char *where,
+ void *GH,
+ int (*CallFunction)(void *, cFunctionData *, void *));
+
+int CCTK_SchedulePrint(const char *where);
+int CCTK_SchedulePrintTimes(const char *where);
+
+cLanguage CCTK_TranslateLanguage(const char *sval);
+
/*int CCTK_ScheduleFunction(void *function,
const char *name,
const char *thorn,
@@ -72,10 +82,6 @@ int CCTK_ScheduleTraverse(const char *where,
int CCTK_ScheduleGHInit(void *GH);
*/
-int CCTK_SchedulePrint(const char *where);
-int CCTK_SchedulePrintTimes(const char *where);
-
-cLanguage CCTK_TranslateLanguage(const char *sval);
#ifdef __cplusplus
}
diff --git a/src/include/cctki_GHExtensions.h b/src/include/cctki_GHExtensions.h
index c06a650b..28af1771 100644
--- a/src/include/cctki_GHExtensions.h
+++ b/src/include/cctki_GHExtensions.h
@@ -12,7 +12,8 @@
#define _CCTKI_GHEXTENSIONS_H_
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
int CCTKi_SetupGHExtensions(tFleshConfig *config,
@@ -23,9 +24,11 @@ int CCTKi_InitGHExtensions(cGH *GH);
int CCTKi_rfrTraverseGHExtensions(cGH *GH, int rfrpoint);
+int CCTKi_ScheduleTraverseGHExtensions(cGH *GH, const char *where);
+
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* _CCTKI_GHEXTENSIONS_H_ */
diff --git a/src/include/cctki_ScheduleBindings.h b/src/include/cctki_ScheduleBindings.h
index b5edc892..58c2629b 100644
--- a/src/include/cctki_ScheduleBindings.h
+++ b/src/include/cctki_ScheduleBindings.h
@@ -50,10 +50,6 @@ int CCTKi_ScheduleGroupStorage(const char *group);
int CCTKi_ScheduleGroupComm(const char *group);
-int CCTKi_ScheduleTraverse(const char *where,
- void *GH,
- int (*CallFunction)(void *, cFunctionData *, void *));
-
int CCTKi_ScheduleGHInit(void *GH);
#ifdef __cplusplus