Commit 85e545a4 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add TBIsNodeVirtual predicate, which checks node_id against the

node_types table (isvirtnode).
parent 47bdf7b9
...@@ -88,6 +88,7 @@ use Exporter; ...@@ -88,6 +88,7 @@ use Exporter;
TBSetSchedReload MapNodeOSID TBLockExp TBUnLockExp TBSetExpSwapTime TBSetSchedReload MapNodeOSID TBLockExp TBUnLockExp TBSetExpSwapTime
TBUnixGroupList TBOSID TBImageID TBdbfork VnameToNodeid TBExpLocked TBUnixGroupList TBOSID TBImageID TBdbfork VnameToNodeid TBExpLocked
TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile
TBIsNodeVirtual
); );
# Must come after package declaration! # Must come after package declaration!
...@@ -1549,6 +1550,30 @@ sub TBIsNodeRemote($) ...@@ -1549,6 +1550,30 @@ sub TBIsNodeRemote($)
return 0; return 0;
} }
#
# Is a node virtual (or "multiplexed").
#
# usage TBIsNodeVirtual(char *node)
# Returns 1 if yes.
# Returns 0 if no.
#
sub TBIsNodeVirtual($)
{
my ($nodeid) = @_;
my $query_result =
DBQueryFatal("select isvirtnode from node_types as t ".
"left join nodes as n on t.type=n.type ".
"where n.node_id='$nodeid'");
if (! $query_result->num_rows) {
return 0;
}
my @row = $query_result->fetchrow_array();
return($row[0]);
}
# #
# Set/Clear the current logfile for an experiment. The idea is to provide # Set/Clear the current logfile for an experiment. The idea is to provide
# a way to look at what is going on from the web interface! # a way to look at what is going on from the web interface!
......
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