How to set thread affinity when using IPP library

How to set thread affinity when using IPP library

System detail:

Computer we are using is an Intel i7-2600. It is 4 core CPU with hyper thread which give 8 virtual cores. OS is Windows 7.

Issue:

We have an image processing process, We like to run it in upper 6 cores and leave lower 2 cores for device control. I use setAffinity to set image processing process to upper 6 cores. To test the affinity, I use Windows task manager to monitor which core is used. It works as I expected that 6 cores busy when I use C++ code in my algorithm. However when I opptimize my code to use IPP library, it start to use all 8 cores; and ignore my Cpu affinity setting. Is there any way I can set CPU affinity to IPP library? Any help is appreciated.

I have test ippSetAffinity. It does not make difference.

Yang

Abbott Point of Care

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Yang,

The Intel IPP functions are threaded with OpenMP. The affinity setting in the IPP will also impact the IPP. Please check if the following environment setting could work for you:
KMP_AFFINITY=explicit,proclist=[1-6:1],granularity=fine

You can check the following article regarding the these setting
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/fortran/lin/optaps/common/optaps_openmp_thread_affinity.htm

Thanks,
Chao

>>...However when I opptimize my code to use IPP library, it start to use all 8 cores; and ignore my Cpu affinity setting...

This is expected result because OpenMP based processing in IPP library ( for some functions ) takes control of the thread management. However, if you get a list of all threads in the application using Win32 API you could set your own affinities for these threads. There is an example in MSDN on how to do this.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya