Fortran 中的 OpenMP:数据类型发生变化?

发布于 2024-11-01 11:16:18 字数 579 浏览 4 评论 0原文

我有一个程序,我曾经使用和不使用 OpenMP 进行过编译。即使当我使用一个要转换的输入文件运行它并将 OMP_NUM_THREADS 设置为 1 时,生成的 ASCII 文件也与我运行该程序时得到的文件不同,该程序是在没有 OpenMP 的情况下编译的!我真的不明白...... Linux 中的“diff”将每一行打印为不同的,但是当我自己查看文件并比较单个浮点值时,我自己没有看到任何差异。 该文件如下所示:

0.949566E+00 0.945844E+00 0.942125E+00 0.938410E+00 0.934698E+00 0.930989E+00 0.927285E+00 0.923584E+00 0.919888E+00 0.916196E+00 0.912508E+00 0.908826E+00 0.905149E+00 0.901476E+00 0.897810E+00 0.894149E+00 0.890493E+00 0.886845E+00 0.883202E+00 0.879565E+00

等等...(当前以单精度运行!)... OpenMP 中是否有任何内部数据更改或对此有何建议?

I have a program which I once compile with and without OpenMP. Even when I run it with ONE input-file to convert with OMP_NUM_THREADS set to 1, the resulting ASCII files differs from the one which I get when I run the program, which is compiled without OpenMP! I really don't get it... "diff" in linux prints out every single line as different, but when I look into the file myself and compare the single float values, I don't see any difference myself.
The file looks like:

0.949566E+00 0.945844E+00 0.942125E+00 0.938410E+00 0.934698E+00
0.930989E+00 0.927285E+00 0.923584E+00 0.919888E+00 0.916196E+00
0.912508E+00 0.908826E+00 0.905149E+00 0.901476E+00 0.897810E+00
0.894149E+00 0.890493E+00 0.886845E+00 0.883202E+00 0.879565E+00

etc... (Currently running with single precision!)...
Is there any internal data-change in OpenMP or any advice on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文