Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Set OpenMP attributes within code

Allen_Barnett
Beginner
502 Views

Hi: I have discovered that setting KMP_BLOCKTIME=0 results in the best performance of my Fortran code. (Not by much, really, but it is measurable over our entire test suite.) Is it possible to set this attribute through an API call? I don't want to depend on the end user having to set environment variables.

Also related, there are some loops for which the GCC GOMP library gives the best results when the scheduling is declared as "guided". When compiled with the Intel compiler, however, it appears best to not declare the schedule as guided. Is there an API function which can control the schedule for a given loop?

Thanks,
Allen
 

0 Kudos
2 Replies
TimP
Honored Contributor III
502 Views

Do you find these missing in your favorite docs?

https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-BD9B39A7-5885-4C6C-A047-93F22EB85740.htm

http://openmp.org/mp-documents/OpenMP3.1-CCard.pdf

What is difficult to find documented is how schedule guided and auto may be related for a given implementation.

https://software.intel.com/en-us/articles/openmp-loop-scheduling

As you hint that you want to change it according to which library is running, it seems you might be interested in schedule(runtime).

On linux, Intel libiomp5 supports the libgomp internal function calls.

0 Kudos
Allen_Barnett
Beginner
502 Views

Thanks for the pointers. I was able to add kmp_set_blocktime to my code. That works well.

The schedule has a smaller impact so I guess I will just let that be.

Is this exactly what's in my Composer XE installation: https://www.openmprtl.org/

Thanks,
Allen

0 Kudos
Reply