Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

openmp and -fpe0

pelupes
Beginner
561 Views
I have problems using -fpe0 option for program using openmp, in combination with underflows, can someone explain what is happening?

example:
program below aborts if compiled as:
ifort -r8 -openmp -fpe0 ex.f90
where it runs normally without -openmp or -fpe option...
( on dual athlon running fedora)

program ex
integer, parameter :: n=25
real x(n),y
integer i

!$omp parallel do private(y) shared(x)
do i=1,n
y=32*i
x(i)=exp(-y)
enddo

print*,x

end
0 Kudos
3 Replies
TimP
Honored Contributor III
561 Views
As no one has stepped up to this, I'll ask you for clarification.
If I read your question right, you're writing a program which intentionally produces underflow in exp(). You're asking the compiler to generate code which traps on underflow, and it does so. When you don't ask for trap on underflow, it simply runs to completion, presumably setting many of those results to zero. How is this different from your expectation?
0 Kudos
pelupes
Beginner
561 Views
ok.
the problem is that it does _not_ abort while compiling _without_ -openmp, which should not make a difference for the occurance of the underflow. I do not understand why -openmp option causes difference.
0 Kudos
Steven_L_Intel1
Employee
560 Views
There may be an uninitialized variable in the program. -openmp implies -automatic, which puts local variables on the stack.
0 Kudos
Reply