diff options
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/CaKernel.m | 8 | ||||
-rw-r--r-- | Tools/CodeGen/KrancThorn.m | 4 | ||||
-rw-r--r-- | Tools/CodeGen/Schedule.m | 8 |
3 files changed, 17 insertions, 3 deletions
diff --git a/Tools/CodeGen/CaKernel.m b/Tools/CodeGen/CaKernel.m index 299593c..2c82a80 100644 --- a/Tools/CodeGen/CaKernel.m +++ b/Tools/CodeGen/CaKernel.m @@ -23,6 +23,7 @@ BeginPackage["CaKernel`", {"Errors`", "Helpers`", "Kranc`", "CodeGenCactus`", "M CaKernelCCL; CaKernelCode; +CaKernelEpilogue; Begin["`Private`"]; @@ -95,6 +96,13 @@ DefFn[CaKernelCode[calc_List] := "// Kernel code"]}]}]}]]]; +DefFn[CaKernelEpilogue[] := + " +############################################################ +#CAKERNEL AUTO GENERATED PART. DO NOT EDIT BELOW THIS POINT# +############################################################ +"]; + End[]; EndPackage[]; diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index 2001eeb..29416a3 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -223,7 +223,7 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ InfoMessage[Terse, "Creating schedule file"]; schedule = CreateKrancScheduleFile[calcs, groups, Join[evolvedGroups,evolvedODEGroups], Join[rhsGroups,rhsODEGroups], Join[nonevolvedGroups,nonevolvedODEGroups], thornName, - evolutionTimelevels]; + evolutionTimelevels,opts]; (* Construct the cakernel file *) If[OptionValue[UseCaKernel], @@ -293,6 +293,8 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ If[!OptionValue[UseCaKernel], calcFilenames, {}], Map[lookup[#, Filename] &, boundarySources]]]; + If[OptionValue[UseCaKernel], make = {make, CaKernelEpilogue[]}]; + (* Put all the above together and generate the Cactus thorn *) thornspec = {Name -> thornName, Directory -> parentDirectory, diff --git a/Tools/CodeGen/Schedule.m b/Tools/CodeGen/Schedule.m index 87604b1..f58adc8 100644 --- a/Tools/CodeGen/Schedule.m +++ b/Tools/CodeGen/Schedule.m @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) -BeginPackage["Schedule`", {"Thorn`", "KrancGroups`", "MapLookup`", "Errors`", "Helpers`", "Kranc`"}]; +BeginPackage["Schedule`", {"Thorn`", "KrancGroups`", "MapLookup`", "Errors`", "Helpers`", "Kranc`", "CaKernel`"}]; CreateKrancScheduleFile; @@ -184,8 +184,9 @@ scheduleCalc[calc_, groups_] := bcGroupSched["in "<>groupName <> " after " <> lookup[calc, Name]], bcGroupSched["in MoL_PseudoEvolutionBoundaries after MoL_PostStep"]},{}]]]]; +Options[CreateKrancScheduleFile] = ThornOptions; CreateKrancScheduleFile[calcs_, groups_, evolvedGroups_, rhsGroups_, nonevolvedGroups_, thornName_, - evolutionTimelevels_] := + evolutionTimelevels_, opts:OptionsPattern[]] := Module[{scheduledCalcs, scheduledStartup, scheduleMoLRegister, globalStorageGroups, scheduledFunctions, schedule}, scheduledCalcs = Flatten[Map[scheduleCalc[#, groups] &, calcs], 1]; @@ -236,6 +237,9 @@ CreateKrancScheduleFile[calcs_, groups_, evolvedGroups_, rhsGroups_, nonevolvedG schedule = CreateSchedule[globalStorageGroups, CactusBoundary`GetScheduledGroups[thornName], scheduledFunctions]; + If[OptionValue[UseCaKernel], + schedule = {schedule, CaKernelEpilogue[]}]; + Return[schedule]]; End[]; |