How to set number of threads in OpenMP?

http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-371AAA48-F691-4F8A-998C-4BD761817B12.htm

Using the OpenMP* API

The OpenMP* API specification provides the following standard ways to change the desired number of threads on the coprocessor:

  • Calling the function omp_set_num_threads(n) before the omp parallel region

  • Using the clause #pragma omp parallel num_threads(n)

  • Setting the environment variable OMP_NUM_THREADS=n

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章