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)
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)
def asyn_workder(d,eta,etaSum,alpha): delta_eta = _mworker.lda_worker(d,eta,etaSum,alpha) return delta_eta
def syn_worker(d, eta, etaSum, alpha, q): delta_eta = _mworker.lda_worker(d, eta, etaSum, alpha) q.put(delta_eta)
def asyn_workder(d, eta, etaSum, alpha): delta_eta = _mworker.lda_worker(d, eta, etaSum, alpha) return delta_eta
def syn_worker(d,eta,etaSum,alpha,q): delta_eta = _mworker.lda_worker(d,eta,etaSum,alpha) q.put(delta_eta)