GEOS-ESM / MAPL

MAPL is a foundation layer of the GEOS architecture, whose original purpose is to supplement the Earth System Modeling Framework (ESMF)
https://geos-esm.github.io/MAPL/
Apache License 2.0
24 stars 18 forks source link

Run warnhist on MAPL #2512

Open mathomp4 opened 11 months ago

mathomp4 commented 11 months ago

While following around issues on GitHub I hit this reply by @qkoziol where he mentioned warnhist which is a script the HDF5 Group use.

So, let's try it out on MAPL!

Possible fun:

  1. Does it work with CMake build output or only autotools...or both? (Not sure which one HDF5 is focusing on now.) Do we perhaps need to build differently to move the CMake decorations out of the way?
  2. Do we turn on enough flags for GNU to make this work? The list in that reply is...exciting for sure.
  3. Does it do much for Fortran? HDF5 is, in the end, mostly C.
qkoziol commented 11 months ago

It does work with CMake and I think it's useful for Fortran also. :-) Try the improved version that I just put up in a PR, which added a "warning density" calculation for builds (i.e. \<warnings> / \<lines of code>): https://github.com/HDFGroup/hdf5/pull/3910

mathomp4 commented 11 months ago

@qkoziol Ooh. New version! I'll give it a try.

Also: do you know if warnhist works with Intel Fortran (Classic) or just GNU? (We also use NAG, but I'm guessing that's rare enough you don't encounter it much.)

qkoziol commented 11 months ago

Cool - the updated version has been merged into the develop branch now, so you could pull it from there if you'd like.

I haven't tested with other Fortran compilers than gfortran. But if it doesn't work, you can post the build output here and I can see how difficult it is to handle them.

mathomp4 commented 11 months ago

Cool - the updated version has been merged into the develop branch now, so you could pull it from there if you'd like.

I haven't tested with other Fortran compilers than gfortran. But if it doesn't work, you can post the build output here and I can see how difficult it is to handle them.

@qkoziol I'm attaching a couple logs for you to peruse. First up GNU:

make.GNU.log

and warnhist does seem to do well:

Total unique [non-ignored] warnings: 4
Ignored notes / supplemental warning lines [not counted in unique warnings]: 0
Duplicated warning lines [not counted in unique warnings]: 0
Total ignored warnings: 0
Total unique kinds of warnings: 3
Total files with warnings: 2

# of Warnings by frequency (file count)
=======================================
[ 0]    2 ( 1) - Type mismatch between actual argument at (-) and actual argument at (-) (REAL(-)/INTEGER(-)).
[ 1]    1 ( 1) - Although not referenced, '-'time_fields'' has ambiguous interfaces at (-)
[ 2]    1 ( 1) - Although not referenced, '-'date_fields'' has ambiguous interfaces at (-)

# of Warnings by filename (warning type)
========================================
[  0]    2 ( 1) - /discover/swdev/mathomp4/Models/MAPL-GNU-Debug-Warnhist/MAPL/shared/MAPL_Sort.F90
[  1]    2 ( 2) - /discover/swdev/mathomp4/Models/MAPL-GNU-Debug-Warnhist/MAPL/base/MAPL_ISO8601_DateTime_ESMF.F90

Cool! Though, I will say warnhist -l seemed to do...nothing? I never got any line numbers out. (I also tried warnhist -d because I saw you mention it but that just exploded making me think I have no idea how it works. 😄 )

Next up is Intel:

make.Intel.log

and warnhist is not too happy. Now, one note on this is that this is ifort build output and not ifx so it's possible you don't want to waste any time on this as, well, ifort is EOL. We aren't quite ready for ifx with MAPL yet, but hopefully soon.

One other thing is we do build MAPL with the NAG Fortran compiler as well, so I might try to get you that output as well just so you can take a look at it.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days, it will be closed. You can add the "long term" tag to prevent the Stale bot from closing this issue.

mathomp4 commented 9 months ago

Whoops. This slipped for me. I need to test and run...

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had activity in the last 60 days. If there are no updates within 7 days, it will be closed. You can add the ":hourglass: Long Term" label to prevent the stale action from closing this issue.