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

feat: enhance common model utils with classes for implementing double buffering #602

Merged
merged 9 commits into from
Nov 20, 2024

Conversation

egparedes
Copy link
Contributor

@egparedes egparedes commented Nov 20, 2024

Refactor and expand the model/common/utils module with simple implementation of utilities for to double-buffering like Pair. Additionally, fix the existing doctest for chainable.

@egparedes
Copy link
Contributor Author

cscs-ci run default

@egparedes
Copy link
Contributor Author

launch jenkins spack

@egparedes egparedes changed the title Refactor common model utils feat: enhance common model utils with Pair and named_property classes Nov 20, 2024
@egparedes egparedes changed the title feat: enhance common model utils with Pair and named_property classes feat: enhance common model utils with classes for implementing double buffering Nov 20, 2024
@egparedes egparedes marked this pull request as ready for review November 20, 2024 04:38
@egparedes
Copy link
Contributor Author

cscs-ci run default

@egparedes
Copy link
Contributor Author

launch jenkins spack

@egparedes
Copy link
Contributor Author

cscs-ci run default

@egparedes
Copy link
Contributor Author

launch jenkins spack



__all__ = [
# Classes
"DoubleBuffering",
"DoubleBufferingDataClassTrait",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that defined in _common ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, good catch, thanks.

class PreviousStepPair(Pair[T]):
current: T = Pair.first
previous: T = Pair.frozen_second

Copy link
Contributor

Choose a reason for hiding this comment

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

So where for example in the SolveNonhydro would you use those: in that if pattern where the do no swapping I assume you would use any of those. But does it need both? Or you are adding them only as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NextStepPair will be used for the double buffering of the prognostic state and PreviousStepPair is just an example and thus it could be deleted.

Copy link
Contributor

@halungge halungge left a comment

Choose a reason for hiding this comment

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

LGTM

@egparedes
Copy link
Contributor Author

cscs-ci run default

Copy link

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default
  • launch jenkins spack

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

In case your change might affect downstream icon-exclaim, please consider running

  • launch jenkins icon

For more detailed information please look at CI in the EXCLAIM universe.

@egparedes
Copy link
Contributor Author

cscs-ci run default

@egparedes egparedes merged commit 5820a8e into main Nov 20, 2024
2 of 3 checks passed
jcanton pushed a commit that referenced this pull request Nov 20, 2024
… buffering (#602)

Refactor and expand the model/common/utils module with simple implementation of utilities for to double-buffering like Pair. Additionally, fix the existing doctest for chainable.
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.

2 participants