Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more debug flags with gnu #1621

Closed
billsacks opened this issue May 27, 2017 · 9 comments
Closed

Add some more debug flags with gnu #1621

billsacks opened this issue May 27, 2017 · 9 comments
Assignees
Labels
Responsibility: CESM Responsibility to manage and accomplish this issue is through CESM tp: config ty: enhancement

Comments

@billsacks
Copy link
Member

@rljacob pointed out that ACME has some extra flags beyond what we now have for gnu (even with #1618 ) (see #1618 (comment)). They add -Og and -fbacktrace in both FFLAGS and CFLAGS in DEBUG mode. We should consider doing that, too. They also add 'invalid' to the 'ffpe-trap' list, though I'm a little wary of doing that based on my experience showing that the gnu isnan intrinsic barfs when you give it a signaling NaN with 'invalid' in this list of checks (isn't the whole point of isnan that you should be able to check for NaN values?)

I don't want to add these extra flags unless someone ( @jedwards4b ?) signs off on them, since I don't completely understand the implications.

@billsacks billsacks added Responsibility: CESM Responsibility to manage and accomplish this issue is through CESM tp: config ty: enhancement labels May 27, 2017
@billsacks
Copy link
Member Author

Regarding adding 'invalid' to the 'ffpe-trap' list, and the problem with isnan: The ideal way to allow this may be to take advantage of the fact that - I think - recent versions of gfortran support Fortran 2003 ieee arithmetic, and modify shr_infnan_mod accordingly (rather than having special code for gnu in there). (I made some preliminary, feeble attempts at this which did not meet with success, but I'm hopeful that a more concerted effort would allow this to work.)

If this is not possible, then maybe we could back off the compiler flags just for shr_infnan_mod using the Depends.gnu mechanism for the system build, and some other mechanism for the CMake-based unit test build.

@billsacks
Copy link
Member Author

From the discussion in today's cime call: People feel that there's no harm in going ahead and adding -Og and -fbacktrace. @fischer-ncar can you give that a try and make sure it doesn't break testing?

I'm still wary of adding invalid with the current handling of NaNs with gnu, so I'd suggest not adding that one for now. I'll move that into a separate issue.

@billsacks
Copy link
Member Author

Actually, I'll take this: I'm finally making some headway on gnu's NaN handling, so I'll combine the changes here with that fix and then run a bunch of testing with gnu.

@fischer-ncar
Copy link
Contributor

-Og and -fbacktrace didn't break alpha/beta testing.

@billsacks
Copy link
Member Author

Great, thanks for checking. If you've already done this, then go ahead and merge it and I'll do the other piece separately.

@fischer-ncar
Copy link
Contributor

Is there a PR associated with this issue?

@billsacks
Copy link
Member Author

No, not yet. I was going to work on it today, but haven't made any actual mods yet.

@billsacks billsacks assigned fischer-ncar and unassigned billsacks Jul 29, 2017
@billsacks
Copy link
Member Author

@fischer-ncar - I ended up getting stuck on adding -ffpe-trap=invalid (see my comments in #1763 ). So it would be great if you could take this back on after all, adding -Og -fbacktrace.

@billsacks billsacks assigned billsacks and unassigned fischer-ncar Jul 29, 2017
@billsacks
Copy link
Member Author

Okay, turns out I've been able to make some progress after all, so I'm taking this back and combining it with what is likely to become a PR when I return.

fischer-ncar added a commit that referenced this issue Aug 11, 2017

Inspired by ACME's gnu debug flags

Test suite: SMS_D.f09_g16.X.cheyenne_gnu
Also ran all of CESM's gnu tests on an earlier version of this,
which had some other changes folded in (which I haven't kept)
Test baseline: N/A
Test namelist changes: none
Test status: bit for bit

Fixes #1621

User interface changes?: none

Update gh-pages html (Y/N)?: N

Code review:
@ghost ghost removed the Assigned label Aug 11, 2017
ekluzek pushed a commit to ekluzek/mizuRoute that referenced this issue Nov 30, 2022

Inspired by ACME's gnu debug flags

Test suite: SMS_D.f09_g16.X.cheyenne_gnu
Also ran all of CESM's gnu tests on an earlier version of this,
which had some other changes folded in (which I haven't kept)
Test baseline: N/A
Test namelist changes: none
Test status: bit for bit

Fixes ESMCI/cime#1621

User interface changes?: none

Update gh-pages html (Y/N)?: N

Code review:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Responsibility: CESM Responsibility to manage and accomplish this issue is through CESM tp: config ty: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants