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

EAMxx: add IOPRemapper and use it in SPA and IOPDataManager #6914

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented Jan 17, 2025

Implement an IOP remapper, with the goal of simplifying downstream code, expressing it in terms of more generic interfaces.


@tcclevenger @AaronDonahue You guys should review only the last 3 commits of this branch, since the other ones are from the remappers-api-cleanup branch.

he main part of the PR is the IOPRemapper, but I wanted to verify its correctness by also using it somewhere. The easiest place was SPA, since it has minimal IOP-related stuff (only the single-col remap stuff). All in all, I think SPA gets simplified, and it gets to a good state to be later refactored in terms of a DataInterpolation structure.

I could also start using IOPRemapper in other places of the code (most notably inside the IOPDataManager class itself). Perhaps it's best to do things in steps though, and integrate one small change at a time? Or maybe @tcclevenger could do that step later, since he's more familiar with the IOP class and its assumptions?

Depends on #6908

@bartgol bartgol added BFB PR leaves answers BFB EAMxx PRs focused on capabilities for EAMxx code cleanup labels Jan 17, 2025
@bartgol bartgol self-assigned this Jan 17, 2025
@bartgol bartgol force-pushed the bartgol/eamxx/iop-remapper branch from 638c9ee to 2dad305 Compare January 20, 2025 17:25
@@ -18,7 +18,7 @@ inline int get_random_test_seed(const ekat::Comm* comm=nullptr)

std::random_device rdev;
const int catchRngSeed = Catch::rngSeed();
int seed = catchRngSeed==0 ? rdev() : catchRngSeed;
int seed = catchRngSeed==0 ? rdev()/2 : catchRngSeed;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is b/c you can't do ./my_test --rng-seed -123, since the cmd line arg parser interprets -123 as a flag, not as the value for --rng-seed. Since rdev() is an unsigned int, assigning it to an int can overflow. But if we divide by 2, we are SURE it will be <=2^31-1, which is in the range of int, guaranteeing that seed>=0.

@bartgol bartgol force-pushed the bartgol/eamxx/iop-remapper branch from e6059a5 to db503a5 Compare January 20, 2025 19:49
@bartgol bartgol changed the title EAMxx: add IOPRemapper class and try to use it in SPA EAMxx: add IOPRemapper and use it in SPA and IOPDataManager Jan 20, 2025
@bartgol bartgol force-pushed the bartgol/eamxx/iop-remapper branch from 7282da6 to ea30f24 Compare January 20, 2025 22:35
@tcclevenger
Copy link
Contributor

does this need a rebase now that #6908 is merged?

@bartgol bartgol force-pushed the bartgol/eamxx/iop-remapper branch from a00b781 to 5ac2a9f Compare January 21, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB code cleanup EAMxx PRs focused on capabilities for EAMxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants