Commit a0d7442c authored by Leigh B Stoller's avatar Leigh B Stoller

Change arguments to GetEventState(). Add HasStartupAgent() method.

Make all arguments to GetEventState() optional.  HasStartupAgent() look
in the program agent and event list, for programs that have been
scheduled to start at time=0.
parent f1ab375d
......@@ -946,7 +946,7 @@ sub GetAllocState($$)
#
# We do this cause we always want to go to the DB.
#
sub GetEventState($$;$)
sub GetEventState($;$$)
{
my ($self, $pstate, $popmode) = @_;
my $node_id = $self->node_id();
......@@ -965,7 +965,8 @@ sub GetEventState($$;$)
$self->{'DBROW'}->{'eventstate'} = $state
if (defined($self->{'DBROW'}));
$$pstate = $state;
$$pstate = $state
if (defined($pstate));
$$popmode= $op_mode
if (defined($popmode));
return 0;
......@@ -1325,6 +1326,7 @@ sub sharing_mode($) { return L__reservation($_[0], 'sharing_mode'); }
sub erole($) { return L__reservation($_[0], 'erole'); }
sub eid($) { return L__reservation($_[0], 'eid'); }
sub pid($) { return L__reservation($_[0], 'pid'); }
sub exptidx($) { return L__reservation($_[0], 'exptidx'); }
sub genisliver_idx($) { return L__reservation($_[0], 'genisliver_idx'); }
sub external_resource_index($) {
return L__reservation($_[0], 'external_resource_index'); }
......@@ -4288,5 +4290,19 @@ sub RusageData($)
return $blob;
}
sub HasStartupAgent($)
{
my ($self) = @_;
my $vname = $self->vname();
my $exptidx = $self->exptidx();
my $query_result =
DBQueryWarn("select arguments from eventlist ".
"where exptidx='$exptidx' and vnode='$vname' and time=0");
return 0
if (!$query_result);
return $query_result->numrows;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
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