diff options
author | hinder <hinder@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-01-31 19:18:30 +0000 |
---|---|---|
committer | hinder <hinder@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-01-31 19:18:30 +0000 |
commit | 100c3733a8d90eadc785becbd48494c7dfa67c73 (patch) | |
tree | a2212ae951d3132ea646b98329d799929ea8e8f2 /lib/sbin/ScheduleParser.pl | |
parent | a2309eb58c5107a4afdac9aaa2d044a7680242ce (diff) |
Merge branch 'NewSchedule' into trunk
This provides support for specifying READS and WRITES clauses for each
function scheduled in schedule.ccl. These list the variables which
the scheduled function reads from or writes to. This supports future
dependency-based scheduling. See
https://docs.einsteintoolkit.org/et-docs/Adding_requirements_to_the_Cactus_scheduler
for more information.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4788 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ScheduleParser.pl')
-rw-r--r-- | lib/sbin/ScheduleParser.pl | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/lib/sbin/ScheduleParser.pl b/lib/sbin/ScheduleParser.pl index 9fdff5f5..7670b19d 100644 --- a/lib/sbin/ScheduleParser.pl +++ b/lib/sbin/ScheduleParser.pl @@ -113,7 +113,8 @@ sub parse_schedule_ccl my($n_statements); my($name, $as, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $options, $before_list, $after_list, $while_list, $if_list); + $options, $tags, $before_list, $after_list, + $writes_list, $reads_list, $while_list, $if_list); my($groups); $buffer = ""; @@ -127,8 +128,9 @@ sub parse_schedule_ccl ($line_number, $name, $as, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $options,$before_list, $after_list, $while_list, $if_list) - = &ParseScheduleBlock($thorn,$line_number, @data); + $options, $tags, $before_list, $after_list, + $writes_list, $reads_list, $while_list, $if_list) = + &ParseScheduleBlock($thorn,$line_number, @data); $schedule_db{"\U$thorn\E BLOCK_$n_blocks NAME"} = $name; $schedule_db{"\U$thorn\E BLOCK_$n_blocks AS"} = $as; @@ -141,8 +143,11 @@ sub parse_schedule_ccl $schedule_db{"\U$thorn\E BLOCK_$n_blocks TRIG"} = $trigger_groups; $schedule_db{"\U$thorn\E BLOCK_$n_blocks SYNC"} = $sync_groups; $schedule_db{"\U$thorn\E BLOCK_$n_blocks OPTIONS"} = $options; + $schedule_db{"\U$thorn\E BLOCK_$n_blocks TAGS"} = $tags; $schedule_db{"\U$thorn\E BLOCK_$n_blocks BEFORE"} = $before_list; $schedule_db{"\U$thorn\E BLOCK_$n_blocks AFTER"} = $after_list; + $schedule_db{"\U$thorn\E BLOCK_$n_blocks WRITES"} = $writes_list; + $schedule_db{"\U$thorn\E BLOCK_$n_blocks READS"} = $reads_list; $schedule_db{"\U$thorn\E BLOCK_$n_blocks WHILE"} = $while_list; $schedule_db{"\U$thorn\E BLOCK_$n_blocks IF"} = $if_list; @@ -196,11 +201,14 @@ sub ParseScheduleBlock my($thorn,$line_number, @data) = @_; my($name, $as, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $options, $before_list, $after_list, $while_list, $if_list); + $options, $tags, $before_list, $after_list, + $writes_list, $reads_list, $while_list, $if_list); my(@fields); my($field); my(@before_list) = (); my(@after_list) = (); + my(@writes_list) = (); + my(@reads_list) = (); my(@while_list) = (); my(@if_list) = (); my(@mem_groups) = (); @@ -208,6 +216,7 @@ sub ParseScheduleBlock my(@trigger_groups) = (); my(@sync_groups) = (); my(@options) = (); + my(@tags) = (); my($keyword) = ""; my(@current_sched_list) = (); @@ -467,10 +476,22 @@ sub ParseScheduleBlock { push(@sync_groups, split(/\s+|\s*,\s*/, $1)); } + elsif($data[$line_number] =~ m/^\s*WRITES\s*:\s*(.*)$/i) + { + push(@writes_list, split(/\s+|\s*,\s*/, $1)); + } + elsif($data[$line_number] =~ m/^\s*READS\s*:\s*(.*)$/i) + { + push(@reads_list, split(/\s+|\s*,\s*/, $1)); + } elsif($data[$line_number] =~ m/^\s*OPTI[^:]*:\s*(.*)$/i) { push(@options, split(/\s+|\s*,\s*/, $1)); } + elsif($data[$line_number] =~ m/^\s*TAGS[^:]*:\s*(.*)$/i) + { + push(@tags, $1); + } elsif($data[$line_number] =~ m/^\s*LANG[^:]*:\s*(.*)$/i) { if($language ne "") @@ -518,8 +539,11 @@ sub ParseScheduleBlock $trigger_groups = join(",", @trigger_groups); $sync_groups = join(",", @sync_groups); $options = join(",", @options); + $tags = join(" ", @tags); $before_list = join(",", @before_list); $after_list = join(",", @after_list); + $writes_list = join(",", @writes_list); + $reads_list = join(",", @reads_list); $while_list = join(",", @while_list); $if_list = join(",", @if_list); @@ -527,7 +551,8 @@ sub ParseScheduleBlock return ($line_number, $name, $as, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $options,$before_list, $after_list, $while_list, $if_list); + $options, $tags, $before_list, $after_list, + $writes_list, $reads_list, $while_list, $if_list); } |