Build flag to keep nvhpc GPU builds bit-identical with CPU builds #1287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order for MPAS-A OpenACC runs on GPU to remain bit-identical with the CPU runs, we need to use the
-Mnofma
( no Fuse-Multiply-Add) switch to the NVHPC CPU build and-Mnofma -gpu=math_uniform
for the NVHPC GPU builds. This PR introduces a new compile-time switchNVHPC_BFB
to request the CPU and GPU builds have these properties.Prior to this PR, the
-Mnofma
was only set insideFFLAGS_ACC
, which did nevertheless not apply to CPU builds. This has been fixed. Additionally, with this change, we could potentially remove the-Mnofma
option from the optimized builds, and only selectively request it for verifying the GPU results against the CPU reference.The usage is as follows:
CPU build:
GPU build: