Skip to content

Conversation

@ndkeen
Copy link
Contributor

@ndkeen ndkeen commented Oct 21, 2025

With nvidia compiler on pm-cpu, we see new build fails looking for definition of isnan.

Fixes #7820

[bfb]

use shr_infnan_mod, only : isnan => shr_infnan_isnan
@ndkeen ndkeen added pm-cpu Perlmutter at NERSC (CPU-only nodes) nvidia nvidia compiler (formerly PGI) ELM land model labels Oct 21, 2025
@peterdschwartz peterdschwartz self-assigned this Oct 21, 2025
@bishtgautam
Copy link
Contributor

@ndkeen The label should be pm-gpu instead of pm-cpu. Right?

@ndkeen
Copy link
Contributor Author

ndkeen commented Oct 22, 2025

Well the e3sm_developer tests that we run every other day are on pm-cpu. So these are all CPU builds. There may be same issue on pm-gpu, but we still only use GNU compiler there.

@peterdschwartz
Copy link
Contributor

peterdschwartz commented Oct 22, 2025

Yeah, these NaN checks need to be removed. There's no valid reason for putting them inside hot loops like so. shr_infnan_isnan is a pure elemental procedure: meaning it can work on scalars and arrays of any dimension:

! For scalars:
if (isnan(x)) call endrun("x is NaN")

! For arrays
if ( any(isnan(arr1d)) ) call endrun("arr1d has NaN")
bad_cols => any(isnan(arr2d), dim=1)   ! per-column NaN flags
nbad = count(isnan(arr3d))             ! total NaNs

Not to mention debugging flags can already cause a backtrace when encountering a NaN.

peterdschwartz added a commit that referenced this pull request Oct 24, 2025
…#7821)

With nvidia compiler on pm-cpu, we see new build fails looking for definition of isnan.

Fixes #7820

[bfb]
@peterdschwartz peterdschwartz self-requested a review October 24, 2025 18:15
@peterdschwartz
Copy link
Contributor

merged to next

@peterdschwartz peterdschwartz merged commit effaf31 into master Oct 27, 2025
8 checks passed
@peterdschwartz peterdschwartz deleted the ndk/elm/fix-isnan-build-error-with-nvidia branch October 27, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ELM land model nvidia nvidia compiler (formerly PGI) pm-cpu Perlmutter at NERSC (CPU-only nodes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

With nvidia compiler, see build fails related to use of isnan

4 participants