I have a problem in synchronising imports between ipyparallel engines. I want to run stochastic simulations in parallel. For this I have written a function named 'gillespie'. I have two versions of the function, one using Python and to gain some speed one in Cython. Both are working.
The problem now is how to make the compiled cython function available to all engines. The files 'gillespie.c', 'gillespie.so' and 'gillespie.pyx' are all in the current directory together with the notebook from where I want to use the functions. I wanted to import it like this
import gillespie as gc
%px import gillespie as gc
But this gives me:
Traceback (most recent call last)<ipython-input-50-801274ebf64a> in <module>()
----> 1 import gillespie as gc
ImportError: No module named gillespie
Just doing
import gillespie as gc
works just fine and I can use the compiled function.
Using the %px magic to import numpy or scipy to the engines works just fine.
How can I make my imports available to all engines?
Thanks for any help! baumgast