Bill Allombert on Mon, 14 Oct 2013 12:13:44 +0200


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

Re: simple parallelization


On Sun, Oct 13, 2013 at 10:12:41PM -0400, Max Alekseyev wrote:
> Dear pari-developers,
> 
> Would it be possible to implement an optional threading that would
> automatically parallelize execution of any for*/sum*/vector/matrix
> loops (i.e. all loops with predetermined number of iterations)? I mean
> something like
> 
> default( threads, 4 );
> vector( 100, i, f(i));
> \
> which would run the 'vector' loop in four threads, each with its own
> value of i and computing its own f(i).
> 
> Of course, not every loop is parallelizable this way but this feature
> would be off by default (threads = 1) and the user will take
> responsibility for code's correctness (independence of iterations,
> order of output, or whatever other related issues) when threading is
> on. Moreover, it would be possible to turn threading on and off as
> needed within a single program.

Such feature is available in the bill-mt git branch,see
<http://pari.math.u-bordeaux.fr/archives/pari-dev-1310/msg00001.html>

You can download it directly from the PARI website:
http://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=snapshot;h=refs/heads/bill-mt;sf=tgz

It provides new functions parvector and parsum.

See also for some minimal information:
<http://pari.math.u-bordeaux.fr/Events/PARI2013/talks/pareval.pdf>

What is missing at this stage is user feedback, so I encourage you to try it and
report back.

Cheers,
Bill.