Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parallel arbitrary-precision arithmetic library [closed]

I am trying to do modular exponentiation of integers with a very large modulus by repetitive squaring (the power is always a power of 2 in my case, so I believe this is the most efficient way). Thanks to a nice property of my modulus, computing remainder is cheap; the hard part is multiplication.

Currently I run GMP on Intel Core 2 Quad. I would like to make efficient use of the four cores of the processor, but GMP does not scale on SMP environments, so I am looking for a substitute arbitrary-precision arithmetic library. I have found some libraries for parallel computation on matrices, but what I really need is a library for integers.

Does what I am looking for exist?

like image 360
Pteromys Avatar asked Oct 26 '11 11:10

Pteromys


2 Answers

The answer is yes, multi-threaded arbitrary-precision libraries do exist. But I'm not aware of a single one that is actually public. (with comparable speed to GMP)

For example, the arbitrary-precision libraries that are used in the Pi-computing programs, TachusPi and y-cruncher are capable of multi-threaded arithmetic on large numbers.

However, both libraries are closed source and are not available to the public for use.

Affiliation Disclosure: I'm the author of y-cruncher. So I have written one of such multi-threaded arbitrary-precision libraries myself.

like image 184
Mysticial Avatar answered Dec 14 '22 10:12

Mysticial


Have you check out http://mpir.org? They claim to be doing this with a variant of GMP, and using GPUs.

like image 41
Ira Baxter Avatar answered Dec 14 '22 11:12

Ira Baxter