From 2b1a68706ebda4773d5c728594f73ab52304097a Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Fri, 27 May 2011 16:48:12 +0200 Subject: [PATCH] resourcealloc improvement: also force selection when the hamming cardinality is 1 (ie: only one partition to choose from) --- src/nepi/testbeds/planetlab/resourcealloc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nepi/testbeds/planetlab/resourcealloc.py b/src/nepi/testbeds/planetlab/resourcealloc.py index 87edbe53..bafde65a 100644 --- a/src/nepi/testbeds/planetlab/resourcealloc.py +++ b/src/nepi/testbeds/planetlab/resourcealloc.py @@ -165,7 +165,8 @@ def alloc(requests, logstream = None, nonseparable = False, saveinteresting = No # Do backtracking on those whose cardinality leaves a choice # Force a pick when it does not - if order and Gavail[order[0]] <= 1: + if order and (Gavail[order[0]] <= 1 + or classify.classCardinality(order[0]) <= 1): order = order[:1] for c in order: @@ -415,7 +416,7 @@ if __name__ == '__main__': except: print "ABORTING TEST" - print "Success rates:" + print "\nSuccess rates:" print " Mostly possible: %d/%d (%.2f%%)" % (suc_mostlypossible, mostlypossible, 100.0 * suc_mostlypossible / max(1,mostlypossible)) print " Mostly impossible: %d/%d (%.2f%%)" % (suc_mostlyimpossible, mostlyimpossible, 100.0 * suc_mostlyimpossible / max(1,mostlyimpossible)) print " Huge: %d/%d (%.2f%%)" % (suc_huge, huge, 100.0 * suc_huge / max(1,huge)) -- 2.47.0