Skip to content

Conversation

@weiji14
Copy link
Member

@weiji14 weiji14 commented Jan 2, 2024

Description of proposed changes

Benchmarking OpenMP multi-threaded algorithms with a fixed number of CPU cores, to ensure consistency of benchmarks.

Using a fixed core count of 2, which is the maximum number of CPU cores for GitHub Actions' Linux runners - https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

TODO:

Fixes #2942

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@weiji14 weiji14 self-assigned this Jan 2, 2024
@weiji14 weiji14 added this to the 0.11.0 milestone Jan 2, 2024
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Jan 2, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 2, 2024

CodSpeed Performance Report

Merging #2945 will not alter performance

⚠️ No base runs were found

Falling back to comparing benchmark-fixed-cores (08f36d2) with main (8be628e)

Summary

✅ 64 untouched benchmarks

Comment on lines 141 to 143
fig_ref.grdimage(
grid="@earth_relief_01d_g", region="GL", cmap="geo", shading=xrgrid
grid="@earth_relief_01d_g", region="GL", cmap="geo", shading=xrgrid, cores=2
)
Copy link
Member Author

@weiji14 weiji14 Jan 4, 2024

Choose a reason for hiding this comment

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

This line is raising an error at https://github.com/GenericMappingTools/pygmt/actions/runs/7404780202/job/20146784435?pr=2945#step:8:778:

 E           pygmt.exceptions.GMTCLibError: Module 'grdimage' failed with status code 72:
Error:      grdimage [ERROR]: Option -x given more than once
Error:      grdimage [ERROR]: Option -x parsing failure. Correct syntax:
Error:      grdimage [ERROR]: Offending option -x2

Equivalent GMT CLI command also fails (both on GMT 6.4.0 and GMT 6.5.0.dev9+0776994):

gmt grdimage @earth_relief_01d_g -RGL -Cgeo -x2 -png map
grdimage [ERROR]: Option -x given more than once
grdimage [ERROR]: Option -x parsing failure. Correct syntax:

   [-x[[-]<n>]] .
     Limit the number of cores used in multi-threaded algorithms [Default uses all 16 cores]. If <n> is negative then we select (16 - <n>) cores (or at least 1).
grdimage [ERROR]: Offending option -x2

Might be an upstream GMT bug?

Copy link
Member

Choose a reason for hiding this comment

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

very likely

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, reported upstream at GenericMappingTools/gmt#8256. I've reverted the grdimage commit at 08f36d2 for now.

@weiji14 weiji14 changed the title Benchmark grdsample and sph2grd with fixed cores Benchmark grdsample, grdfilter and sph2grd with fixed cores Jan 4, 2024
@weiji14 weiji14 marked this pull request as ready for review January 4, 2024 07:23
@seisman seisman merged commit 452ce23 into main Jan 4, 2024
@seisman seisman deleted the benchmark-fixed-cores branch January 4, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate large (>10%) deviations in benchmark of test_grdlandmask_no_outgrid

3 participants