Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If your problem is trivially parallel (independent tasks) then you can just use the @parallel decorator:

sage: @parallel
....: def f(x):
....:     return x^2
....: 
sage: list(f(range(10)))
[(((0,), {}), 0), (((1,), {}), 1), (((2,), {}), 4), (((3,), {}), 9), (((4,), {}), 16), (((5,), {}), 25), (((6,), {}), 36), (((7,), {}), 49), (((8,), {}), 64), (((9,), {}), 81)]

This will use all cores of your computer to work in parallel. Of course you can use any of the other Python tools you mentioned to distribute your work tasks.