Parallelizing GMP

Marc Glisse marc.glisse at
Sat Oct 29 22:25:12 CEST 2011

On Sat, 29 Oct 2011, bodrato at wrote:

> Il Sab, 29 Ottobre 2011 10:03 am, Marc Glisse ha scritto:
>> On Sat, 29 Oct 2011, Kentaro Yamamoto wrote:
>>> I am using GMP for computing modular exponentiation by repeated
>>> squaring (since the power are always a power of 2 and the modulus has
> If the exponent is always a power of 2, then you do only use squarings.

Oups, there goes my remark about computing the transform of both arguments 
in parallel ;-)

> Marc, you also tested openmp somehow, didn't you?

A little, yes. I remember adding some openmp to mul_fft at a few places 
(including between the 2 (sadly unbalanced) ffts when there used to be a 
fft_full, where the OP put it, and between the decompositions of the 2 
arguments of the multiplication), and parallelizing toom7 and karatsuba 

But those were more experiments to play with openmp than real good ideas 
for gmp. For one, I believe there is supposed to be a new fft code in gmp 
some day ;-) And then the best parallel algorithm is not necessarily the 
best single-threaded one with little tweaks, it may require a different 

Marc Glisse

More information about the gmp-discuss mailing list