From a6a1158bcd853931538dafd7bca42784f87c0527 Mon Sep 17 00:00:00 2001 From: goodale Date: Fri, 28 Jan 2000 02:47:03 +0000 Subject: Now, subject to review, you can put OPTIONS:... in a schedule block to pass miscellaneous options to the schedular. Currently the only option is "Global" which sets a flag on the FunctionData structure passed to the call function. This option only makes sense for a scheduled function, not a schedule group, though this may change in the future. It is used to indicate to the calling function that this function should only be called once as it performs global operations. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1325 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/CreateScheduleBindings.pl | 19 ++++++++++++------- lib/sbin/ScheduleParser.pl | 15 +++++++++++---- 2 files changed, 23 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/sbin/CreateScheduleBindings.pl b/lib/sbin/CreateScheduleBindings.pl index 259473b1..cfe49ca3 100644 --- a/lib/sbin/CreateScheduleBindings.pl +++ b/lib/sbin/CreateScheduleBindings.pl @@ -255,6 +255,7 @@ sub ScheduleBlock my(@comm_groups); my(@trigger_groups); my(@sync_groups); + my(@options); my(@before_list); my(@after_list); my(@while_list); @@ -284,6 +285,8 @@ sub ScheduleBlock $rhschedule_db->{"\U$thorn\E BLOCK_$block SYNC"}, $rhinterface_db); + @options = split(/,/, $rhschedule_db->{"\U$thorn\E BLOCK_$block SYNC"}); + @before_list = &ScheduleSelectRoutines($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block BEFORE"}, $rhschedule_db); @@ -345,15 +348,17 @@ sub ScheduleBlock $buffer .= $indent . "\"" . $language . "\"" . ",\n"; } - $buffer .= $indent . scalar(@mem_groups) . ", /* Number of STORAGE groups */\n"; - $buffer .= $indent . scalar(@comm_groups) . ", /* Number of COMM groups */\n"; - $buffer .= $indent . scalar(@trigger_groups) . ", /* Number of TRIGGERS groups */\n"; - $buffer .= $indent . scalar(@sync_groups) . ", /* Number of SYNC groups */\n"; - $buffer .= $indent . scalar(@before_list) . ", /* Number of BEFORE routines */\n"; - $buffer .= $indent . scalar(@after_list) . ", /* Number of AFTER routines */\n"; + $buffer .= $indent . scalar(@mem_groups) . ", /* Number of STORAGE groups */\n"; + $buffer .= $indent . scalar(@comm_groups) . ", /* Number of COMM groups */\n"; + $buffer .= $indent . scalar(@trigger_groups) . ", /* Number of TRIGGERS groups */\n"; + $buffer .= $indent . scalar(@sync_groups) . ", /* Number of SYNC groups */\n"; + $buffer .= $indent . scalar(@options) . ", /* Number of Options */\n"; + $buffer .= $indent . scalar(@before_list) . ", /* Number of BEFORE routines */\n"; + $buffer .= $indent . scalar(@after_list) . ", /* Number of AFTER routines */\n"; $buffer .= $indent . scalar(@while_list) . " /* Number of WHILE variables */"; - foreach $item (@mem_groups, @comm_groups, @trigger_groups, @sync_groups, @before_list, @after_list, @while_list) + foreach $item (@mem_groups, @comm_groups, @trigger_groups, @sync_groups, + @options, @before_list, @after_list, @while_list) { $buffer .= ",\n" . $indent . "\"" . $item . "\"" ; } diff --git a/lib/sbin/ScheduleParser.pl b/lib/sbin/ScheduleParser.pl index 05f20b5e..8df7e9a2 100644 --- a/lib/sbin/ScheduleParser.pl +++ b/lib/sbin/ScheduleParser.pl @@ -90,7 +90,7 @@ sub parse_schedule_ccl ($line_number, $name, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $before_list, $after_list, $while_list) = &ParseScheduleBlock($line_number, @data); + $options,$before_list, $after_list, $while_list) = &ParseScheduleBlock($line_number, @data); $schedule_db{"\U$thorn\E BLOCK_$n_blocks NAME"} = $name; $schedule_db{"\U$thorn\E BLOCK_$n_blocks TYPE"} = $type; @@ -101,6 +101,7 @@ sub parse_schedule_ccl $schedule_db{"\U$thorn\E BLOCK_$n_blocks COMM"} = $comm_groups; $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 BEFORE"} = $before_list; $schedule_db{"\U$thorn\E BLOCK_$n_blocks AFTER"} = $after_list; $schedule_db{"\U$thorn\E BLOCK_$n_blocks WHILE"} = $while_list; @@ -148,7 +149,7 @@ sub ParseScheduleBlock my($line_number, @data) = @_; my($name, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $before_list, $after_list, $while_list); + $options, $before_list, $after_list, $while_list); my(@fields); my($field); my(@before_list) = (); @@ -157,7 +158,8 @@ sub ParseScheduleBlock my(@mem_groups) = (); my(@comm_groups) = (); my(@trigger_groups) = (); - my(@sync_groups) = (); + my(@sync_groups) = (); + my(@options) = (); my($keyword) = ""; my(@current_sched_list) = (); @@ -364,6 +366,10 @@ sub ParseScheduleBlock { push(@sync_groups, split(/\s,/, $1)); } + elsif($data[$line_number] =~ m/^\s*OPTI[^:]*:\s*(.*)$/i) + { + push(@options, split(/\s,/, $1)); + } elsif($data[$line_number] =~ m/^\s*LANG[^:]*:\s*(.*)$/i) { if($language ne "") @@ -403,6 +409,7 @@ sub ParseScheduleBlock $comm_groups = join(",", @comm_groups); $trigger_groups = join(",", @trigger_groups); $sync_groups = join(",", @sync_groups); + $options = join(",", @options); $before_list = join(",", @before_list); $after_list = join(",", @after_list); $while_list = join(",", @while_list); @@ -411,7 +418,7 @@ sub ParseScheduleBlock return ($line_number, $name, $type, $description, $where, $language, $mem_groups, $comm_groups, $trigger_groups, $sync_groups, - $before_list, $after_list, $while_list); + $options,$before_list, $after_list, $while_list); } -- cgit v1.2.3