Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

NameError: name '...' is not defined

I got the preparsed with sage --preparse command keflll.py file with the function invertibles() that returns the list of integers. It doesn't use any lambda expressions. I can call it in the code, but as long as I try to call it in parallel i get the error:

NameError: name 'invertibles' is not defined

The code is given below:

from keflll import invertibles
from sage.parallel.multiprocessing_sage import pyprocessing

p_iter = pyprocessing(4)
P = parallel(p_iter=p_iter)
def f(x):    
    return invertibles(x)

list( P(f)([(2,),(3,)]) )

How can I parallelize calls of the functions that are in custom made module or just depend on those?