Ask Your Question

Revision history [back]

You might need to use the if __name__ == '__main__' guard around the part of the code that initiates the parallel computation, as in:

if __name__ == '__main__':
    W=list(szamol([(a,b) for a in range(-2,3) for b in range(-2,3)]))
    for X, Y in sorted(W): print X, Y

Without it, you might have each child subprocess trying to start the whole parallel computation over again, spawning its own child processes, which in turn try to start the whole thing again.

This is just a guess though; it seems to be required only for some operating systems, and is typically used when parallelizing with multiprocessing instead of fork. It would be confusing if you need it on the cluster but not your local machine.

To continue testing/debugging, I would suggest:

  • Try using one of the very simple parallel examples in the parallel decorator documentation to verify that it does or doesn't work as expected.
  • Tell us the content of test.q
  • Try running the code without <, as in "sage QE.sage" -- this processes the file with sage, but is somewhat different from an interactive session. Is there some reason you know you need to use <?