-
Notifications
You must be signed in to change notification settings - Fork 375
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
base: master
Are you sure you want to change the base?
Conversation
638c9ee
to
2dad305
Compare
@@ -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; |
There was a problem hiding this comment.
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.
e6059a5
to
db503a5
Compare
7282da6
to
ea30f24
Compare
does this need a rebase now that #6908 is merged? |
We cannot pass "--rng-seed -123" as flag, so ensure that we have a POSITIVE seed
SCREAM_MPI_ON_DEVICE is *always* defined
a00b781
to
5ac2a9f
Compare
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