-
Notifications
You must be signed in to change notification settings - Fork 40
Add tests for spherical harmonic transforms #348
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
|
Hello @sbrus89! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-05-13 18:27:20 UTC |
|
@xylar, this is still a work in progress, but I thought I'd submit the PR to get some initial feedback. |
xylar
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.
@sbrus89, this is really great work! I'm excited to have these tests.
In addition to my comments above, please fix all of the PEP8 issues indicated by pep8speaks in #348 (comment). If you want to leave some lines longer than 79 characters for readability, that's okay but flag those lines in a GitHub comment so I can have a look.
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/QU_convergence.cfg
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/mesh.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/mesh.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/mesh.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/mesh.py
Outdated
Show resolved
Hide resolved
| check_call(args, self.logger) | ||
|
|
||
| if not os.path.exists('mpas_to_grid_'+nLat+'.nc'): | ||
| args = ["ncremap", |
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.
I don't know if there are ways of telling ncremap to run in parallel. If so, it would be worth adding them like I've done for ESMF_RegridWeightGen below.
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/init.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/init.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/mesh.py
Outdated
Show resolved
Hide resolved
|
@sbrus89, it turns out
I will add it to MPAS-Analysis, though. |
compass/ocean/tests/spherical_harmonic_transform/QU_convergence/init.py
Outdated
Show resolved
Hide resolved
|
@sbrus89, is |
|
@xylar, it definitely is pointing those out. I just took a break because I respectfully disagreed with it on the remaining issues. |
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/init.py
Outdated
Show resolved
Hide resolved
|
I'm afraid I do insist on tabbing being a multiple of 4 and I will accept long lines but only under unusual circumstances. |
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/mesh.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/mesh.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/init.py
Outdated
Show resolved
Hide resolved
That's my fault, I thought it was complaining about the function lines I broke up. I agree about the 4 spaces. |
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/__init__.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/init.py
Outdated
Show resolved
Hide resolved
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/init.py
Outdated
Show resolved
Hide resolved
|
BTW, I know this PEP8 stuff is super annoying. I didn't appreciate it when Phil Wolfram insisted on it in my early python days. The way I explain it at this point is that it's the difference between a native python "speaker" and someone who "speak"s with a light (or a strong) Fortran accent. We can understand each other but it takes longer and it would make things smoother if we all stuck to the standard way of speaking, particularly when all of our code can easily become the example that the next developer works from. |
compass/ocean/tests/spherical_harmonic_transform/qu_convergence/__init__.py
Show resolved
Hide resolved
|
Its no problem, having a uniform standard is worth my being slightly annoyed for 10 minutes. Mostly I misunderstood what it was flagging. |
|
@sbrus89, please rebase and remove whatever commit(s) updated the E3SM-Project and MALI-Dev submodules. You can make updates to them locally for your testing but you should not commit changes to these submodules. We update them only in their own PRs and only with a review process that makes sure they don't introduce any unexpected changes. |
|
It looks like the submodule changes were probably committed accidentally in cee46a1, your most recent commit. If you can edit that commit to remove those changes before you rebase, I think it will make your life easier. |
|
@xylar, sorry about the submodules getting mixed up. I've fixed that and rebased. |
|
@sbrus89, testing on Anvil with Intel and Intel-MPI, I'm seeing this for Could this be out of memory? |
|
@xylar, did you happen to compile with |
|
Oops, nope. I used that branch but not the build flag. Sorry! |
|
No, not at all; that's my fault. you wouldn't have known unless I told you! |
|
I'm trying again. Now, when I build with |
|
I rebuild without |
|
One thing to consider is whether it makes sense to add another, much cheaper test that could be used for regression testing. |
|
@xylar, I added the user's and developer's guide documentation. I built it and it seemed to work for me. Let me know if you'd like to see any changes. Thanks! |
|
Great, @sbrus89! I'm doing a test merge with |
docs/users_guide/ocean/test_groups/spherical_harmonic_transform.rst
Outdated
Show resolved
Hide resolved
docs/users_guide/ocean/test_groups/spherical_harmonic_transform.rst
Outdated
Show resolved
Hide resolved
xylar
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.
I did a test merge with master and did a test run on Anvil with Intel and OpenMPI. This ran great for me:
test execution: SUCCESS
test runtime: 33:14
Test Runtimes:
33:14 PASS ocean_spherical_harmonic_transform_qu_convergence
Total runtime 33:16
PASS: All passed successfully!
The docs had some trouble building but that's unrelated to this PR. The new docs look good at a glance (I have to admit I didn't read them in a huge amount of detail).
Thanks, @sbrus89, for all the hard work here!
|
thanks for your help and patience, @xylar! |
These are convergence tests for the new spherical harmonic transform (SHT) routines which are used in computing the self attraction and loading (SAL) terms in tidal applications.
There are two different SHT algorithms that have been implemented in: E3SM-Project/E3SM#4472. One relies on a fast library for computing SHTs, but is serial. The other is a new parallel approach which is faster at higher core counts.