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

Debugg/Run program

saluki
Beginner
543 Views
I am using CVF. When I ran my program using the debugger it runs well. But when I ran it without the debugger, it stuck without giving any error message. Any help is appreciated.

Thank you.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
543 Views
Most probably you have an uninitialized variable somewhere; note that CVF zeroes static arrays, but not allocatables and automatic arrays. That may happen, for example:
ALLOCATE(i1(n))
...
i1(1)=1
i1(2)=something   !forgot to initialize i1(3)
...
DO j=1,2
   DO k=i1(j),i1(j+1)-1
      ...

If i1(3) happens to be very large, you get a huge (but finite) loop which could stuck the program; something similar can be done with DO WHILE, resulting in an infinite loop.

You can insert control writes, which will tell you where the program got stuck. You can also debug the release version - use Project settings/Fortran/General/Generate debug info. The stepping will go a bit weird but you'll be able to at least approximately figure out where it got stuck. (However, note that this can cause the problem to disappear according to Heisenberg's Principle :-))

Jugoslav
0 Kudos
Reply