File: oversubscribe_tests

package info (click to toggle)
pytest-mpi 0.6-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 404 kB
  • sloc: python: 2,070; makefile: 28; sh: 22
file content (23 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Author: Michael R. Crusoe <crusoe@debian.org>
Description: Allow the tests to oversubscribe the available number of cores
Forwarded: not-needed
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,11 +1,16 @@
 from logging import getLogger
+import os
 import sys
 
 import py
 import pytest
 
 log = getLogger(__name__)
-MPI_ARGS = ("mpirun", "-n")
+oversubscribe_option = os.environ.get("MPI_OVERSUBSCRIBE", "")
+if oversubscribe_option != "":
+    MPI_ARGS = ("mpirun", oversubscribe_option, "-n")
+else:
+    MPI_ARGS = ("mpirun", "-n")
 PYTEST_ARGS = (sys.executable, "-mpytest")