summaryrefslogtreecommitdiff
path: root/lib/sbin/ScheduleParser.pl
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2006-12-06 13:34:12 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2006-12-06 13:34:12 +0000
commit84539b0399db79503f78b5aace1a63bb1dc51dc7 (patch)
tree2346b7965243c1f0657a86f68ae1e0f7b717adf2 /lib/sbin/ScheduleParser.pl
parentb02fcef07fe90a7d1964fb1afc7fc832a7307db6 (diff)
Define all possible schedule bins in a single place.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4390 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ScheduleParser.pl')
-rw-r--r--lib/sbin/ScheduleParser.pl38
1 files changed, 35 insertions, 3 deletions
diff --git a/lib/sbin/ScheduleParser.pl b/lib/sbin/ScheduleParser.pl
index fba13bd3..8956a48f 100644
--- a/lib/sbin/ScheduleParser.pl
+++ b/lib/sbin/ScheduleParser.pl
@@ -9,6 +9,39 @@
# @version $Header$
#@@*/
+# The known schedule bins
+our @schedule_bins = (
+ # Cactus startup
+ 'STARTUP',
+ 'WRAGH',
+ 'PARAMCHECK',
+ # Initialisation
+ 'BASEGRID',
+ 'INITIAL',
+ 'POSTINITIAL',
+ # Recovery
+ 'RECOVER_VARIABLES',
+ 'POST_RECOVER_VARIABLES',
+ 'RECOVER_PARAMETERS',
+ 'CPINITIAL',
+ # Evolution
+ 'PREREGRID',
+ 'POSTREGRID',
+ 'PRESTEP',
+ 'EVOL',
+ 'POSTRESTRICT',
+ 'POSTSTEP',
+ 'CHECKPOINT',
+ 'ANALYSIS',
+ # Shutdown
+ 'TERMINATE',
+ 'SHUTDOWN');
+# A regular expression matching all possible schedule bins, including
+# a CCTK prefix and in upper case
+our $schedule_bin_regexp = 'CCTK_(' . join ('|', @schedule_bins) . ')';
+
+
+
#/*@@
# @routine create_schedule_database
# @date Thu Sep 16 23:31:00 1999
@@ -229,7 +262,7 @@ sub ParseScheduleBlock
}
# check that the given schedule bin is recognized
- if ($where !~ m:CCTK_(STARTUP|WRAGH|PARAMCHECK|BASEGRID|INITIAL|POSTINITIAL|RECOVER_VARIABLES|POST_RECOVER_VARIABLES|RECOVER_PARAMETERS|CHECKPOINT|CPINITIAL|PREREGRID|POSTREGRID|PRESTEP|EVOL|POSTSTEP|POSTRESTRICT|ANALYSIS|TERMINATE|SHUTDOWN):)
+ if ($where !~ $schedule_bin_regexp)
{
&CST_error(0,"Schedule bin \'$where\' not recognised in schedule.ccl " .
"file of thorn $thorn","",__LINE__,__FILE__);
@@ -588,8 +621,7 @@ sub check_schedule_database
{
if ($allgroups !~ /$rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"}/)
{
-
- if ($rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} !~ m:CCTK_(STARTUP|WRAGH|PARAMCHECK|BASEGRID|INITIAL|POSTINITIAL|RECOVER_VARIABLES|POST_RECOVER_VARIABLES|RECOVER_PARAMETERS|CHECKPOINT|CPINITIAL|PREREGRID|POSTREGRID|PRESTEP|EVOL|POSTSTEP|POSTRESTRICT|ANALYSIS|TERMINATE|SHUTDOWN):)
+ if ($rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} !~ $schedule_bin_regexp)
{
$message = "Scheduling routine $rhschedule_db->{\"\U$thorn\E BLOCK_$block NAME\"} from thorn $thorn in non-existent group or timebin $rhschedule_db->{\"\U$thorn\E BLOCK_$block WHERE\"}";
$hint = "If this routine should be scheduled check the spelling of the group or timebin name. Note that scheduling IN must be used to schedule a routine to run in a thorn-defined schedule group, whereas scheduling AT is used for a usual timebin. (Schedule IN may also be used with the usual timebins, but in this case the full name of the bin must be used, e.g. CCTK_EVOL and not EVOL)";