Skip to content

Commit

Permalink
Schedule.m: Add Before and After options to calculations
Browse files Browse the repository at this point in the history
These can be set to the names of functions or groups to perform relative scheduling.
  • Loading branch information
ianhinder committed Jul 16, 2011
1 parent 5aabf35 commit 5517e8c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Tools/CodeGen/Schedule.m
Expand Up @@ -66,7 +66,7 @@
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];
Expand All @@ -93,13 +93,19 @@
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],
Expand Down Expand Up @@ -131,7 +137,7 @@

groupSched = {
Name -> "group " <> groupName,
SchedulePoint -> "in MoL_PseudoEvolution",
SchedulePoint -> "in MoL_PseudoEvolution" <> relStr,
SynchronizedGroups -> {},
Language -> "None",
Comment -> lookup[calc, Name]
Expand Down

0 comments on commit 5517e8c

Please sign in to comment.