Commit db959f35 authored by Mike Hibler's avatar Mike Hibler

Fix from several months back when retesting the auto-adaptation path:

make sure colocate factor does not end up null
parent bba09bd2
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2008 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -820,16 +820,15 @@ sub read_metis_partfile($$) {
#
sub run_metis($$$$;$) {
my ($metisfile,$nodes,$metisfilename,$metislogfile,$colocate) = @_;
if (!$colocate) {
$colocate = $AVG_NODES_PER_PARTITION;
}
print "run_metis called with colocate of $colocate\n";
# Pick a number of partitions such that the average parition size
# will be $AVG_NODES_PER_PARTITION
my $npart;
if ($colocate) {
$npart = POSIX::ceil(scalar(keys %$nodes) / $colocate);
} else {
$npart = POSIX::ceil(scalar(keys %$nodes) /$AVG_NODES_PER_PARTITION);
}
my $npart = POSIX::ceil(scalar(keys %$nodes) / $colocate);
if ($npart <= 1) {
# No point in running METIS, just give the list of nodes back
return [values(%$nodes)];
......@@ -990,7 +989,10 @@ sub node_fits_in_conglomerate($$) {
#
my $colocate = $::colocate{$type};
if (!$colocate) {
die "Don't know colocate factor for $node->{type}\n";
print "Don't know colocate factor for $node->{type}\n";
return 0;
#die "Don't know colocate factor for $node->{type}\n";
}
if (defined $max_multiplex_factor && ($colocate > $max_multiplex_factor)) {
$colocate = $max_multiplex_factor;
......
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