What is the benefit of '#pragma omp master' as opposed to '#pragma omp single'?

后端 未结 2 1494
生来不讨喜
生来不讨喜 2021-02-13 10:59

In OpenMP any code inside a #pragma omp master directive is executed by a single thread (the master), without an implied barrier at end of the region. (See section

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-13 11:22

    In addition to nesting limitations single construct can be implemented slower than master construct because it is more complicated and flexible. You may want to check your particular implementation, but in general master can be implemented faster, so multiple invocations of it may benefit comparing to single nowait construct.

提交回复
热议问题