How to set number of threads in OpenMP?

来源:互联网 发布:ug creo 编程 编辑:程序博客网 时间:2024/05/17 22:22

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

0 0