You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate large (>10%) deviations in benchmark of test_grdlandmask_no_outgrid #2942
The test_grdlandmask_no_outgrid function's benchmark was added in #2911, but it seems like the performance has been deviating wildly (>10%) in many PRs since (e.g. #2937 (comment), #2938 (comment)), even though there has been no evident change in the code of grdlandmask or any of the underlying clib functions.
Seems that grdlandmask doesn't have the cores (-x) alias yet, so I've opened #2944 first to set the alias (and also see if setting a fixed cores=2 limit works). Will handle grdsample, sph2grd, etc separately in #2945.
Activity
weiji14 commentedon Jan 2, 2024
One hypothesis is that the high variance may be due to multithreading with OpenMP? These GMT functions support the
cores/-xparameter (searched using https://docs.generic-mapping-tools.org/6.4/search.html?q=OpenMP&check_keywords=yes&area=default), and seem to report significant variance between runs:grdlandmask- https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_grdlandmask.py::test_grdlandmask_no_outgridgrdsample- https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_grdsample.py::test_grdsample_dataarray_outsph2grd- https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_sph2grd.py::test_sph2grd_no_outgridHowever, there are also functions which support multi-threading but don't seem to have much variance:
grdimage- https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_grdimage.py::test_grdimage_grid_and_shading_with_xarray[png]grdfilter- https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_grdfilter.py::test_grdfilter_dataarray_in_dataarray_outAs a test, maybe we can limit the number of cores for these unit tests and see if the benchmarks become more stable.
seisman commentedon Jan 2, 2024
Sounds reasonable.
weiji14 commentedon Jan 2, 2024
Seems that
grdlandmaskdoesn't have the cores (-x) alias yet, so I've opened #2944 first to set the alias (and also see if setting a fixedcores=2limit works). Will handlegrdsample,sph2grd, etc separately in #2945.seisman commentedon Jan 6, 2024
The
test_grdlandmask_no_outgridtest has a relatively stable performance since the fix in PR #2944:https://codspeed.io/GenericMappingTools/pygmt/benchmarks/pygmt/tests/test_grdlandmask.py::test_grdlandmask_no_outgrid
Closing this issue.