Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6709 Discussions

Problems using OpenMP with Elliptic Curve Scalar Multiplication function

kleboeuf
Beginner
281 Views
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:

[cpp]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, q_array1, gf256); }[/cpp]
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.
0 Kudos
1 Solution
Chao_Y_Intel
Moderator
281 Views

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

View solution in original post

0 Kudos
2 Replies
Chao_Y_Intel
Moderator
282 Views

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

0 Kudos
kleboeuf
Beginner
281 Views
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.
0 Kudos
Reply