NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
184 stars 139 forks source link

Feature request: ifx compiler usage for DART #595

Closed hkershaw-brown closed 5 months ago

hkershaw-brown commented 7 months ago

Use case

intel ifx compiler

Is your feature request related to a problem?

Deprecation of intel classic compiler ifort: https://community.intel.com/t5/Blogs/Tech-Innovation/Tools/Deprecation-of-The-Intel-Fortran-Compiler-Classic-ifort/post/1541699

Describe your preferred solution

Describe any alternatives you have considered

same as above but update fixsystem to have ifx option.

mjs2369 commented 6 months ago

@hkershaw-brown it seems that this has been addressed and can be closed?

The bullet point to replace fixsystem with f2008 standards is being addressed with the general update to the code to be compliant with the newer fortran standards

hkershaw-brown commented 6 months ago

Mechanically the ifx is available in dart (you can build with it no problem, and run the code.).

There is a part of the porting guide about the floating point behaviour:

Floating Point Behavior To get ifort behavior in floating point comparisons, ifx users should specify assume [no]ieee_compares and/or assume nan_compares. Tells the compiler to generate IEEE compareSignaling operations for floating point comparisons, as required by the Fortran 2018 standard. By default ifx assume NaNs are not going to be operands in floating point comparisons and does not generate that check for NaNs.
Linux -assume [no]ieee_compares Windows /assume:[no]ieee_compares fp-model | fp and fast The behavior with the fp-model | fp fast=1 or 2 option is different between ifort and ifx with respect to floating point compares. To get ifort behavior when using the fp-model or fp fast option with ifx, assume nan_compares should also be specified on the ifx command line. Linux -fp-model fast=1 or -fp-model fast=2 -assume nan_compares Windows /fp:fast 1 or /fp:fast 2 /assume:nan_compares

So in particular for us, how it deals with nans and how the fp model options affect the results -fp model (and fp fast=1, 2)

I think this needs a bit of exploration before marking this issue as done.

hkershaw-brown commented 6 months ago

NaN /= NaN test code https://github.com/NCAR/DART/issues/176#issuecomment-1087959115

mjs2369 commented 5 months ago

@hkershaw-brown the appropriate flags for ifx have been determined to be the same as ifort for now, including debugging and bitwise flags

For floating point behavior, "-fp-model precise" continues to work with ifx and produces bitwise results with intel (showing only a difference in the last 2 digits in the obs_seq.final files):

<   -4.89442558914450     (intel)
---
>   -4.89442558914443     (ifx)

For the NaN's, I do not believe that "-assume nan_compares" is needed, as the fp-model fast=1 or 2 options are not used. The NaN /= Nan test code (#176 (comment)) is appropriately returning true for a /= a , both with and without debugging flags.

hkershaw-brown commented 5 months ago

For floating point behavior, "-fp-model precise" continues to work with ifx and produces bitwise results with intel (showing only a difference in the last 2 digits in the obs_seq.final files):

so ifx-ifort is not bitwise reproducible

619 covers the fortran standards updates. Fixsystem is being investigated separately.