diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-10-07 12:27:09 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-10-07 12:27:09 -0500 |
commit | f500fa45fe93a8451a5ff72a30d2dee81dcaa2e4 (patch) | |
tree | fce35a02c6ecfa271c18828a7030a6b0dd55fe6e /Carpet | |
parent | 38dea5ff679c47aec1834b1d20e5d36d5d777a0f (diff) |
Carpet: Pass more arguments to schedule wrapper functions
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/interface.ccl | 20 | ||||
-rw-r--r-- | Carpet/Carpet/src/CallFunction.cc | 4 | ||||
-rw-r--r-- | Carpet/Carpet/src/ScheduleWrapper.cc | 19 | ||||
-rw-r--r-- | Carpet/Carpet/src/carpet.hh | 10 |
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 { |