diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-07-16 18:30:55 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-07-16 18:30:55 +0100 |
commit | 5517e8cc4cd619864a1e17a304933aba35d8271e (patch) | |
tree | 7b464403465379462f14b3ae1659b505e9829c11 /Tools/CodeGen | |
parent | 5aabf352af333e3ef20c031f42beeafee2c4f07c (diff) |
Schedule.m: Add Before and After options to calculations
These can be set to the names of functions or groups to perform relative scheduling.
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/Schedule.m | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Tools/CodeGen/Schedule.m b/Tools/CodeGen/Schedule.m index a2d5027..f2a0e2f 100644 --- a/Tools/CodeGen/Schedule.m +++ b/Tools/CodeGen/Schedule.m @@ -66,7 +66,7 @@ scheduleCalc[calc_, groups_] := Module[{points, conditional, conditionals, keywordConditional, keywordConditionals, triggered, keyword, value, keywordvaluepairs, groupsToSync, groupName, userSchedule, groupSched, fnSched, - selbcSched, appbcSched, bcGroupName, condParams, bcGroupSched}, + selbcSched, appbcSched, bcGroupName, condParams, bcGroupSched, before, after, relStr}, conditional = mapContains[calc, ConditionalOnKeyword]; conditionals = mapContains[calc, ConditionalOnKeywords]; triggered = mapContains[calc, TriggerGroups]; @@ -93,13 +93,19 @@ scheduleCalc[calc_, groups_] := groupsSetInCalc[calc, groups], {}]; + before = lookupDefault[calc, Before, None]; + after = lookupDefault[calc, After, None]; + + relStr = If[before =!= None, " before " <> before, ""] + <> If[after =!= None, " after " <> after, ""]; + userSchedule = lookupDefault[calc, Schedule, Automatic]; If[userSchedule =!= Automatic, Return[Map[ Join[ { Name -> lookup[calc, Name], - SchedulePoint -> #, + SchedulePoint -> # <> relStr, SynchronizedGroups -> If[StringMatchQ[#, "*MoL_CalcRHS*", IgnoreCase -> True] || StringMatchQ[#, "*MoL_RHSBoundaries*", IgnoreCase -> True], {}, groupsToSync], @@ -131,7 +137,7 @@ scheduleCalc[calc_, groups_] := groupSched = { Name -> "group " <> groupName, - SchedulePoint -> "in MoL_PseudoEvolution", + SchedulePoint -> "in MoL_PseudoEvolution" <> relStr, SynchronizedGroups -> {}, Language -> "None", Comment -> lookup[calc, Name] |