Esempio n. 1
0
def start_engines(jobs):
    """
    Starts the engines and performs some checks

    jobs: int
    """

    global tc_clients
   
    if ipy_version == 0.10:
        tc = client.TaskClient()
        mec = client.MultiEngineClient()
        eng_ids = mec.get_ids()
    else:
        if tc_clients is None:
            tc = client()
            eng_ids = tc.ids
            tc_clients = tc
        else:
            tc = tc_clients
            eng_ids = tc.ids

    #reset engines
    #mec.reset()
    assert eng_ids > 0, "No engine started"
    #assert eng_ids > jobs, "Not enough engines for the number of jobs required"

    return tc, eng_ids
Esempio n. 2
0
    def get_task_client(self):
        """Gets a task client for an ipcontroller

        Returns None if a valid connection could not be established.
        """
        if self.tc is not None:
            return self.tc

        # Create and return new task client
        tc = None
        try:
            tc = IPclient.TaskClient()
        except Exception, e:
            self.out('Could not connect to ipcontroller:\n%s: %s' %
                     (e.__class__.__name__, e.message),
                     error=True)