-
Notifications
You must be signed in to change notification settings - Fork 52
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
[WIP] ENH: add ability to spawn MPI jobs from parent job #506
base: master
Are you sure you want to change the base?
Conversation
…ss via spawned MPI process
For the time being, I've created a new file called |
"""The MPISimulation class. | ||
|
||
Parameters | ||
---------- | ||
skip_mpi_import : bool | None | ||
Skip importing MPI. Only useful for testing with pytest. | ||
|
||
Attributes | ||
---------- | ||
comm : mpi4py.Comm object | ||
The handle used for communicating among MPI processes | ||
rank : int | ||
The rank for each processor part of the MPI communicator | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update docstring
hnn_core/parallel_backends.py
Outdated
if (not self.mpi_comm_spawn) and self.n_procs > 1: | ||
kill_proc_name('nrniv') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that kill_proc_name
only works when a subprocess is started with Popen
and appended to proc_queue
.
Codecov Report
@@ Coverage Diff @@
## master #506 +/- ##
==========================================
- Coverage 87.63% 86.75% -0.88%
==========================================
Files 19 20 +1
Lines 3792 3843 +51
==========================================
+ Hits 3323 3334 +11
- Misses 469 509 +40
Continue to review full report at Codecov.
|
I'm interested! You need to educate me a little over a video call what was the motivation, what are the pros/cons of spawning jobs through MPI vs Python etc |
Let's setup a time to chat more about this! |
I'd definitely like to be apart of the meeting as well. I'm wondering if this is also the reason why MPI doesn't work in WSL? |
Propose a time! I'm okay with Wed/Thu afternoon and anytime Friday. |
FYI, I think the reason Correspondingly, unit tests that explicitly test the guts of |
seems like this might be a way to go: https://mpi4py.readthedocs.io/en/stable/mpi4py.run.html using an |
Yes, this is what I've been doing when calling |
Minor update, I finally got this branch to run off of a master MPI process on Oscar (Brown's HPC). See here for a demo. |
The goal here is to allow
MPIBackend
to spawn child jobs from an existing MPI job/communicator. A user could then run any simulation script (e.g.,plot_simulate_mpi_backend.py
) from a computing cluster with the following command and it will spawn as many sub-processes as are specified byMPIBackend(n_procs=...)
to complete the simulation job:I'm currently interested in this use-case for two reasons:
MPIBackend
currently does.closes #477