Skip to content

Commit 441e549

Browse files
authored
Reduce default parallelism of tox test runs (#1352)
Measurements of the total test time for different parallelism settings showed that total test time increased when `QISKIT_PARALLEL` was set to `TRUE` or `OMP_NUM_THREADS` was set higher than 1 when the `stestr` concurrency was higher than the number of physical cores. Additionally, no improvement was seen when increasing the `stestr` concurrency beyond the number of physical cores (for example up to two times that number on a system with 2x multithreading), but also no degradation in performance was observed, so the `stestr` concurrency was left at the default value (the number of logical CPUs rather than the number of physical CPUs) for simplicity.
1 parent d7c17fb commit 441e549

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

.github/workflows/cron-staging.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
if: runner.os == 'macOS'
4646
env:
4747
TEST_TIMEOUT: 120
48-
OMP_NUM_THREADS: 1
4948
docs:
5049
if: github.repository_owner == 'Qiskit-Extensions'
5150
name: docs

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
if: runner.os == 'macOS'
5959
env:
6060
TEST_TIMEOUT: 120
61-
OMP_NUM_THREADS: 1
6261
- name: Clean up stestr cache
6362
run: stestr history remove all
6463

tox.ini

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ setenv =
1010
VIRTUAL_ENV={envdir}
1111
QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
1212
QISKIT_TEST_CAPTURE_STREAMS=1
13+
OMP_NUM_THREADS={env:OMP_NUM_THREADS:1}
14+
QISKIT_PARALLEL={env:QISKIT_PARALLEL:FALSE}
15+
RAYON_NUM_THREADS={env:RAYON_NUM_THREADS:1}
1316
deps =
1417
-r{toxinidir}/requirements-dev.txt
1518
-r{toxinidir}/requirements-extras.txt
1619
passenv =
17-
OMP_NUM_THREADS
18-
QISKIT_PARALLEL
19-
RAYON_NUM_THREADS
2020
QISKIT_IBM_*
2121
TEST_TIMEOUT
2222
QE_USE_TESTTOOLS
@@ -35,21 +35,10 @@ commands =
3535
[testenv:qiskit-main]
3636
usedevelop = True
3737
install_command = pip install -U {opts} {packages}
38-
setenv =
39-
VIRTUAL_ENV={envdir}
40-
QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
41-
QISKIT_TEST_CAPTURE_STREAMS=1
4238
deps =
4339
git+https://github.com/Qiskit/qiskit
4440
-r{toxinidir}/requirements-dev.txt
4541
-r{toxinidir}/requirements-extras.txt
46-
passenv =
47-
OMP_NUM_THREADS
48-
QISKIT_PARALLEL
49-
RAYON_NUM_THREADS
50-
QISKIT_IBM_*
51-
TEST_TIMEOUT
52-
QE_USE_TESTTOOLS
5342
commands = stestr run {posargs}
5443

5544

0 commit comments

Comments
 (0)