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

ARROW-2569: [C++] Improve thread pool size heuristic #2026

Closed
wants to merge 2 commits into from

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented May 10, 2018

The heuristic goes this way:

  • if the OMP_NUM_THREADS environment variable exists, it defines the baseline
    number of available threads
  • otherwise, the baseline is the value returned by std::thread::harware_concurrency()
  • the OMP_THREAD_LIMIT environment variable, if it exists, defined the upper bound
    for the final value, i.e. we return min(baseline, limit), otherwise we just
    return the baseline.

This is the heuristic used by other packages such as the GNU "nproc" utility.

@pitrou pitrou force-pushed the ARROW-2569-thread-pool-heuristic branch from d12886c to 694d871 Compare May 10, 2018 18:50
The heuristic goes this way:
- if the OMP_NUM_THREADS environment variable exists, it defines the baseline
  number of available threads
- otherwise, the baseline is the value returned by std::thread::harware_concurrency()
- the OMP_THREAD_LIMIT environment variable, if it exists, defined the upper bound
  for the final value, i.e. we return min(baseline, limit), otherwise we just
  return the baseline.

This is the heuristic used by other packages such as the GNU "nproc" utility.
@pitrou pitrou force-pushed the ARROW-2569-thread-pool-heuristic branch from 694d871 to 2dd0d12 Compare May 10, 2018 19:15
@codecov-io
Copy link

Codecov Report

Merging #2026 into master will increase coverage by 0.06%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2026      +/-   ##
==========================================
+ Coverage   87.41%   87.47%   +0.06%     
==========================================
  Files         189      178      -11     
  Lines       29256    28584     -672     
==========================================
- Hits        25573    25003     -570     
+ Misses       3683     3581     -102
Impacted Files Coverage Δ
cpp/src/arrow/util/thread-pool.h 92.3% <ø> (ø) ⬆️
cpp/src/arrow/util/io-util.h 100% <ø> (ø) ⬆️
cpp/src/arrow/util/thread-pool-test.cc 98.87% <100%> (+0.25%) ⬆️
cpp/src/arrow/util/io-util.cc 82.83% <63.15%> (-3.26%) ⬇️
cpp/src/arrow/util/thread-pool.cc 93.63% <95%> (+1.08%) ⬆️
cpp/src/plasma/test/client_tests.cc 100% <0%> (ø) ⬆️
rust/src/builder.rs
rust/src/datatypes.rs
rust/src/list.rs
rust/src/buffer.rs
... and 9 more

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 2093f6e...5572b07. Read the comment docs.

Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

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

+1, LGTM

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