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

Add regridding benchmark #98

Merged
merged 4 commits into from
Aug 4, 2021

Conversation

stephenworsley
Copy link
Contributor

Adds benchmarks for the performing of regridding (after initialisation of a regridder). This is with a view to measuring the performance of different regridding solutions (i.e. sparse vs scipy.sparse). The benchmark is written to include cases involving higher to lower resolution, lower to higher, similar resolutions and a case where parts of the grid are high to low res and other parts are low to high res due to a rotated pole.

@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #98 (76ee1f5) into main (18bd622) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   98.82%   98.82%           
=======================================
  Files          14       14           
  Lines         678      678           
=======================================
  Hits          670      670           
  Misses          8        8           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18bd622...76ee1f5. Read the comment docs.

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

I think this looks good to me, although I'm inexperienced in the use of the package so I might have missed something.

)
tgt = _grid_cube(n_lons_tgt, n_lats_tgt, lon_bounds, lat_bounds)
src_data = np.arange(n_lats_src * n_lons_src * h).reshape(
[n_lats_src, n_lons_src, h]
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the switch in ordering from lon-lat to lat-lon is deliberate to make sure that some regridding work is required? Otherwise it's unnecessarily confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might be a hang over from somewhere in CF refering to dimensions in the reverse order to how they are described in numpy. I can't remember why it is this way, but i believe this is inherited from how it is done in other tests. I might have another look into if this still makes sense.

benchmarks/benchmarks/ci/esmf_regridder.py Show resolved Hide resolved
Copy link
Member

@jamesp jamesp left a comment

Choose a reason for hiding this comment

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

Looks good @stephenworsley, do you have any examples of the output it produces?

Also, should we be timing the creation of the regridder object as well as using it to regrid?

benchmarks/benchmarks/ci/esmf_regridder.py Show resolved Hide resolved
@stephenworsley
Copy link
Contributor Author

@jamesp the output is a bit hidden but you can find an example here https://cirrus-ci.com/task/4756773006475264 by clicking through the CI.

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.

3 participants