-
Notifications
You must be signed in to change notification settings - Fork 532
[RF] Detachable run_command
process
#2787
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
Conversation
**Introduction**: the current implementation of ``run_command`` makes use of ``Stream``s to redirect output in a sort of inflexible way, and does not allow running the processes in the background. **This PR**: modifies the behavior of ``run_command`` opening a new self-control thread, that is in charge of printing to the terminal if the ``terminal_output`` is set to ``'stream'``. Output streams are redirected to files by default, trying to reduce the amount of data buffered in memory and also to ensure that there is a trace of nipype's execution. Additionally, a new argument ``background`` can be set to ``True``, detaching from the process. This lends itself to important improvements on the ``MultiProc`` variants, as all these processes can be launched directly from the main thread and run in the background. I hope this will drastically reduce the memory fingerprint of workers (if we actually need to maintain a ``Pool``, which is probably not the case anymore!). **Tests**: I've added a couple of tests, but I'm happy to add more as I am aware that this may be too big of a change to the nipype interfaces. **Extra**: removed a couple of deprecated objects that we promised to trash past nipype-1.1.0.
Codecov Report
@@ Coverage Diff @@
## master #2787 +/- ##
==========================================
- Coverage 66.8% 63.79% -3.01%
==========================================
Files 341 339 -2
Lines 43295 43334 +39
Branches 5369 5357 -12
==========================================
- Hits 28923 27646 -1277
- Misses 13623 14616 +993
- Partials 749 1072 +323
Continue to review full report at Codecov.
|
This is the first on a series of PRs to clean up Nipype interfaces.
…nto maint/outsource-checks
Hi, just a reminder that the 1.1.8 release is targeted for January 28. Please let us know if you'd like to try to finish this up for that release. |
I think I will start over, with less broad, smaller PRs to take on this. |
Summary
Introduction: the current implementation of
run_command
makes use ofStream
s to redirect output in a sort of inflexible way, and does not allow running the processes in the background.Ref #2776.
List of changes proposed in this PR (pull-request)
run_command
opening a new self-control thread, that is in charge of printing to the terminal if theterminal_output
is set to'stream'
background
can be set toTrue
, detaching from the process. This lends itself to important improvements on theMultiProc
variants, as all these processes can be launched directly from the main thread and run in the background. I hope this will drastically reduce the memory fingerprint of workers (if we actually need to maintain aPool
, which is probably not the case anymore!).Tests: I've added a couple of tests, but I'm happy to add more as I am aware that this may be too big of a change to the nipype interfaces.
Extra: removed a couple of deprecated objects that we promised to trash past nipype-1.1.0.
Acknowledgment