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

Error with Debug (plus OpenMP) mode, but not with Release

hadesmajesty
Beginner
262 Views

My Fortran code can run well in

(1) Debug mode without OpenMP.

(2) Release mode with OpenMP.

Both results are closed up to 1.0e-4.

Some Nan errors occur in

(3) Debug mode with OpenMP.

So I wonder if there is any bug in my code?

Thank you.

0 Kudos
2 Replies
anishtain4
Beginner
262 Views
Probably,
As you know houndred of thousands of right answers does not prove your code but a single wrong answer makes sure there is a problem.
Probably when you are in debug mode slower speed of the running makes the racing condition more evident
0 Kudos
jimdempseyatthecove
Honored Contributor III
262 Views
The usual suspects are:

a) Uninitialized variables (in multi-threaded programming this can mean not yet initialized variables)
b) Race conditions where a critical section or atomic is missing

Enable all debug checks and enable gen-interfaces/check-interfaces to catch most of a) problems. You can remove these options after you find/fix the error.

Jim Dempsey

0 Kudos
Reply