Commit 249b1947 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Fix for oldreservedclean switcheroo; do not nfree/nalloc the

shared host.

Remove some code that snuck into last revision; does not work yet.
parent df184959
...@@ -93,11 +93,12 @@ sub Create($$$$) ...@@ -93,11 +93,12 @@ sub Create($$$$)
$self->{'CURRENT_V2P'} = {}; $self->{'CURRENT_V2P'} = {};
$self->{'CURRENT_P2V'} = {}; $self->{'CURRENT_P2V'} = {};
$self->{'CURRENT_V2V'} = {}; $self->{'CURRENT_V2V'} = {};
$self->{'OLDRSRVCLEAN_FLAG'} = 0;
$self->{'OLDRSRVCLEAN_NODES'} = {};
# Below is for interpretation of assign results. # Below is for interpretation of assign results.
$self->{'PNODES'} = {}; $self->{'PNODES'} = {};
$self->{'SOLUTION'} = {}; $self->{'SOLUTION'} = {};
$self->{'OLDRSRVCLEAN'}= 0;
$self->{'NEWRESERVED'} = {}; # Newly reserved nodes. $self->{'NEWRESERVED'} = {}; # Newly reserved nodes.
$self->{'NORECOVER'} = 0; $self->{'NORECOVER'} = 0;
...@@ -132,6 +133,7 @@ sub pnodes($) { return $_[0]->{'PNODES'}; } ...@@ -132,6 +133,7 @@ sub pnodes($) { return $_[0]->{'PNODES'}; }
sub fixednodes($) { return $_[0]->{'FIXEDNODES'}; } sub fixednodes($) { return $_[0]->{'FIXEDNODES'}; }
sub newreserved($) { return $_[0]->{'NEWRESERVED'}; } sub newreserved($) { return $_[0]->{'NEWRESERVED'}; }
sub newreservednodes($) { return keys(%{ $_[0]->{'NEWRESERVED'} }); } sub newreservednodes($) { return keys(%{ $_[0]->{'NEWRESERVED'} }); }
sub oldreservednodes($) { return $_[0]->{'OLDRSRVCLEAN_NODES'}; }
sub norecover($) { return $_[0]->{'norecover'}; } sub norecover($) { return $_[0]->{'norecover'}; }
sub pid($) { return $_[0]->experiment()->pid(); } sub pid($) { return $_[0]->experiment()->pid(); }
sub pid_idx($) { return $_[0]->experiment()->pid_idx(); } sub pid_idx($) { return $_[0]->experiment()->pid_idx(); }
...@@ -688,6 +690,15 @@ sub LoadCurrentResources($) ...@@ -688,6 +690,15 @@ sub LoadCurrentResources($)
# Mark the node as unused until later. # Mark the node as unused until later.
$pnode->_reuse("unused"); $pnode->_reuse("unused");
$ppnode->_reuse("unused"); $ppnode->_reuse("unused");
#
# Add the pnode node to the oldreserved list for nfree.
# See the comment below. We cannot use p2v because we
# might not own all those nodes, if on a shared node.
# We do not add the ppnode. It will get added in the
# next clause if we actually own it.
#
$self->oldreservednodes()->{$pnode->node_id()} = $pnode;
$self->printdb("current v2p: $node_id ($ppnode_id) -> $vname\n"); $self->printdb("current v2p: $node_id ($ppnode_id) -> $vname\n");
} }
...@@ -713,6 +724,13 @@ sub LoadCurrentResources($) ...@@ -713,6 +724,13 @@ sub LoadCurrentResources($)
# Mark the node as unused until later. # Mark the node as unused until later.
$pnode->_reuse("unused"); $pnode->_reuse("unused");
#
# Add the pnode node to the oldreserved list for nfree.
# See the comment below. We cannot use p2v because we
# might not own all those nodes, if on a shared node.
#
$self->oldreservednodes()->{$pnode->node_id()} = $pnode;
$self->printdb("current v2p: $node_id -> $vname\n"); $self->printdb("current v2p: $node_id -> $vname\n");
} }
} }
...@@ -2967,7 +2985,7 @@ sub AllocNodes($) ...@@ -2967,7 +2985,7 @@ sub AllocNodes($)
# mapping. # mapping.
# #
# Another reason to do this just before nalloc of a new toreserve # Another reason to do this just before nalloc of a new toreserve
# nodes is that, we can get into name clashes For example, lets # nodes is that, we can get into name clashes. For example, lets
# say the user called his node pc2 and it was actually mapped to # say the user called his node pc2 and it was actually mapped to
# pc99 in the initial swapin. If this was a swapmod where the user # pc99 in the initial swapin. If this was a swapmod where the user
# asked for another node node0 which got mapped to pc2. nalloc of # asked for another node node0 which got mapped to pc2. nalloc of
...@@ -2983,8 +3001,8 @@ sub AllocNodes($) ...@@ -2983,8 +3001,8 @@ sub AllocNodes($)
# called coz only some pnode resources got nalloced, we do not # called coz only some pnode resources got nalloced, we do not
# have to do the above again. # have to do the above again.
# #
my @nodeids = keys(%{ $self->current_p2v() }); my @nodeids = keys(%{ $self->oldreservednodes() });
if (@nodeids && !$self->{'OLDRSRVCLEAN'}) { if (@nodeids && !$self->{'OLDRSRVCLEAN_FLAG'}) {
system("$NFREE -o $pid $eid @nodeids"); system("$NFREE -o $pid $eid @nodeids");
if ($?) { if ($?) {
tberror("Could not move nodes to old reserved holding\n"); tberror("Could not move nodes to old reserved holding\n");
...@@ -2995,7 +3013,7 @@ sub AllocNodes($) ...@@ -2995,7 +3013,7 @@ sub AllocNodes($)
tberror("Could not move nodes back from old reserved holding\n"); tberror("Could not move nodes back from old reserved holding\n");
return -1; return -1;
} }
$self->{'OLDRSRVCLEAN'} = 1; $self->{'OLDRSRVCLEAN_FLAG'} = 1;
} }
# #
...@@ -3128,12 +3146,12 @@ sub AllocNodes($) ...@@ -3128,12 +3146,12 @@ sub AllocNodes($)
} }
$pnode->FlushReserved(); $pnode->FlushReserved();
my $reservation = $pnode->Reservation(); my $reservation = $pnode->Reservation();
if (! (defined($reservation) && # if (! (defined($reservation) &&
defined($pnode->sharing_mode()) && # defined($pnode->sharing_mode()) &&
$pnode->sharing_mode() eq "shared_local")) { # $pnode->sharing_mode() eq "shared_local")) {
tbinfo("$pnode is not in shared mode.\n"); # tbinfo("$pnode is not in shared mode.\n");
$rerun++; # $rerun++;
} # }
} }
return 1 return 1
if ($rerun); if ($rerun);
......
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