I have run into precision problems with the new INTEL compilers for
LINUX, both for FORTRAN (ifort) and C (icc). I am running Redhat 8
on a Dell Pentium IV, and am using the INTEL compilers version 8.
It seems that using the processor-optimized compilation flags
(and thus activating the "vectorizer") affects the outcome
of computations. I have looked around for documentation on this
behavior and couldn't find anything. Any help and suggestions where to look
or how to solve this problem are appreciated.
Here's an example program (analog issues arise with C code):
double precision a
a = a * 1.00000001d0
(Don't ask why one would run such code.) Here's what happens
with target architecture flags set:
> ifort -tpp7 -xW -O3 tmp.f ; time a.out
tmp.f(6) : (col. 6) remark: LOOP WAS VECTORIZED.
1.845u 0.007s 0:01.85 99.4% 0+0k 0+0io 171pf+0w
Here's the output without the P-IV flags:
> ifort -O3 tmp.f ; time a.out
30.611u 0.060s 0:30.87 99.3% 0+0k 0+0io 172pf+0w
I.e., it took much longer to run the test program, and the answers are
different. The second output appears to be 'correct', as judged from
comparing the run with a gcc compiled program.
I have experimented with some of the flags like -mp for maintaining
precision, same outcome. Apparently only removing the -tpp7 and -xW flags helps
to make results consistent. Obviously, it would be nice to make use of the
speed improvement without loosing precision.
Thanks for your help in advance