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

What does the "-debug all" flag actually do?

intel1
Beginner
1,232 Views
Can anyone tell me what the "-debug all" flag actually does? I've always assumed it encompasses several other flags in its use so as to simplify your command line entry.

The reason I'd like to know is that I'm trying to hunt down a bug in my code. Its in an n-body simulation and the run times are reasonably long. For some reason, after its been running for a while, some of my values turn into NaNs and the program then grinds to a halt (but doesn't crash). I've discovered that adding the "-debug all" compile option seems to alleviate the problem, at least it didn't crash after an hour's running but then that could just be chance for all I know. It does get past a particular time point when it would crash without the "-debug all" command anyway.

Obviously, using the "-debug all" flag isn't exactly doing wonders to the speed of my program so, if possible, I'd like to know what exactly it does so that I can narrow down the source of the bug. Or, if I can't get rid of the bug then at least find the one flag necessary to get the code moving again with the minimum amount of slow down.

I'm running Leopard 10.5.6 and my version of iFort is 10.1.017. My current machine is a Unibody MacBook Pro 2.53GHz Core 2 Duo with 4GB RAM. I'm using the 64 bit version of iFort.
0 Kudos
5 Replies
TimP
Honored Contributor III
1,232 Views
Presumably, -debug (or -g) changes the default optimization level from -O2 to -O0. This might alleviate potential problems with un-initialized variables or variables which might require SAVE. The option -save would impose SAVE semantics wherever possible, even with normal optimization. -O0 may also impose double precision evaluation of single precision expressions. Also, -debug would eliminate the need for options such as -assume protect_parens -prec-div -prec-sqrt -no-ftz.
0 Kudos
Steven_L_Intel1
Employee
1,232 Views
As far as I know, just specifying -debug would default optimization to -Od (-O0), but make no other changes in options. The compiler will sometimes need to generate additional data structures used for debugging arrays.
0 Kudos
Lorri_M_Intel
Employee
1,232 Views
Can anyone tell me what the "-debug all" flag actually does? I've always assumed it encompasses several other flags in its use so as to simplify your command line entry.

The reason I'd like to know is that I'm trying to hunt down a bug in my code. Its in an n-body simulation and the run times are reasonably long. For some reason, after its been running for a while, some of my values turn into NaNs and the program then grinds to a halt (but doesn't crash). I've discovered that adding the "-debug all" compile option seems to alleviate the problem, at least it didn't crash after an hour's running but then that could just be chance for all I know. It does get past a particular time point when it would crash without the "-debug all" command anyway.

Obviously, using the "-debug all" flag isn't exactly doing wonders to the speed of my program so, if possible, I'd like to know what exactly it does so that I can narrow down the source of the bug. Or, if I can't get rid of the bug then at least find the one flag necessary to get the code moving again with the minimum amount of slow down.

I'm running Leopard 10.5.6 and my version of iFort is 10.1.017. My current machine is a Unibody MacBook Pro 2.53GHz Core 2 Duo with 4GB RAM. I'm using the 64 bit version of iFort.

Just in case what you're actually asking is "What does -debug all give me that -debug doesn't?" the answer is "Nothing".

"-debug all" was recognized by the ifort driver because CVF had it, andrecognizingCVF switcheshelps transitioning make files. Yes, CVF is windows, but many switches added to ifort to support CVF were also enabled on Linux/MacOS.

Anyway, under-the-covers,"-debug all"does the same thing as just saying "-debug", or "-g", and that was discussed by previous posts.

- Lorri
0 Kudos
intel1
Beginner
1,232 Views
Thank you everyone for all your help, its really appreciated. I understand now what the debug flag does. Apologies if it was a stupid question, I'm very new to debugging these kind of problems and I'm not well versed in the iFort compiler yet. :)

Phil
0 Kudos
Ron_Green
Moderator
1,232 Views
Thank you everyone for all your help, its really appreciated. I understand now what the debug flag does. Apologies if it was a stupid question, I'm very new to debugging these kind of problems and I'm not well versed in the iFort compiler yet. :)

Phil

Phil,

All questions are welcome here, even new user questions. That's why we're here. The only silly question is the one that is unasked.

Keep 'em coming.

ron
0 Kudos
Reply