Exemple #1
0
def worker_process(comm,status,tags,name):
    rank = comm.rank
    logging.info("I am a worker with rank %d on %s." % (rank, name))
    while True:
        comm.send(None, dest=0, tag=tags.READY)
        data = comm.recv(source=0, tag=MPI.ANY_TAG, status=status)
        tag = status.Get_tag()
        
        if tag == tags.START:
            # Do the work here
            d,eta,etaSum,alpha,bid = data
            delta_eta = _mworker.lda_worker(d,eta,etaSum,alpha)
            comm.send((delta_eta,bid), dest=0, tag=tags.DONE)
        elif tag == tags.EXIT:
            break

    comm.send(None, dest=0, tag=tags.EXIT)
Exemple #2
0
def worker_process(comm, status, tags, name):
    rank = comm.rank
    logging.info("I am a worker with rank %d on %s." % (rank, name))
    while True:
        comm.send(None, dest=0, tag=tags.READY)
        data = comm.recv(source=0, tag=MPI.ANY_TAG, status=status)
        tag = status.Get_tag()

        if tag == tags.START:
            # Do the work here
            d, eta, etaSum, alpha, bid = data
            delta_eta = _mworker.lda_worker(d, eta, etaSum, alpha)
            comm.send((delta_eta, bid), dest=0, tag=tags.DONE)
        elif tag == tags.EXIT:
            break

    comm.send(None, dest=0, tag=tags.EXIT)
Exemple #3
0
def asyn_workder(d,eta,etaSum,alpha):
    delta_eta = _mworker.lda_worker(d,eta,etaSum,alpha)
    return delta_eta
Exemple #4
0
def syn_worker(d, eta, etaSum, alpha, q):
    delta_eta = _mworker.lda_worker(d, eta, etaSum, alpha)
    q.put(delta_eta)
Exemple #5
0
def asyn_workder(d, eta, etaSum, alpha):
    delta_eta = _mworker.lda_worker(d, eta, etaSum, alpha)
    return delta_eta
Exemple #6
0
def syn_worker(d,eta,etaSum,alpha,q):
    delta_eta =  _mworker.lda_worker(d,eta,etaSum,alpha)
    q.put(delta_eta)