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

Default to 2 threads but show a startup message #713

Merged
merged 6 commits into from
May 16, 2024
Merged

Default to 2 threads but show a startup message #713

merged 6 commits into from
May 16, 2024

Conversation

mnwright
Copy link
Member

@mnwright mnwright commented Dec 6, 2023

No description provided.

@mnwright
Copy link
Member Author

mnwright commented Dec 6, 2023

Implements #513.

@mnwright
Copy link
Member Author

mnwright commented Dec 6, 2023

Examples:

library(ranger)

ranger 0.16.0 using 2 threads (default). Change with num.threads in ranger() and predict(), options(Ncpus = N), options(ranger.num.threads = N) or environment variable R_RANGER_NUM_THREADS.

options(ranger.num.threads = 4)
library(ranger)

ranger 0.16.0 using 4 threads as set by options(ranger.num.threads = N). Can be overwritten with num.threads.

@mnwright
Copy link
Member Author

mnwright commented Dec 6, 2023

Now options(Ncpus = 4) also works.

Precedence:

  1. num.threads in ranger/predict call
  2. Environment variable R_RANGER_NUM_THREADS
  3. options(ranger.num.threads = N)
  4. options(Ncpus = N)

@mnwright mnwright merged commit 6786605 into master May 16, 2024
8 checks passed
@mnwright mnwright deleted the threading branch May 16, 2024 06:30
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.

1 participant