Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions qiskit/tools/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
# Default False on Windows
if sys.platform == "win32":
PARALLEL_DEFAULT = False
# On python 3.9 default false to avoid deadlock issues
elif sys.version_info[0] == 3 and sys.version_info[1] == 9:
PARALLEL_DEFAULT = False
# On macOS default false on Python >=3.8
elif sys.platform == "darwin":
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
Expand Down
20 changes: 20 additions & 0 deletions releasenotes/notes/disable-39-multirpc-8618c89aeaa620f9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
issues:
- |
When running :func:`~qiskit.tools.parallel_map` (and functions that
internally call :func:`~qiskit.tools.parallel_map` such as
:func:`~qiskit.compiler.transpile` and :func:`~qiskit.compiler.assemble`)
on Python 3.9 with ``QISKIT_PARALLEL`` set to True in some scenarios it is
possible for the program to deadlock and never finish running. To avoid
this from happening the default for Python 3.9 was changed to not run in
parallel, but if ``QISKIT_PARALLEL`` is explicitly enabled then this
can still occur.
upgrade:
- |
The default value for ``QISKIT_PARALLEL`` on Python 3.9 environments has
changed to ``False``, this means that when running on Python 3.9 by default
multiprocessing will not be used. This was done to avoid a potential
deadlock/hanging issue that can occur when running multiprocessing on
Python 3.9 (see the known issues section for more detail). It is still
possible to manual enable it by explicitly setting the ``QISKIT_PARALLEL``
environment variable to ``TRUE``.