In [ ]:
from ipyparallel import Client
# IPython Parallel profile
profile_dir = "/home/data/ipython/profile"
rc = Client(profile_dir=profile_dir)
print "Available Processes: {0}".format(len(rc.ids))
In [ ]:
dview = rc.direct_view()
with dview.sync_imports():
import os
dview.block=True
pids = dview.apply(os.getpid)
dview.block=False
ar = dview.apply(os.getpid)
dview.wait(ar)
pids = ar.get()
print ''
print 'PID of each process',pids
In [ ]: