Guest User

Untitled

a guest
Nov 22nd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from pathos.multiprocessing import ProcessingPool
  2. import dill
  3. import datetime
  4.  
  5. class my_class(Object):
  6. def __init__(self):
  7. pool = ProcessingPool(nodes=4)
  8.  
  9. p1 = [1,2,3]
  10. p2 = [4,5,6]
  11. p3 = [7,8,9]
  12.  
  13. results = pool.map(self.my_func, p1, p2, p3)
  14.  
  15. def my_func(x,y,z):
  16. print(x,y,z)
  17.  
  18. def status_printout(self,message):
  19. header = datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')
  20. print(header+' -- '+message)
Add Comment
Please, Sign In to add comment