Open CyBu opened 5 years ago
Think about it like this... you are building a function object out of make_random_number
, and that object is getting passed to a new processor. If you don't have a fully encapsulated namespace, then there are dangling pointer references... which can lead to a NameError
or other errors. Translation: the name np
is undefined on the new processor where your function is running. You either have to import numpy
as np
locally, or pathos
has to serialize and ship the entire numpy
module (or at least know to import it as np
), so that when your code tries to look up np
in the namespace, it finds something.