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:54


P.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.

https://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/optaps/common/optaps_par_mpex.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值