def make_subcomm(self, targets): if len(targets) > self.nengines: msg = ("The number of engines (%s) is less than the number of " "targets you want (%s)." % (self.nengines, len(targets))) raise ValueError(msg) if targets != sorted(targets): raise ValueError("targets must be in sorted order.") try: return self._comm_from_targets[tuple(targets)] except KeyError: pass msg = ('make_targets_comm', targets) self._send_msg(msg, targets=self.all_targets) new_comm = make_targets_comm(targets) self._comm_from_targets[tuple(targets)] = new_comm return new_comm
def engine_make_targets_comm(self, msg): targets = msg[1] make_targets_comm(targets)