Loïc Grenié on Thu, 24 Oct 2013 17:53:27 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: parallel pari: parfirst


2013/10/24 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
> On Thu, Oct 24, 2013 at 09:16:31AM +0200, Loďc Grenié wrote:
>>     A "parbreak()"-like would be a little bit more general. You add a
>> conditional
>>   part to pareval
>>
>> pareval(vector(10000,i,chkell(p)),(i,r)->test(i,r)))
>>
>>   where i is the input of the function called in parallel and r its output.
>>   Then test would return 0 (go on) or !0 (stop) (in your example,
>>   test(i,r)=r). test() is evaluated in the main pari, so it can use/modify
>>   global variables.
>
> Or even a
> parfor(i=a,b,j,f(i),g(i,j))
> which compute the f(i) in parallel and compute the g(i,f(i)) sequentially
> but in random order. Eventually g(i,f(i)) can call break, which will stop
> parfor.

    Indeed !

         Thanks,

                Loïc