I'm trying to implement Pyro4 on different hosts.
On a worker node, I implemented multiprocessing in this manner:
import Pyro4
from multiprocessing import Pool, Manager
@Pyro4.expose
class PyroClass(object):
def parallel_calls():
pool = Pool()
try:
pool.map(self.function, enumerate(self.p.results()))
finally:
pool.close()
pool.join()
def function_name(self):
print("test")
However, this multiprocessing doesn't seem to work.
The concept here is that on each host, cores will be maximized to their fullest.
I am still new to this and I don't know the workarounds.
Apparently, multiprocessing.Pool is not supported in Pyro4.
For workarounds, I implemented the multiprocessing in the ff manner: