The following code produces a strange error ValueError: Cannot pickle code objects from closures
in Sage 9.4. It does not happen at SageCell, and also disappears if I remove if set(v)&S
condition. What's wrong?
def mytestproc(n,G,S):
V = [v for v in G.vertices() if set(v)&S]
return n*len(V)
def test(n):
G = DiGraph()
return sum( val for _,val in sage.parallel.multiprocessing_sage.parallel_iter(2, mytestproc, [((n,G,S),{}) for S in Subsets(1..n)]) )
test(2)