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

Create mkmf.template.nvhpc #557

Merged

Conversation

ann-norcio
Copy link
Contributor

@ann-norcio ann-norcio commented Oct 5, 2023

Description:

Created mkmf.template.nvhpc in build_templates to run quickbuild.sh with nvhpc compiler for all models on Derecho. Modified compiler flag FFLAGS = -O -Mbackslash $(INCS) to include -Mbackslash, which addresses issue #555

Fixes issue

Fixes: #554 #555

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Copy mkmf.template.nvhpc and set as your mkmf.template. Set compiler to nvhpc module load nvhpc. Then, run quickbuild.sh on DART/models/lorenz_63/work.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

Add mkmf.template.nvhpc in build_templates
@hkershaw-brown
Copy link
Member

hkershaw-brown commented Oct 6, 2023

Nice work testing out all the Derecho compilers and finding this, Ann.

There's code in dart that relies on IEEE standard that for a NaN, a /= a is .true.
Background reading if you're interested (#176, #341)

Can you trying building and running the following code on Derecho with nvhpc:

code test_nan.f90

program test_nan

implicit none
real :: a, x

x = -1
a = sqrt(x)

print*, a

print*, a /= a
print*, a == a

if (a /= a) then
  print*, "you have a NaN"
endif

end program test_nan

You can compile and run it like this:

ftn -Kieee test_nan.f90 -o test_nan
./test_nan

vs

ftn test_nan.f90 -o test_nan
./test_nan

We want to make sure a /= a gives .true. for a NaN (we may need to add -Kieee to the compile flags in your mkmf.template.)

And bonus points, can you add some suggested flags if you want to turn on debugging for nvhpc?

@hkershaw-brown
Copy link
Member

@hkershaw-brown the nan test should go in a developer test, since we are relying on the IEEE behaviour.

@mjs2369 mjs2369 self-requested a review October 9, 2023 20:59
Copy link
Member

@hkershaw-brown hkershaw-brown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Ann, I left a couple of suggestions for ieee and debugging flags.

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Oct 26, 2023
@hkershaw-brown hkershaw-brown linked an issue Oct 27, 2023 that may be closed by this pull request
Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the compile with the new debugging flags. Approved

@hkershaw-brown hkershaw-brown changed the base branch from main to quickbuild-mpif08 November 7, 2023 19:49
@hkershaw-brown hkershaw-brown merged commit 251ffb1 into NCAR:quickbuild-mpif08 Nov 7, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release! bundle with next release
Projects
None yet
3 participants