Commit 9da1d6bb authored by Leigh B Stoller's avatar Leigh B Stoller

Several changes:

1. Do not pass -u option (update mode) to the mapper call in GetTicket, if
   not actually an update. This will now cause the mapper to pass the -F
   option to assign, so that fixnode (by the user rspec) will not override
   normal constraint checking.

2. MAINSITE: Add d820-explicit desire so we can actually use the shared
   node pool.

3. Add checks for out of memory errors from assign, and pass that back for
   the caller.
parent 41608a1a
......@@ -1536,6 +1536,12 @@ sub GetTicketAuxAux($$$$$$$$$$)
"desire" => "pcshared",
"weight" => 0.95})
if (!defined($exclusive) || !$exclusive);
$virtexperiment->NewTableRow("virt_node_desires",
{"vname" => $node_nickname,
"desire" => "d820-explicit",
"weight" => 0.95})
if ($MAINSITE && !defined($exclusive) || !$exclusive);
#
# Special hack for allocating from a specific chassis.
......@@ -2390,9 +2396,16 @@ sub GetTicketAuxAux($$$$$$$$$$)
goto bad;
}
$slice_experiment->CleanLogFiles();
#
# When doing an initial allocation, we do not want fixnode to bypass
# normal assign constraint checking, so do not use update mode
# (the mapper will pass internal option to assign to prevent fixnode).
#
my $aopts = ($isupdate ? "-u" : "");
$output =
GeniUtil::ExecQuiet("$MAPPER -a -d -v -u -z -o $tmpfile $pid $eid");
GeniUtil::ExecQuiet("$MAPPER -a -d -v $aopts -z -o $tmpfile $pid $eid");
if ($?) {
my $logstuff = "";
my $errorstr = "";
......@@ -2402,6 +2415,7 @@ sub GetTicketAuxAux($$$$$$$$$$)
my $inviolations = 0;
my $precheck;
my $inprecheck = 0;
my $insummary = 0;
my $errorcode = GENIRESPONSE_ERROR;
unlink($tmpfile);
......@@ -2432,6 +2446,17 @@ sub GetTicketAuxAux($$$$$$$$$$)
$inprecheck = 1;
$precheck = "";
}
elsif ($line =~ /Summary:$/) {
$insummary = 1;
}
elsif ($line =~ /End Summary$/) {
$insummary = 0;
}
elsif ($insummary &&
$line =~ /ram: used=(\d+) total=(\d+)/ && $1 > $2) {
$errorstr = "Not enough memory";
$errorcode = GENIRESPONSE_INSUFFICIENT_MEMORY();
}
elsif (!defined($violations) &&
$line =~ /Violations:\s*(\d*)/ && $1 != 0) {
$violations = "";
......
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