Commit f7024783 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add -f (force) option to start a scheduler even when no static events.

Note, this is going to change soon when we make dynamic events real;
will need to start a scheduler with every experiment.
parent e4e77091
......@@ -12,10 +12,11 @@ use POSIX ":sys_wait_h";
#
sub usage()
{
print STDOUT "Usage: eventsys_control <start|stop|replay> <pid> <eid>\n";
print STDOUT
"Usage: eventsys_control [-f] <start|stop|replay> <pid> <eid>\n";
exit(-1);
}
my $optlist = "d";
my $optlist = "df";
#
# Configure variables
......@@ -50,6 +51,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $evsched = "$TB/sbin/event-sched";
my $debug = 0;
my $force = 0;
my $expstate;
#
......@@ -66,6 +68,9 @@ if (@ARGV != 3) {
if (defined($options{"d"})) {
$debug = 1;
}
if (defined($options{"f"})) {
$force = 1;
}
my $action = $ARGV[0];
my $pid = $ARGV[1];
my $eid = $ARGV[2];
......@@ -197,13 +202,16 @@ if ($procid != 0) {
#
# For now, lets not start an event system if there are no events.
#
$query_result =
DBQueryFatal("select distinct pid,eid from eventlist ".
"where pid='$pid' and eid='$eid'");
if (! $force) {
$query_result =
DBQueryFatal("select distinct pid,eid from eventlist ".
"where pid='$pid' and eid='$eid'");
if (! $query_result->numrows) {
print "*** There are no events for $pid/$eid. Not starting a scheduler.\n";
exit(0);
if (! $query_result->numrows) {
print("*** There are no events for $pid/$eid. ".
"Not starting a scheduler.\n");
exit(0);
}
}
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment