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

You can download it directly from the PARI website:;a=snapshot;h=refs/heads/bill-mt;sf=tgz

It provides new functions parvector and parsum.

See also for some minimal information:

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