diff --git a/starcluster/balancers/sge/__init__.py b/starcluster/balancers/sge/__init__.py index ca6f31f17..411da041a 100644 --- a/starcluster/balancers/sge/__init__.py +++ b/starcluster/balancers/sge/__init__.py @@ -234,11 +234,19 @@ def slots_per_host(self): if total == 0: return total single = 0 + master = 1 for q in self.queues: - if q.startswith('all.q@'): + # The 'master' is allowed to have a different instance type + # than the others and therefore this should be accounted for. + if q == 'all.q@master': + master = self.queues[q]['slots'] + elif q.startswith('all.q@'): single = self.queues.get(q).get('slots') break - if (total != (single * len(self.hosts))): + else: + log.warning('No [non-master] queue found') + return -1 + if total != (master + single * (len(self.hosts) - 1)): raise exception.BaseException( "ERROR: Number of slots not consistent across cluster") return single