Re: unexplainable behaviour - f90 - looking for some tools to help diagnose
- From: Patrick Begou <Patrick.Begou@xxxxxxxxxxx>
- Date: Tue, 17 Apr 2007 16:33:28 +0200
oyaron wrote:
Hi Everyone.
Sorry for the very general subject but that's exactly my problem now -
not being able to pin point on anything specific.
I have a very large piece of code in f90 that includes many
subroutines and some modules - basically a numerical scheme to solve a
set of ODEs, etc...
During my last set of updates, something was probably ruined and I'm
now in a situation in which the behaviour of the run can change
completely (including getting stuck) even when adding a very simple
debug printing (WRITE statement) or certain simple assignments or
simple DO loops - even statements that have nothing to do with the
surrounding code (meaning nothing that should affect the run).
My latest updates did include use of new arrays, a change of arguments
between subroutines etc...
My questions are:
1. Did anyone encounter such frustrating situations, and if so, are
there any suggestions.
2. Which tools can I use to try starting diagnose the situation? would
using a debugger help? maybe running a source check, e.g. like ftnchek
- but that's only for f77 (is there anything good for f90?)
Thanks in advance, Ofer.
Yes, using a debugger can help. But you should compile again your code with -g option and depending on the previous option used your code can run (but the bug still exist) because of different layout of the datas in memory. I'm stuck at this time with a code giving "memory fault" when compiled with -IPO on intel fortran. Adding a write statement or an option for checking the arrays boundaries hide the problem... very difficult to understand!
Add -g option to the compiler and the linker, launch your code with debugger. If it fails (memory fault, segmentation fault) use the where command of the debugger (or something similar) to see where you are in the code.... If it loops infinitly, use [ctrl][c] to break the loop and use the where command again...
I'm using CVS to store successive versions of my codes, but even if I can see exactly what has changed I do not undestand why I have a memory fault! But working with CVS (or similar solutions) is a good pratice. See also tkcvs for a graphic front end to cvs.
Good luck
Patrick
.
- References:
- Prev by Date: Re: Interesting bug in (admittedly old) MS FORTRAN 5.1
- Next by Date: Re: How can I secure this small code ?
- Previous by thread: Re: unexplainable behaviour - f90 - looking for some tools to help diagnose
- Next by thread: Re: unexplainable behaviour - f90 - looking for some tools to help diagnose
- Index(es):
Relevant Pages
|