-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
(Draft: allow disabling calculation in separate threads) #41
base: master
Are you sure you want to change the base?
Conversation
…wright/ranger into cindex_splitting
Fix travis link and add all R versions
Enable coveralls
Sorry for the delay. I finally found some time to play around with the R binding. If I understand it correctly, you must do the processing in a separate thread, even if |
Use codecov for coverage
In the Windows-R-build multithreading is not (yet) supported at all. We just print progress and check for user interrupt after computation of each tree. We could use this for num_threads = 1, too. |
I just checked the code-path for
Growing trees prints status after growing each tree:
Same for prediction (should also be the same for all remaining cases where I refactored WIN_R-handling the same way):
Could you please point me to the point where |
In the new version std::thread is used without In the R Windows version, an old gcc is used where std::thread is not available. The C++ Windows version should work fine. Btw, I never tried to build it on Windows, I usually cross compile, scripts are here: |
You are absolutely right - this code path was hidden to WIN_R before due to the ifdefs. Will change that. |
Current coverage is
|
Added the `enable_threading` flag to control whether parallel computations should be done in separate threads or right in the context of the calling thread. It is not exported as a command line argument as it does not make much sense there. But it is helpful when integrating ranger into another application that already has its own thread management or when creating separate threads per prediction introduce too much overhead.
cd7ef7d
to
b1620bd
Compare
@mnwright I fixed the mentioned issue and squashed the commits. Whats your opinion about the current state? |
Why hasn't this been merged yet? |
We still want this, but this PR is outdated. I'll probably have to start from scratch. |
Why: I'd like to integrate ranger into another application which already manages its thread pool and would like to therefore disable ranger's threading. Also spawning one or more threads per prediction call is also not an option latency-wise.
For now, this is just a draft as I'm not happy with the current state (esp. code path could be merged with the one inside the
#ifdef WIN_R_BUILD
) and would like to hear your feedback first.Regarding naming: Maybe
threading_enabled
would be more readable in the code?So what do you think?