diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-03-21 14:51:40 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-03-21 14:51:40 +0100 |
commit | c315e0dd637e5519d5bfc6e0ca21f05e69d1da1b (patch) | |
tree | 4e0005f0f98d4efa1f82a3b18a65c2ed93aeb713 /Tools/CodeGen/Schedule.m | |
parent | 6226a814b6fb9f56dc45496d4d92ca0c73f0ba8b (diff) |
Add generic Conditional key for calculations
Diffstat (limited to 'Tools/CodeGen/Schedule.m')
-rw-r--r-- | Tools/CodeGen/Schedule.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Tools/CodeGen/Schedule.m b/Tools/CodeGen/Schedule.m index b3a5868..aba7add 100644 --- a/Tools/CodeGen/Schedule.m +++ b/Tools/CodeGen/Schedule.m @@ -147,7 +147,8 @@ scheduleCalc[calc_, groups_, thornName_, OptionsPattern[]] := If[conditional, {Conditional -> {Parameter -> keyword, Value -> value}}, {}], If[conditionals, {Conditionals -> keywordvaluepairs}, - {}] + {}], + If[mapContains[calc, Conditional], {NewConditional -> lookup[calc,Conditional]}, {}] ] &, lookup[calc, Schedule]]], @@ -221,7 +222,7 @@ scheduleCalc[calc_, groups_, thornName_, OptionsPattern[]] := Options[CreateKrancScheduleFile] = ThornOptions; CreateKrancScheduleFile[calcs_, groups_, evolvedGroups_, rhsGroups_, nonevolvedGroups_, thornName_, evolutionTimelevels_, opts:OptionsPattern[]] := - Module[{scheduledCalcs, scheduledStartup, scheduleMoLRegister, globalStorageGroups, scheduledFunctions, schedule}, + Module[{scheduledCalcs, scheduledStartup, scheduleMoLRegister, globalStorageGroups, scheduledFunctions, schedule, allParams}, scheduledCalcs = Flatten[Map[scheduleCalc[#, groups, thornName, opts] &, calcs], 1]; scheduledStartup = @@ -272,8 +273,9 @@ CreateKrancScheduleFile[calcs_, groups_, evolvedGroups_, rhsGroups_, nonevolvedG If[OptionValue[UseCaKernel], scheduledFunctions = Join[scheduledFunctions, CaKernelSchedule[]]]; + allParams = Union@@((lookup[#,Parameters] &) /@ calcs); schedule = CreateSchedule[globalStorageGroups, - CactusBoundary`GetScheduledGroups[thornName], scheduledFunctions]; + CactusBoundary`GetScheduledGroups[thornName], scheduledFunctions, allParams]; Return[schedule]]; |