Re: [sage-devel] Re: Using several algorithms in parallel

2011-11-04 Thread William Stein
On Fri, Nov 4, 2011 at 11:31 AM, mmarco wrote: > Thanks for the example, Tom. I have tried to implement the > algorithm='parallel' in the primary decomposition, but it doesn't > recognize the parallel function. If i try to import it, it gives an > error message at startup. > > I have tried with >

Re: [sage-devel] Re: Using several algorithms in parallel

2011-11-03 Thread Tom Boothby
The @parallel instance kills its still-running children once it drops out of scope. This happens immediately after the return statement is executed. Since I merely call .next() on the generator, the first one to finish gets picked out in milliseconds, and the remainders are axed almost immediatel

Re: [sage-devel] Re: Using several algorithms in parallel

2011-11-03 Thread Tom Boothby
On Thu, Nov 3, 2011 at 9:28 PM, leif wrote: > On 4 Nov., 02:15, Tom Boothby wrote: >> This is fairly easy to do with @parallel: >> >> def fast(x): >>     return x >> >> def slow(x): >>     sleep(x) >>     return x >> >> def slower(x): >>     sleep(x*x) >>     return x >> >> algorithms = [slower,