All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit eb61a9a9 authored by Gary Wong's avatar Gary Wong

Fix bug causing spurious violations during swap-ins within a reservation.

parent 449d1337
......@@ -218,6 +218,11 @@ sub Stringify($)
my ($self) = @_;
my $pid = $self->pid();
$pid = "(free)" if( !defined( $pid ) );
if( defined( $self->eid() ) ) {
$pid = $pid . "/" . $self->eid();
}
my $nodes = $self->nodes();
my $type = $self->type();
my $start = defined( $self->start() ) ? localtime( $self->start() ) :
......
......@@ -268,19 +268,28 @@ foreach my $type ( keys( %types ) ) {
next if( $unavail_types{ $type } );
my $reservations = Reservation->LookupAll( $type );
my $count = 0;
foreach my $node (@nodes) {
if( $node->type() eq $type ) {
my $res = Reservation->CreateImmediate( $pid, undef,
$this_user->uid(),
$endtime, $type, 1 );
if ($debug) {
print "$res\n";
}
push( @$reservations, $res );
}
$count++ if( $node->type() eq $type );
}
my $res = Reservation->CreateImmediate( $pid, $eid,
$this_user->uid(),
$endtime, $type, $count );
if ($debug) {
print "$res\n";
}
push( @$reservations, $res );
if( !Reservation->IsFeasible( $reservations, \$errormsg ) ) {
print "Admission control violation for type $type: $errormsg\n";
if( $debug ) {
foreach my $res (@$reservations) {
print "$res\n";
}
}
if( $force ) {
print "Forcing allocation anyway...\n";
......
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