示例#1
0
    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
示例#2
0
    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
示例#3
0
 def engine_make_targets_comm(self, msg):
     targets = msg[1]
     make_targets_comm(targets)
示例#4
0
 def engine_make_targets_comm(self, msg):
     targets = msg[1]
     make_targets_comm(targets)