Debugg/Run program

Debugg/Run program

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.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Jugoslav
www.xeffort.com

Leave a Comment

Please sign in to add a comment. Not a member? Join today