OpenMP flush vs flush(list) [英] OpenMP flush vs flush(list)

查看:444
本文介绍了OpenMP flush vs flush(list)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OpenMP中,我可以刷新指定的一组变量或整个缓存。

In OpenMP I can flush either a specified set of variables or the whole cache.

有没有人知道这个操作的性能?是否有意义只刷新真正改变的变量,或者是flush all这么快,我不用担心?

Does anybody have an idea of the performance of this operation? Does it make sense to flush only the variables that really have changed or is the "flush all" so fast, that I should not worry?

我有链接列表,我需要在我的线程中不时刷新。

I have linked lists that I need to flush in my threads from time to time. Should I iterate through the list and flush each element individually, or simply flush everything ?

推荐答案

给出OpenMP 3.1标准中的建议:

Given the advice in the OpenMP 3.1 standard:


使用列表中的 flush 构造极其容易出错,
用户不鼓励尝试。

Use of a flush construct with a list is extremely error prone and users are strongly discouraged from attempting it.

和以下句子:


一个实现可以通过忽略
列表来实现 flush ,并且与没有列表的 flush 一样处理。 / p>

An implementation may implement a flush with a list by ignoring the list, and treating it the same as a flush without a list.

我将首先实现一个带有 pragma omp flush

I would implement first a solution with pragma omp flush (without any list).

然后,在尝试优化此实现之前,我会仔细考虑添加一个列表来刷新构造,因为代码 em>。

Then, I would really think carefully before trying to optimize this implementation adding a list to flush constructs, as the code won't be performance portable.

这篇关于OpenMP flush vs flush(list)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆