How does the SECTIONS directive in OpenMP distribute work?

前端 未结 8 747
情话喂你
情话喂你 2020-11-29 08:14

In OpenMP when using omp sections, will the threads be distributed to the blocks inside the sections, or will each thread be assigned to each sections?

8条回答
  •  独厮守ぢ
    2020-11-29 08:37

    If you want really start different threads in different sections, the nowait clause tells compiler that threads do not need to wait to enter a section.

    #pragma omp parallel sections nowait
    {
       ...
    }
    

提交回复
热议问题