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
ENH: Add instrumentation to monitor resources #984
Conversation
6431448
to
c5cd640
Compare
I'm still investigating why the recording pauses for about 100s just while the FSL fast process is kicked off. I suspect it has to do with threading, forking and locks. |
Two assumptions I should've been more explicit about:
If the new approach to monitoring works out, then we will see how to make it available to other users. |
f1eb7bc
to
cfe36d0
Compare
2ad11d9
to
0537657
Compare
Assuming all of your pure Python interfaces are trivial, this might work. Otherwise it's going to be hard to avoid bottlenecks related to the GIL.
Same issue here. Asyncio doesn't replace multiprocessing, it just allows us to skip writing our own callback queue. |
Python interfaces could also spawn their own process to overcome the GIL. I believe that having the main thread control a pool of threads instead of processes should, at least, ease the multiplicative effect of multiprocessing in terms of allocation. |
a6f7eea
to
a9176ee
Compare
41d7f6b
to
4259bab
Compare
4259bab
to
e4bdd4e
Compare
Alright - it seems like a good practice with apparently little cost. In e4bdd4e, I set up Then, we SHOULD NOT use the forkserver. It seems the forkserver doesn't kill workers (at least prior 3.11), and the default fork context works well, because of the new vms of the mother process. Finally, as a note for @satra, @mgxd, @effigies and other nipypers, we probably want to avoid the ProcessPool, which maintains the With the changes in this PR, and after the latest OMP=1 change, the RSS picture remains very similar (as expected): But the VMS picture has changed dramatically: (don't get deceived by the weird lines I removed from the plot da20809) |
This all comes about because of nipy/nipype#3456 |
b339e4f
to
2696389
Compare
Adds an instrumentation module which could be eventually packaged with nipype or standalone to keep track of resource utilization of mriqc.
For now, I'm testing the pattern and will try to write up some code to generate nice plots with the data.
cc/ @effigies @mgxd