Problems using OpenMP with Elliptic Curve Scalar Multiplication function

Problems using OpenMP with Elliptic Curve Scalar Multiplication function

I'm trying to get some benchmarks for the 'ippsECCPMulPointScalar' function. I have a simple benchmark program that runs this function in a loop and measures the number of clock cycles elapsed so that I can get an idea of its runtime. The serial version of this program appears to run fine and does not toss up any errors or behave badly as far as I can tell.

I wanted to see how well this would parallelize using OpenMP's '#pragma omp parallel for' construct, and when I recompile the code using icc's -openmp flag, I can see that it uses all my cores, however the performance is definitely slower, and my program hangs or crashes about a third of the time.

Shown below is my loop:

int i;

#pragma omp parallel for shared(P, k_array1, q_array1, gf256) private(i)

for(i=0; i<10000; i++)

{

	ippsECCPMulPointScalar(P, k_array1[i], q_array1[i], gf256);

}

The ippsECCPMulPointScalar function uses the same IppsECCPPointState context 'P' and the same IppsECCPState 'gf256' for all iterations, while k_array holds an array of IppsBigNumState, and q_array is meant to hold the result of the function. As stated before, the serial version of this runs fine, the parallel version uses all my cores but takes longer and crashes or hangs a third of the time. I'm hoping someone can give me some ideas, as I am quickly running out of things to try.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Hello,

You may check the IPP manual on state structures: state structures that are modified during operation;

So, IppsECCPState* pECC could not be shared by the multithreadings, Each threading should has its own status:

Thanks,
Chao

Thanks; that did the trick. I setup each thread to have its own IppsECCPState, and now everything is working fine. Still, I can't seem to find anything in the documentation about state structures.

Leave a Comment

Please sign in to add a comment. Not a member? Join today