Processes
qiskit_addon_sqd.processes
Support for collective multi-process execution.
This module exists to support coordinated parallel execution across multiple isolated processes, with explicit global synchronization and communication (e.g., MPI-style SPMD collectives).
The current implementation relies on MPI, but the public interface is designed to support other collective-execution backends in the future.
is_mpi_execution
process_index
process_index()
Get the index of the current process.
Returns
Process index (0 for the control process).
Return type
process_count
process_count()
Get the total number of collective processes.
Returns
Number of collective processes (1 if not in distributed mode).
Return type
is_control_process
is_control_process()
Return True if the current process is the control process.
Returns
True if this is rank 0 or if not in distributed mode.
Return type
broadcast
broadcast(obj, root=0)
Broadcast a picklable object to all processes.
Parameters
- obj (Any) – Object to broadcast (only used on the root process).
- root (int) – Root process index (default: 0 = broadcast from the control process).
Returns
The broadcasted object on all ranks.
Return type