Helper function for MPI-accelerated GST fits#724
Open
rileyjmurray wants to merge 13 commits intodevelopfrom
Open
Helper function for MPI-accelerated GST fits#724rileyjmurray wants to merge 13 commits intodevelopfrom
rileyjmurray wants to merge 13 commits intodevelopfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
Protocol.run_mpi()to run MPI-accelerated protocols launched as a subprocess. This function can be called directly from a Jupyter notebook, an interactive Python session, or a plain script. It removes the need for the user to know about mpi4py (besides its existence) and the need to write their own MPI launcher scripts.Key changes
Added
Protocol.run_mpi(...)topygsti/protocols/protocol.py. Notable features of this function:num_ranks, an optionalwork_dir, forwarded**run_kwargs, and several keyword arguments for controlling launcher selection, thread counts, and dry-run behavior.num_ranks=1, it short-circuits to a plainself.run()call with no subprocess overhead.mpiexec,mpirun, ormpiexec.hydra) whenmpiexec='auto'.OMP_NUM_THREADS,MKL_NUM_THREADS, etc.) based on physical core count, with ablas_threads_per_rankoverride.dry_run=Truefor generating the launch command and writing data to a permanentwork_dirwithout executing. This is useful for embedding into HPC batch scripts.This new function is tested in
test/integration/test_gst_run_mpi.pyand demonstrated injupyter_notebooks/Examples/MPI-RunningGST-Automagic.ipynb.Minor change: tests in
test/unit/mpi/test_mpi.pyhave been made a little more robust. The MPI launcher checks bothmpiexecandmpirun. We pass--oversubscribeas appropriate so our use of 4 MPI ranks doesn't break on systems with < 4 physical CPU cores.Incidental changes
pygsti/tools/optools.py: extract real part of trace for Hermitian matrices (makes warning messages clearer)pygsti/report/colormaps.py,plotly_plot_ex.py: robustness against plotly version differences.numpy.corenamespace access removed (deprecated in NumPy 2.x).