Skip to content

ccpp-prebuild: add blocked data tests and run prebuild tests in CI#515

Merged
climbfuji merged 6 commits intoNCAR:mainfrom
climbfuji:feature/ccpp_prebuild_blocked_data_ci_tests
Dec 6, 2023
Merged

ccpp-prebuild: add blocked data tests and run prebuild tests in CI#515
climbfuji merged 6 commits intoNCAR:mainfrom
climbfuji:feature/ccpp_prebuild_blocked_data_ci_tests

Conversation

@climbfuji
Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji commented Dec 1, 2023

Add a testing framework for blocked data structures in ccpp-prebuild, and run ccpp-prebuild tests in CI

The purpose of this PR is to prepare for upcoming changes to ccpp-prebuild to facilitate the transition to capgen. In a nutshell, we are going to add support for chunked data arrays and the use of horizontal_loop_begin / horizontal_loop_end to ccpp-prebuild. With that, we can switch the UFS and other models that use blocked data structures (SCM, NEPTUNE) over to contiguous arrays that get chunked up for parallel processing using OpenMP threading.

The expectation is that we'll be able to demonstrate similar or better performance and that we'll be able to remove support for blocked data structures afterwards (and in doing so won't have to add it to capgen).

This PR will be followed by a PR that adds ccpp-prebuild capabilities for contiguous data arrays, together with a test for the new functionality. After that, we can start working on the ufs-weather-model/SCM/NEPTUNE interface.

User interface changes?: No

Fixes #500

Testing:
test removed: n/a
tests added: ccpp-prebuild test for blocked data structures, added all ccpp-prebuild tests to CI
unit tests: n/a
system tests: n/a
manual testing: Ran existing and new ccpp-prebuild tests locally on my macOS

@climbfuji climbfuji force-pushed the feature/ccpp_prebuild_blocked_data_ci_tests branch from 04ba253 to 3714ef8 Compare December 1, 2023 18:40
@climbfuji climbfuji marked this pull request as ready for review December 1, 2023 18:52
@climbfuji climbfuji self-assigned this Dec 1, 2023
Copy link
Copy Markdown
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

One suggestion but looks okay (from a prebuild non-expert).

errmsg = ''
errflg = 0
! Check size of data array
write(0,'(a,i3)') 'In blocked_data_scheme_init: checking size of data array to be', sum(data_array_sizes)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I realize this is "only" test code but I wonder if we should start using the iso_fortran_env intrinsic module for raw numbers like these. Here, that would look like:

Suggested change
write(0,'(a,i3)') 'In blocked_data_scheme_init: checking size of data array to be', sum(data_array_sizes)
use, intrinsic :: iso_fortran_env, only: error_unit
write(error_unit,'(a,i3)') 'In blocked_data_scheme_init: checking size of data array to be', sum(data_array_sizes)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Great suggestion, thanks! I changed it in all Fortran files in the newly added test_prebuild/test_blocked_data directory, and CI tests passed.

Copy link
Copy Markdown
Member

@dustinswales dustinswales 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 to me.
Thanks for adding this new test!

@climbfuji climbfuji merged commit 0eca5c2 into NCAR:main Dec 6, 2023
@climbfuji climbfuji deleted the feature/ccpp_prebuild_blocked_data_ci_tests branch December 6, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate prebuild tests into capgen CI

3 participants