Commit e1b093f7 authored by Robert Ricci's avatar Robert Ricci
Browse files

Add a '-a' flag to include all nodes, acting as if everything is free.

Intended for debugging, and to use used with assign's pre-check
feature to catch experiments that will never be mappable.
parent 10b0d903
...@@ -18,14 +18,16 @@ sub usage() ...@@ -18,14 +18,16 @@ sub usage()
" -v Include stuff for topologies with virtual nodes\n". " -v Include stuff for topologies with virtual nodes\n".
" -r Include stuff for topologies with widearea nodes\n". " -r Include stuff for topologies with widearea nodes\n".
" -s Include stuff for topologies with simulated nodes\n". " -s Include stuff for topologies with simulated nodes\n".
" -a Include even reserved nodes\n".
" -m Override multiplex_factor\n"); " -m Override multiplex_factor\n");
exit(-1); exit(-1);
} }
my $optlist = "s:e:m:vp:rS"; my $optlist = "s:e:m:vp:rSa";
my $mfactor; my $mfactor;
my $virtstuff = 0; my $virtstuff = 0;
my $widearea = 0; my $widearea = 0;
my $simstuff = 0; my $simstuff = 0;
my $allnodes = 0;
# #
# Turn off line buffering on output # Turn off line buffering on output
...@@ -100,6 +102,9 @@ if (defined($options{"S"})) { ...@@ -100,6 +102,9 @@ if (defined($options{"S"})) {
if (defined($options{"p"})) { if (defined($options{"p"})) {
$pid = $options{"p"}; $pid = $options{"p"};
} }
if (defined($options{"a"})) {
$allnodes = 1;
}
if (defined($options{"e"})) { if (defined($options{"e"})) {
$exempt_eid = $options{"e"}; $exempt_eid = $options{"e"};
usage() usage()
...@@ -227,6 +232,12 @@ if (defined($exempt_eid)) { ...@@ -227,6 +232,12 @@ if (defined($exempt_eid)) {
"(b.pid='$pid' and b.eid='$exempt_eid'))"; "(b.pid='$pid' and b.eid='$exempt_eid'))";
} }
# If the user wants all nodes, we consider everything to be free (this
# overrides the other possible free conditions
if ($allnodes) {
$free_condition = "1";
}
$result = $result =
DBQueryFatal("select a.node_id,a.type,a.phys_nodeid,t.class,t.issubnode," . DBQueryFatal("select a.node_id,a.type,a.phys_nodeid,t.class,t.issubnode," .
"a.def_boot_osid, (b.pid is not null and b.eid is not null) " . "a.def_boot_osid, (b.pid is not null and b.eid is not null) " .
...@@ -370,7 +381,7 @@ foreach $node (keys(%nodes)) { ...@@ -370,7 +381,7 @@ foreach $node (keys(%nodes)) {
# This is for the case that we are modifying an existing experiment - tell # This is for the case that we are modifying an existing experiment - tell
# assign to prefer nodes the user has already allocated # assign to prefer nodes the user has already allocated
if ($exempt_eid && $is_reserved{$node}) { if ($exempt_eid && !$allnodes && $is_reserved{$node}) {
push(@features,"already_reserved:0"); push(@features,"already_reserved:0");
} }
...@@ -413,14 +424,9 @@ foreach $node (keys(%nodes)) { ...@@ -413,14 +424,9 @@ foreach $node (keys(%nodes)) {
# physnode. # physnode.
# #
if ($widearea) { if ($widearea) {
# my $free_condition = "b.node_id is null";
# If we are spposed to exempt a certain eid from being considered down, if ($allnodes) {
# build up a clause to do that - we consider all nodes already used by that $free_condition = "1";
# experiment to be available
#
my $exempt_condition = "0";
if (defined($exempt_eid)) {
$free_condition = "(r.pid='$pid' and r.eid='$exempt_eid')";
} }
$result = $result =
DBQueryFatal("select count(a.node_id),a.phys_nodeid,aa.type, ". DBQueryFatal("select count(a.node_id),a.phys_nodeid,aa.type, ".
...@@ -435,7 +441,7 @@ if ($widearea) { ...@@ -435,7 +441,7 @@ if ($widearea) {
"left join widearea_nodeinfo as wn on ". "left join widearea_nodeinfo as wn on ".
" wn.node_id=a.phys_nodeid ". " wn.node_id=a.phys_nodeid ".
"where (a.role='virtnode' and t.isremotenode=1 and ". "where (a.role='virtnode' and t.isremotenode=1 and ".
" b.node_id is null) ". " $free_condition) ".
"group by a.phys_nodeid"); "group by a.phys_nodeid");
while (($count,$physnode,$ptype,$status,$mpid,$meid,$site) while (($count,$physnode,$ptype,$status,$mpid,$meid,$site)
......
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