aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/Carpet/interface.ccl20
-rw-r--r--Carpet/Carpet/src/CallFunction.cc4
-rw-r--r--Carpet/Carpet/src/ScheduleWrapper.cc19
-rw-r--r--Carpet/Carpet/src/carpet.hh10
4 files changed, 40 insertions, 13 deletions
diff --git a/Carpet/Carpet/interface.ccl b/Carpet/Carpet/interface.ccl
index cee9c1075..87c44e941 100644
--- a/Carpet/Carpet/interface.ccl
+++ b/Carpet/Carpet/interface.ccl
@@ -45,12 +45,24 @@ PROVIDES FUNCTION GetMPICommWorld WITH Carpet_GetMPICommWorld LANGUAGE C
# every scheduled routine
CCTK_INT \
FUNCTION RegisterScheduleWrapper \
- (CCTK_INT IN CCTK_FPOINTER func_before (CCTK_POINTER_TO_CONST IN cctkGH), \
- CCTK_INT IN CCTK_FPOINTER func_after (CCTK_POINTER_TO_CONST IN cctkGH))
+ (CCTK_INT IN CCTK_FPOINTER func_before (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_POINTER IN function, \
+ CCTK_POINTER IN attribute, \
+ CCTK_POINTER IN data), \
+ CCTK_INT IN CCTK_FPOINTER func_after (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_POINTER IN function, \
+ CCTK_POINTER IN attribute, \
+ CCTK_POINTER IN data))
CCTK_INT \
FUNCTION UnRegisterScheduleWrapper \
- (CCTK_INT IN CCTK_FPOINTER func_before (CCTK_POINTER_TO_CONST IN cctkGH), \
- CCTK_INT IN CCTK_FPOINTER func_after (CCTK_POINTER_TO_CONST IN cctkGH))
+ (CCTK_INT IN CCTK_FPOINTER func_before (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_POINTER IN function, \
+ CCTK_POINTER IN attribute, \
+ CCTK_POINTER IN data), \
+ CCTK_INT IN CCTK_FPOINTER func_after (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_POINTER IN function, \
+ CCTK_POINTER IN attribute, \
+ CCTK_POINTER IN data))
PROVIDES FUNCTION RegisterScheduleWrapper \
WITH Carpet_RegisterScheduleWrapper \
LANGUAGE C
diff --git a/Carpet/Carpet/src/CallFunction.cc b/Carpet/Carpet/src/CallFunction.cc
index ea64fa115..6478a3ed2 100644
--- a/Carpet/Carpet/src/CallFunction.cc
+++ b/Carpet/Carpet/src/CallFunction.cc
@@ -310,11 +310,11 @@ namespace Carpet {
time_and_mode,
attribute->where,
attribute->thorn, attribute->routine);
- CallBeforeRoutines (cctkGH);
+ CallBeforeRoutines (cctkGH, function, attribute, data);
user_timer.start();
int const res = CCTK_CallFunction (function, attribute, data);
user_timer.stop();
- CallAfterRoutines (cctkGH);
+ CallAfterRoutines (cctkGH, function, attribute, data);
assert (res==0);
}
diff --git a/Carpet/Carpet/src/ScheduleWrapper.cc b/Carpet/Carpet/src/ScheduleWrapper.cc
index 4446233ed..c782c0f91 100644
--- a/Carpet/Carpet/src/ScheduleWrapper.cc
+++ b/Carpet/Carpet/src/ScheduleWrapper.cc
@@ -12,7 +12,10 @@ namespace Carpet {
- typedef CCTK_INT (* func) (CCTK_POINTER_TO_CONST cctkGH);
+ typedef CCTK_INT (* func) (CCTK_POINTER_TO_CONST cctkGH,
+ CCTK_POINTER function,
+ CCTK_POINTER attribute,
+ CCTK_POINTER data);
typedef list <func> flist;
static flist func_befores, func_afters;
@@ -44,22 +47,28 @@ namespace Carpet {
void
- CallBeforeRoutines (cGH const * restrict const cctkGH)
+ CallBeforeRoutines (cGH const * const cctkGH,
+ void * const function,
+ cFunctionData * const attribute,
+ void * const data)
{
for (flist::const_iterator
fli = func_befores.begin(); fli != func_befores.end(); ++ fli)
{
- (* fli) (cctkGH);
+ (* fli) (cctkGH, function, attribute, data);
}
}
void
- CallAfterRoutines (cGH const * restrict const cctkGH)
+ CallAfterRoutines (cGH const * const cctkGH,
+ void * const function,
+ cFunctionData * const attribute,
+ void * const data)
{
for (flist::const_iterator
fli = func_afters.begin(); fli != func_afters.end(); ++ fli)
{
- (* fli) (cctkGH);
+ (* fli) (cctkGH, function, attribute, data);
}
}
diff --git a/Carpet/Carpet/src/carpet.hh b/Carpet/Carpet/src/carpet.hh
index 9e53cfe5c..446f4846d 100644
--- a/Carpet/Carpet/src/carpet.hh
+++ b/Carpet/Carpet/src/carpet.hh
@@ -61,8 +61,14 @@ namespace Carpet {
void CheckChecksums (const cGH* cgh, checktimes where);
// Schedule
- void CallBeforeRoutines (cGH const * restrict cctkGH);
- void CallAfterRoutines (cGH const * restrict cctkGH);
+ void CallBeforeRoutines (cGH const * cctkGH,
+ void * const function,
+ cFunctionData * const attribute,
+ void * const data);
+ void CallAfterRoutines (cGH const * cctkGH,
+ void * const function,
+ cFunctionData * const attribute,
+ void * const data);
// Requirements
namespace Requirements {