Introduction of field API interface in ectrans#314
Open
dhaumont wants to merge 128 commits intoecmwf-ifs:developfrom
Open
Introduction of field API interface in ectrans#314dhaumont wants to merge 128 commits intoecmwf-ifs:developfrom
dhaumont wants to merge 128 commits intoecmwf-ifs:developfrom
Conversation
Without this a test with an incorrect argument still passes.
…into dump-checksums
samhatfield
added a commit
that referenced
this pull request
Apr 16, 2026
PR #314 begins the implementation of a Field API interface to ecTrans. This work must be tested using the build-hpc suite. But because the branch is hosted in an external repository, the build-hpc action is not taken from the source branch of the PR but rather the target branch (develop) (for security reasons). So, this PR enables the two features which enable the Field API feature to be tested in build-hpc. We commit them to develop, and then the build-hpc action run in PR #314 will inherit them. These two features should not have any effect when another branch is tested.
This reverts commit fc2e52b.
wdeconinck
pushed a commit
that referenced
this pull request
Apr 16, 2026
* Enable GPU_STATIC and FIELD_API features in build-hpc PR #314 begins the implementation of a Field API interface to ecTrans. This work must be tested using the build-hpc suite. But because the branch is hosted in an external repository, the build-hpc action is not taken from the source branch of the PR but rather the target branch (develop) (for security reasons). So, this PR enables the two features which enable the Field API feature to be tested in build-hpc. We commit them to develop, and then the build-hpc action run in PR #314 will inherit them. These two features should not have any effect when another branch is tested. * Move GPU_STATIC feature to toolchain * Make sure Field API is also built * Try not to build or enable Field API on LUMI * Try fixing CI error * Try again
Contributor
Author
|
@samhatfield @wdeconinck |
2dc498c to
45af499
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces a field API interface to ectrans. It is based on top of dump-checksums (PR #287)
Description of changes
The new field API interface is implemented in
src/field_api:src/field_api/trans/inv_trans_field_api.F90: inverse transform (calling inv_trans internally)src/field_api/trans/dir_trans_field_api.F90: direct transform (calling dir_trans internally)src/field_api/field_api_ectrans_mod.F90: helper functionsOptional compilation triggered by a new USE_FIELD_API configuration option. Adds a new dependency to field API.
Single and double precision for CPU and GPU
Accessible in ectrans-benchmark via a new option
--field-apisrc/programs/util/ectrans_field_api_helper.F90contains the field API implementationIn the GPU version of ectrans-benchmark , setting
llacc = .true.will force the intermediate fields on GPU. This requires additional memory copies host <-> device before and after the regular ectrans calls.New unit tests have been added to test
--field-api(CPU and GPU)compare_checksums.pyupdated to compare the checksums withfield-apiwith the regular versionnvhpc22.11 on CPU: bit reproducibility between the field API and the regular version has been partially adressed by clamping small values in spectral space after dir_trans in ectrans benchmark (2a7aa87). This only applies to double precision (single precision is only bit reproducible during the first time step and slightly different after)
Testing and validation
*Gfortran 13.3.0 - CPU : bit reproducible
Known limitations
llacc = .true.requires memory transfers between CPU and GPU, that should be avoidedInitial pull request
dhaumont#1
Contains some comments from @samhatfield that needs to be integrated
Prototype in ARPEGE
See for instance this prototype of transinv_mdl_field_api.F90: https://github.com/dhaumont/IAL/blob/50t1_field_api_ectrans/arpifs/transform/transinv_mdl_field_api.F90
This version can be compiled using this bundle:
50t1_ectrans_field_api_interface