Set number of threads using omp_set_num_threads() to 2, but omp_get_num_threads() returns 1

前端 未结 3 2069
孤独总比滥情好
孤独总比滥情好 2021-02-05 05:36

I have the following C/C++ code using OpenMP:

    int nProcessors=omp_get_max_threads();
    if(argv[4]!=NULL){
        printf(\"argv[4]: %s\\n\",argv[4]);
              


        
3条回答
  •  忘了有多久
    2021-02-05 05:59

    you are using the wrong function. use omp_get_max_threads to check for the maximum number of allowed threads.

提交回复
热议问题