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

Add column_accumulate and generalize column_reduce #1903

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

dennisYatunin
Copy link
Member

@dennisYatunin dennisYatunin commented Jul 25, 2024

This PR adds a column_accumulate! function that can accumulate values along each column of a Field, a pointwise Broadcasted object, or a columnwise StencilBroadcasted object. It also generalizes column_mapreduce!, which could only accept Fields, to column_reduce!, which can accept Broadcasted and StencilBroadcasted objects as well.

In addition, the column_integral_definite! and column_integral_indefinite! functions have been redefined in terms of column_reduce! and column_accumulate!, respectively. This API will generally allow us to define arbitrary "vertical sweep" operations without the need for custom kernel functions or external caches, which should allow us to simplify the non-orographic gravity wave parametrization in ClimaAtmos.

This PR also updates ClimaComms to 0.6.4 in all Manifest files to make use of the new device-flexible assert macro.

  • Code follows the style guidelines OR N/A.
  • Unit tests are included OR N/A.
  • Code is exercised in an integration test OR N/A.
  • Documentation has been added/updated OR N/A.

Copy link
Member

@charleskawczynski charleskawczynski 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, I left some comments, my main comment is: can we add some more granular unit tests?

@dennisYatunin dennisYatunin force-pushed the dy/column_accumulate branch 23 times, most recently from a574d46 to 0a6cbc9 Compare July 31, 2024 18:14
@dennisYatunin
Copy link
Member Author

I've enabled GPU support and added more unit tests. Adding the error handling for find_zero actually revealed that one of the profiles in ClimaAtmos was not converging for the default absolute tolerance of 0.001, so I changed it to a relative tolerance of 0.001. I'm going to move the device-specific @assert to ClimaComms, and then this will be ready to merge in. @charleskawczynski, could you please take another look?

@dennisYatunin dennisYatunin force-pushed the dy/column_accumulate branch 2 times, most recently from e58bb66 to 9b0a31d Compare August 1, 2024 00:44
@dennisYatunin dennisYatunin merged commit 217f60e into main Aug 1, 2024
18 of 20 checks passed
@dennisYatunin dennisYatunin deleted the dy/column_accumulate branch August 1, 2024 21:58
@dennisYatunin dennisYatunin added the enhancement New feature or request label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants