gmpbench -- how to utilize all CPU cores?

Fredrik Johansson fredrik.johansson at
Fri Sep 27 13:33:33 CEST 2013

On Fri, Sep 27, 2013 at 12:37 PM, Gabriel Risterucci <cleyfaye at> wrote:
> Unless I'm wrong, the GMP library itself doesn't take advantage of
> multicores systems, so it don't "perform" better or worse in these cases.
> The best you can get is multiple independant computations running on
> different CPU as well as they would have been run sequentially on one core,
> much like launching your code multiple time on different CPU. In this case,
> parallel usages of GMP won't interfere with eachother.

That's not true -- parallel usages will compete for shared caches and
main memory bandwidth. In fact, word I've gotten from an expert on the
matter is that the FFT multiplication code in GMP performs
comparatively poorly when you run several instances of it in parallel,
making such a benchmark rather interesting in anticipation of possible
future improvements...


More information about the gmp-discuss mailing list