OpenMP startup code for benchmarking?

270 views Asked by At

I'm attempting to benchmark the speedup for OpenMP aware code. I'm using the Crypto++ library, and the Rabin-Williams signature class. The class implements Bernstein's Tweaked Roots, and has the following code:

ModularArithmetic modp(m_p), modq(m_q);

#pragma omp parallel sections
{
    #pragma omp section
        m_pre_2_9p = modp.Exponentiate(2, (9 * m_p - 11)/8);
    #pragma omp section
        m_pre_2_3q = modq.Exponentiate(2, (3 * m_q - 5)/8);
    #pragma omp section
        m_pre_q_p = modp.Exponentiate(m_q, m_p - 2);
}

From Crypto++'s perspective, all I need to do is something like the following:

RWSS<P1363_EMSA2, SHA256>::Signer signer(...);
signer.Precompute();

// Ready to sign

After I perform Precompute(), then Crypto++ is ready to go. I can sign away.

I also understand OpenMP has to startup, and it has things like dynamic teams. I tried to reference previous benchmarking papers, like Performance Evaluation of OpenMP Benchmarks on Intel's Quad Core Processors, but they don't call out what they did. I also grepped sources like EPCC OpenMP micro-benchmark suite, but it does not call omp_set_dynamic to remove the associated overhead.

What steps should I perform to get OpenMP into a clean room-like state so that I'm actually measuring the speedup of the big integer/signing operations, and not spending time in OpenMP startup or shutdown code; or spending time growing or shrinking the team? What do I do for OpenMP?

0

There are 0 answers