Your strategy is not defined when being unpickled in a slave process due to the "strange" ordering in your code. I would suggest you look at the sample and use a conventional ordering, with "declarations" first and "execution" afterwards.