Commit 3a393a2d authored by Gary Wong's avatar Gary Wong

Add a -f option to nalloc, to force allocation (overriding admission control).

A handful of code paths now use the new option to handle infrastructure
tasks where doing the right thing is more important than preserving
guarantees about future reservations (e.g., shuffling around holding
experiments, moving to hwdown, etc.).
parent d0e4646d
......@@ -34,13 +34,15 @@ use Getopt::Std;
#
sub usage()
{
print("Usage: nalloc [-d] [-p] <pid> <eid> <node> <node> <...>\n".
print("Usage: nalloc [-d] [-f] [-p] <pid> <eid> <node> <node> <...>\n".
" -p enables partial allocation mode\n".
" -f forces allocation, overriding admission control\n" .
" -d enables debugging output\n");
exit(-1);
}
my $optlist = "dp";
my $optlist = "dfp";
my $debug = 0;
my $force = 0;
my $partial = 0;
#
......@@ -84,6 +86,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"d"})) {
$debug = 1;
}
if (defined($options{"f"})) {
$force = 1;
}
if (defined($options{"p"})) {
$partial = 1;
}
......@@ -262,6 +267,13 @@ foreach my $type ( keys( %types ) ) {
}
if( !Reservation->IsFeasible( $reservations, \$error ) ) {
print "Admission control violation for type $type: $error\n";
if( $force ) {
print "Forcing allocation anyway...\n";
print STDERR "WARNING: SCHEDULED RESERVATIONS ARE NOW INFEASIBLE!\n";
# FIXME notify admins about violation
} else {
# FIXME once we enforce admission control, we will abort here!
}
goto admissionfailure;
}
}
......
......@@ -5305,7 +5305,7 @@ sub AllocNodes($)
tberror("Could not move nodes to old reserved holding\n");
return -1;
}
system("$NALLOC $pid $eid @nodeids");
system("$NALLOC -f $pid $eid @nodeids");
if ($?) {
tberror("Could not move nodes back from old reserved holding\n");
return -1;
......
......@@ -309,7 +309,7 @@ foreach my $node (@nodes) {
else {
$eid = $RELOADEID;
}
my $cmd = "$nalloc $RELOADPID $eid $pc";
my $cmd = "$nalloc -f $RELOADPID $eid $pc";
if ( system($cmd) != 0 ) {
print STDERR "WARNING: Could not reserve $pc!\n";
......
......@@ -541,7 +541,7 @@ NODE: foreach my $node_id (@node_ids) {
# Put it into hwdown for now - I would put them in reloading, but I'm
# afraid the reload_daemon might do the wrong thing to them
#
system "$nalloc $pid $eid $node_id";
system "$nalloc -f $pid $eid $node_id";
#
# Remove the node from the new_ tables
......
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