Commit b59ea093 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Addd HasVirtNodes() and HasSharedNodes().

parent 83236320
......@@ -4597,6 +4597,51 @@ sub HasGeniNodes($)
return $query_result->num_rows;
}
#
# Does the experiment use any shared nodes.
#
sub HasSharedNodes($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (!ref($self));
my $idx = $self->idx();
my $query_result =
DBQueryFatal("select n.node_id from reserved as r ".
"left join nodes as n on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ".
"where r.exptidx=$idx and t.isvirtnode=1 and ".
" r.sharing_mode is not null");
return -1
if (!$query_result);
return $query_result->num_rows;
}
sub HasVirtNodes($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (!ref($self));
my $idx = $self->idx();
my $query_result =
DBQueryFatal("select n.node_id from reserved as r ".
"left join nodes as n on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ".
"where r.exptidx=$idx and t.isvirtnode=1");
return -1
if (!$query_result);
return $query_result->num_rows;
}
#
# Set/Unset the lockdown bit.
#
......
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