-
Notifications
You must be signed in to change notification settings - Fork 446
EAMxx: add IOPRemapper and use it in SPA and IOPDataManager #6914
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
Conversation
638c9ee to
2dad305
Compare
| 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? |
5ac2a9f to
6ef410e
Compare
6ef410e to
f01ebc6
Compare
|
The CI runs keep getting stuck, and I have to kill them. There's probably a test that hangs. My guess is |
b8d85ef to
bafccd6
Compare
We cannot pass "--rng-seed -123" as flag, so ensure that we have a POSITIVE seed
SCREAM_MPI_ON_DEVICE is *always* defined
bafccd6 to
fab7bba
Compare
fab7bba to
a3925a8
Compare
|
@AaronDonahue @tcclevenger the tests finally pass and don't hange (I had introduced a tiny bug in SCMInput). You can review whenever you want. |
AaronDonahue
left a comment
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.
Am I correct in understanding that now SPA uses IOP functions for remapping? So this would make IOP a set of general use functions that could also be used for full model simulations?
Uhm, no. SPA uses IOPRemapper, which does not really know anything about IOP, or IOPDataManager. It only knows about a target lat/lon coordinates. It remaps (ncols_src,nlevs) to (ncols_tgt,nlevs), where the target fields have the same value for all columns, and those value match the column in the source field that is the closest to that lat/lon (across all ranks). As such, SPA does not know anything about IOP. It only knows that if IOPDataManager is set (it is set in all atm procs by the driver), it has to create an IOPRemapper, using the lat/lon stored inside it. |
tcclevenger
left a comment
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 looks great. I commented on the early return in the case of 0 fields, but feel free to ignore since it's not hurting anything.
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