Bill Allombert on Sun, 27 Oct 2013 23:10:12 +0100

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

Branch bill-mt for parallel pari updated again

Dear PARI developers,

I have updated the GIT branch bill-mt for parallel pari again.
This branch support
- POSIX threads: do
- MPI (for clusters)

The documentation is available at

The following parallel GP functions are available:
parapply, pareval, parsum, parvector
and two new experimental parallel function:
parfor and parfirst:

I might decide to remove parfirst and parsum because parfor is more general.

parfor(i = a,b,expr1,j,expr2):

   The  sequence  expr2   (dependent on i and j)  is evaluated for i between a
and b,  in random order, with j being substitued for the value of expr1
(dependent on i), computed in parallel. It is allowed fo expr2 to exit the loop
using break/next/return,  however in that case,  expr2 will still be evaluated
for all remaining value of i less than the current one. 

Actually, parfor cal be used to emulate all the others.

For performance, it is better to move most code from expr2 to expr1, since only expr1
is evauated in parallel.

An example


find an elliptic curve of prime order over F_p, in parallel, stopping at the
first curve found. ("i" will always be the smallest possible).

Assuming the call to isprime take a significant CPU time, it can be moved to expr1 as follow: