---
title: processes (latest version)
description: API reference for qiskit_addon_sqd.processes in the latest version of qiskit-addon-sqd
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-addon-sqd/processes
---

# 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

`is_mpi_execution()`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L75-L81)

Check if running in MPI mode.

**Returns**

`True` if MPI is detected.

**Return type**

[bool](https://docs.python.org/3/builtins/functions.html#bool)

### process\_index

`process_index()`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L93-L99)

Get the index of the current process.

**Returns**

Process index (0 for the control process).

**Return type**

[int](https://docs.python.org/3/builtins/functions.html#int)

### process\_count

`process_count()`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L102-L108)

Get the total number of collective processes.

**Returns**

Number of collective processes (1 if not in distributed mode).

**Return type**

[int](https://docs.python.org/3/builtins/functions.html#int)

### is\_control\_process

`is_control_process()`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L111-L117)

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**

[bool](https://docs.python.org/3/builtins/functions.html#bool)

### broadcast

`broadcast(obj, root=0)`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L120-L134)

Broadcast a picklable object to all processes.

**Parameters**

- **obj** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – Object to broadcast (only used on the root process).
- **root** ([*int*](https://docs.python.org/3/builtins/functions.html#int)) – Root process index (default: 0 = broadcast from the control process).

**Returns**

The broadcasted object on all ranks.

**Return type**

[*Any*](https://docs.python.org/3/library/typing.html#typing.Any)

### barrier

`barrier()`

[GitHub](https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.14/qiskit_addon_sqd/processes.py#L137-L144)

Synchronize all processes.

This is a no-op if not in distributed mode.

**Return type**

None
