OpenMP bug with Intel Compiler?
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:
#inc开发者_如何学Clude <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
精彩评论