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

IPP's OpenMP in a multi-threaded performance app

cratiuixiacom_com
386 Views

Hello,

I have an issue with threads created from IPP's OpenMP implementation. My app has 4 worker threads each running on a core. Each worker thread does some heavy-lifting work, involving FFTs. The problem is that IPP creates 4 additional threads that compete with my threads for CPU. After looking through the documentation, I found the OMP_NUM_THREADS variable and the ippSetNumThreads function. I've tried setting both to 1 but they don't seem to work: threads are still created.

I link with the dynamic version of IPP and the part of the app with the worker threads is loaded with dlopen.

Some more info: By reducing the number of my worker threads to 2, it seems everything is fine: 2 more IPP threads are created from libguile.so but each thread gets a core of it's own and everyone is happy...but I'd like to have some control and see what happens if FFTs are not parallelized and everything runs on the same core, serially.

Thanks,

Cosmin.

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
386 Views
After you call ippSetNumThreads(1) IPP will use only single thread, it is easy to check looking at performance of any threaded IPP function.
Regards,
Vladimir

0 Kudos
cratiuixiacom_com
386 Views
Quoting - vdudnik
After you call ippSetNumThreads(1) IPP will use only single thread, it is easy to check looking at performance of any threaded IPP function.
Regards,
Vladimir

Thanks, meanwhile I discovered that I didn't correctly call that function before the first chunk of work caused threads to spawn.

0 Kudos
Reply