首页 > 代码库 > OMP笔记(1)
OMP笔记(1)
Difference between static and dynamic schedule in openMP in C
Using OMP_SCHEDULE with #pragma omp for parallel schedule(runtime)
C OpenMP - Enforce default chunk size
OpenMP: for schedule(vip)
I think you have difficulty with the English meaning of schedule. It refers to the way the work, i.e. the individual values of the loop variable, is spread across the threads.
static
means that it is decided at the beginning which thread will do which values, where as dynamic
means that each thread will work on a chunk of values and then take the next chunk which hasn‘t been worked on by any thread. The latter allows better balancing (in case the work varies between different values for the loop variable), but requires some communication overhead. – Walter Jun 1 ‘12 at 12:54P.S. If local variables are automatically private, what is the point of using private clause?
The point is presumably that in earlier versions of C you needed to declare all variables at the beginning of the function, and this is still the prevailing style.
That is, code such as this:
#pragma omp parallel
{
int x;
}
is the preferred way in C++. But in some versions of C you cannot use this code, you need to use the private
clause.
How does the SECTIONS directive in OpenMP distribute work?
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。