开发者

Are the indices in an OpenMP loop processed in ascending order?

Consider the following OpenMP for loop:

#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < n; ++i)
{
    //do somet开发者_开发知识库hing with i
}

Is it guaranteed that each OpenMP thread sees its i values in ascending order?


The order in which threads run is not guaranteed; the order in which a thread processes its own chunk is guaranteed.


If your question is if each thread will get a chunk of the iteration and if within that chunk the value of i is sequential, then the answer is yes. Is that your question?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜