英特尔编译器的 OpenMP 错误?
以下代码
#pragma omp parallel
printf("%f", 1.0f);
产生“浮点异常”。有人遇到过类似的事情吗?
更多详细信息:
- 当我尝试打印字符串或整数时没有问题。
- 如果不使用 OpenMP 也没有问题。
- 我在 Mac OSX 10.6.8 和 Intel C++ 编译器 12.0.4 上运行它。
- 除此之外,OpenMP 运行良好。
代码:
#include <stdio.h>
#include <omp.h>
int main()
{
#pragma omp parallel
printf("%d", 1);
printf("\n...\n");
fflush(stdout);
#pragma omp parallel
printf("%f", 2.0);
}
编译:
icpc -o test test.cc -fp-trap-all=all -openmp
产生:
1111
...
Floating point exception
The following piece code
#pragma omp parallel
printf("%f", 1.0f);
produces the a "Floating point exception". Has anyone encountered anything like that?
More details:
- No problems when I try to print out strings or integers.
- No problem if OpenMP is not used.
- I am running it on Mac OSX 10.6.8 and the Intel C++ compiler 12.0.4.
- Other than that, OpenMP works fine.
The code:
#include <stdio.h>
#include <omp.h>
int main()
{
#pragma omp parallel
printf("%d", 1);
printf("\n...\n");
fflush(stdout);
#pragma omp parallel
printf("%f", 2.0);
}
compiled with:
icpc -o test test.cc -fp-trap-all=all -openmp
produces:
1111
...
Floating point exception
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论