Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-threadpoolctl for
openSUSE:Factory checked in at 2021-07-21 19:05:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-threadpoolctl (Old)
and /work/SRC/openSUSE:Factory/.python-threadpoolctl.new.2632 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-threadpoolctl"
Wed Jul 21 19:05:44 2021 rev:3 rq:907015 version:2.2.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-threadpoolctl/python-threadpoolctl.changes
2020-07-26 16:19:51.536837182 +0200
+++
/work/SRC/openSUSE:Factory/.python-threadpoolctl.new.2632/python-threadpoolctl.changes
2021-07-21 19:06:40.327321936 +0200
@@ -1,0 +2,12 @@
+Mon Jul 19 06:27:59 UTC 2021 - Dirk M??ller <[email protected]>
+
+- update to 2.2.0:
+ - Report the architecture of the CPU cores detected by OpenBLAS
+ (`openblas_get_corename`) in `threadpool_info()` and BLIS
+ (`bli_arch_query_id` and `bli_arch_string`).
+ - Fixed a bug when the version of MKL was not found. The
+ "version" field is now set to None in that case.
+ https://github.com/joblib/threadpoolctl/pull/82
+- drop python_executable.patch (upstream)
+
+-------------------------------------------------------------------
Old:
----
python_executable.patch
threadpoolctl-2.1.0.tar.gz
New:
----
threadpoolctl-2.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-threadpoolctl.spec ++++++
--- /var/tmp/diff_new_pack.5K7TbK/_old 2021-07-21 19:06:40.727322632 +0200
+++ /var/tmp/diff_new_pack.5K7TbK/_new 2021-07-21 19:06:40.731322638 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-threadpoolctl
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,15 +19,13 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-threadpoolctl
-Version: 2.1.0
+Version: 2.2.0
Release: 0
Summary: Thread-pool Controls
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/joblib/threadpoolctl
Source:
https://files.pythonhosted.org/packages/source/t/threadpoolctl/threadpoolctl-%{version}.tar.gz
-# fix python executable in tests
-Patch0: python_executable.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
@@ -43,7 +41,6 @@
%prep
%setup -q -n threadpoolctl-%{version}
-%patch0 -p1
%build
%python_build
++++++ threadpoolctl-2.1.0.tar.gz -> threadpoolctl-2.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/.azure_pipeline.yml
new/threadpoolctl-2.2.0/.azure_pipeline.yml
--- old/threadpoolctl-2.1.0/.azure_pipeline.yml 2019-12-05 18:35:15.725775700
+0100
+++ new/threadpoolctl-2.2.0/.azure_pipeline.yml 2021-07-09 17:07:11.570647200
+0200
@@ -18,48 +18,48 @@
pylatest_conda:
VERSION_PYTHON: '*'
PACKAGER: 'conda'
- py36_conda:
- VERSION_PYTHON: '3.6'
+ py37_conda:
+ VERSION_PYTHON: '3.7'
PACKAGER: 'conda'
- py35_pip:
- VERSION_PYTHON: '3.5'
+ py36_pip:
+ VERSION_PYTHON: '3.6'
PACKAGER: 'pip'
- template: continuous_integration/posix.yml
parameters:
name: Linux
- vmImage: ubuntu-16.04
+ vmImage: ubuntu-20.04
matrix:
- # Linux environment to test that packages that comes with Ubuntu Xenial
- # 16.04 are correctly handled.
- py35_ubuntu_atlas_gcc_gcc:
+ # Linux environment to test that packages that comes with Ubuntu 20.04
+ # are correctly handled.
+ py38_ubuntu_atlas_gcc_gcc:
PACKAGER: 'ubuntu'
- APT_BLAS: 'libatlas3-base libatlas-base-dev libatlas-dev'
- VERSION_PYTHON: '3.5'
+ APT_BLAS: 'libatlas3-base libatlas-base-dev'
+ VERSION_PYTHON: '3.8'
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
LINT: 'true'
- py35_ubuntu_openblas_gcc_gcc:
+ py36_ubuntu_openblas_gcc_gcc:
PACKAGER: 'ubuntu'
APT_BLAS: 'libopenblas-base libopenblas-dev'
- VERSION_PYTHON: '3.5'
+ VERSION_PYTHON: '3.8'
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
- # Linux + Python 3.6 and homogeneous runtime nesting.
- py36_conda_openblas_clang_clang:
+ # Linux + Python 3.7 and homogeneous runtime nesting.
+ py37_conda_openblas_clang_clang:
PACKAGER: 'conda'
- VERSION_PYTHON: '3.6'
+ VERSION_PYTHON: '3.7'
BLAS: 'openblas'
- CC_OUTER_LOOP: 'clang-8'
- CC_INNER_LOOP: 'clang-8'
+ CC_OUTER_LOOP: 'clang-10'
+ CC_INNER_LOOP: 'clang-10'
# Linux environment with MKL and Clang (known to be unsafe for
# threadpoolctl) to only test the warning from multiple OpenMP.
pylatest_conda_mkl_clang_gcc:
PACKAGER: 'conda'
VERSION_PYTHON: '*'
BLAS: 'mkl'
- CC_OUTER_LOOP: 'clang-8'
+ CC_OUTER_LOOP: 'clang-10'
CC_INNER_LOOP: 'gcc'
TESTS: 'libomp_libiomp_warning'
# Linux environment with MKL, safe for threadpoolctl.
@@ -70,13 +70,13 @@
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
MKL_THREADING_LAYER: 'INTEL'
- # Linux + Python 3.7 with numpy / scipy installed with pip from PyPI
+ # Linux + Python 3.8 with numpy / scipy installed with pip from PyPI
# and heterogeneous OpenMP runtimes.
- py37_pip_openblas_gcc_clang:
+ py38_pip_openblas_gcc_clang:
PACKAGER: 'pip'
- VERSION_PYTHON: '3.7'
+ VERSION_PYTHON: '3.8'
CC_OUTER_LOOP: 'gcc'
- CC_INNER_LOOP: 'clang-8'
+ CC_INNER_LOOP: 'clang-10'
# Linux environment with numpy from conda-forge channel
pylatest_conda_forge:
PACKAGER: 'conda-forge'
@@ -89,7 +89,7 @@
NO_NUMPY: 'true'
VERSION_PYTHON: '*'
CC_OUTER_LOOP: 'gcc'
- CC_INNER_LOOP: 'clang-8'
+ CC_INNER_LOOP: 'clang-10'
# Linux environment with numpy linked to BLIS
pylatest_blis_gcc_clang_openmp:
PACKAGER: 'conda'
@@ -98,15 +98,15 @@
BLIS_NUM_THREADS: '4'
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
- BLIS_CC: 'clang-8'
+ BLIS_CC: 'clang-10'
BLIS_ENABLE_THREADING: 'openmp'
pylatest_blis_clang_gcc_pthreads:
PACKAGER: 'conda'
VERSION_PYTHON: '*'
INSTALL_BLIS: 'true'
BLIS_NUM_THREADS: '4'
- CC_OUTER_LOOP: 'clang-8'
- CC_INNER_LOOP: 'clang-8'
+ CC_OUTER_LOOP: 'clang-10'
+ CC_INNER_LOOP: 'clang-10'
BLIS_CC: 'gcc-8'
BLIS_ENABLE_THREADING: 'pthreads'
pylatest_blis_no_threading:
@@ -122,13 +122,13 @@
- template: continuous_integration/posix.yml
parameters:
name: macOS
- vmImage: xcode9-macos10.13
+ vmImage: macOS-10.14
matrix:
# MacOS environment with OpenMP installed through homebrew
- py35_conda_homebrew_libomp:
+ py36_conda_homebrew_libomp:
PACKAGER: 'conda'
- VERSION_PYTHON: '3.5'
- BLAS: 'mkl'
+ VERSION_PYTHON: '3.6'
+ BLAS: 'openblas'
CC_OUTER_LOOP: 'clang'
CC_INNER_LOOP: 'clang'
INSTALL_LIBOMP: 'homebrew'
@@ -149,7 +149,7 @@
- job: 'no_test_always_skipped'
displayName: 'No test always skipped'
pool:
- vmImage: ubuntu-16.04
+ vmImage: ubuntu-20.04
steps:
- download: current
- script: |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/CHANGES.md
new/threadpoolctl-2.2.0/CHANGES.md
--- old/threadpoolctl-2.1.0/CHANGES.md 2020-05-29 11:11:42.282364600 +0200
+++ new/threadpoolctl-2.2.0/CHANGES.md 2021-07-09 17:07:41.353976000 +0200
@@ -1,3 +1,14 @@
+2.2.0 (2021-07-09)
+==================
+
+- Report the architecture of the CPU cores detected by OpenBLAS
+ (`openblas_get_corename`) in `threadpool_info()` and BLIS
+ (`bli_arch_query_id` and `bli_arch_string`).
+
+- Fixed a bug when the version of MKL was not found. The
+ "version" field is now set to None in that case.
+ https://github.com/joblib/threadpoolctl/pull/82
+
2.1.0 (2020-05-29)
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/PKG-INFO
new/threadpoolctl-2.2.0/PKG-INFO
--- old/threadpoolctl-2.1.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/threadpoolctl-2.2.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: threadpoolctl
-Version: 2.1.0
+Version: 2.2.0
Summary: threadpoolctl
Home-page: https://github.com/joblib/threadpoolctl
Author: Thomas Moreau
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/README.md
new/threadpoolctl-2.2.0/README.md
--- old/threadpoolctl-2.1.0/README.md 2020-05-25 11:10:49.357650500 +0200
+++ new/threadpoolctl-2.2.0/README.md 2021-04-19 23:03:41.696679600 +0200
@@ -186,7 +186,7 @@
The initial dynamic library introspection code was written by @anton-malakhov
for the smp package available at https://github.com/IntelPython/smp .
-threadpoolctl extends this for other operationg systems. Contrary to smp,
+threadpoolctl extends this for other operating systems. Contrary to smp,
threadpoolctl does not attempt to limit the size of Python multiprocessing
pools (threads or processes) or set operating system-level CPU affinity
constraints: threadpoolctl only interacts with native libraries via their
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/continuous_integration/install.sh
new/threadpoolctl-2.2.0/continuous_integration/install.sh
--- old/threadpoolctl-2.1.0/continuous_integration/install.sh 2020-01-15
18:11:18.295909400 +0100
+++ new/threadpoolctl-2.2.0/continuous_integration/install.sh 2021-07-09
17:07:11.571100700 +0200
@@ -4,13 +4,12 @@
UNAMESTR=`uname`
-if [[ "$CC_OUTER_LOOP" == "clang-8" || "$CC_INNER_LOOP" == "clang-8" ]]; then
+if [[ "$CC_OUTER_LOOP" == "clang-10" || "$CC_INNER_LOOP" == "clang-10" ]]; then
# Assume Ubuntu: install a recent version of clang and libomp
- echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" | sudo
tee -a /etc/apt/sources.list.d/llvm.list
- echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" |
sudo tee -a /etc/apt/sources.list.d/llvm.list
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt update
- sudo apt install clang-8 libomp-8-dev
+ wget https://apt.llvm.org/llvm.sh
+ chmod +x llvm.sh
+ sudo ./llvm.sh 10
+ sudo apt-get install libomp-dev
fi
make_conda() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/continuous_integration/install_with_blis.sh
new/threadpoolctl-2.2.0/continuous_integration/install_with_blis.sh
--- old/threadpoolctl-2.1.0/continuous_integration/install_with_blis.sh
2019-12-05 17:00:26.111492000 +0100
+++ new/threadpoolctl-2.2.0/continuous_integration/install_with_blis.sh
2021-07-09 17:07:11.571334100 +0200
@@ -6,12 +6,11 @@
ABS_PATH=$(pwd)
popd
-# Assume Ubuntu: install a recent version of clang and libomp
-echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" | sudo tee
-a /etc/apt/sources.list.d/llvm.list
-echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" | sudo
tee -a /etc/apt/sources.list.d/llvm.list
-wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
-sudo apt update
-sudo apt install clang-8 libomp-8-dev
+# Install a recent version of clang and libomp
+wget https://apt.llvm.org/llvm.sh
+chmod +x llvm.sh
+sudo ./llvm.sh 10
+sudo apt-get install libomp-dev
# create conda env
conda create -n $VIRTUALENV -q --yes python=$VERSION_PYTHON pip cython
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/continuous_integration/posix.yml
new/threadpoolctl-2.2.0/continuous_integration/posix.yml
--- old/threadpoolctl-2.1.0/continuous_integration/posix.yml 2019-12-05
17:00:26.115491900 +0100
+++ new/threadpoolctl-2.2.0/continuous_integration/posix.yml 2021-04-19
23:03:41.697651100 +0200
@@ -13,7 +13,7 @@
steps:
- script: |
- pip3 install flake8
+ sudo apt-get install python3-flake8
python3 -m flake8 .
displayName: Lint
condition: eq(variables['LINT'], 'true')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/pyproject.toml
new/threadpoolctl-2.2.0/pyproject.toml
--- old/threadpoolctl-2.1.0/pyproject.toml 2019-06-05 15:47:27.914565600
+0200
+++ new/threadpoolctl-2.2.0/pyproject.toml 2021-07-09 17:07:11.571540000
+0200
@@ -8,13 +8,15 @@
author-email = "[email protected]"
home-page = "https://github.com/joblib/threadpoolctl"
description-file = "README.md"
-requires-python = ">=3.5"
+requires-python = ">=3.6"
+license = "BSD-3-Clause"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Libraries :: Python Modules",
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/setup.py
new/threadpoolctl-2.2.0/setup.py
--- old/threadpoolctl-2.1.0/setup.py 1970-01-01 01:00:00.000000000 +0100
+++ new/threadpoolctl-2.2.0/setup.py 1970-01-01 01:00:00.000000000 +0100
@@ -5,11 +5,11 @@
setup(name='threadpoolctl',
- version='2.1.0',
+ version='2.2.0',
description='threadpoolctl',
author='Thomas Moreau',
author_email='[email protected]',
url='https://github.com/joblib/threadpoolctl',
py_modules=['threadpoolctl'],
- python_requires='>=3.5',
+ python_requires='>=3.6',
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/tests/_openmp_test_helper/__init__.py
new/threadpoolctl-2.2.0/tests/_openmp_test_helper/__init__.py
--- old/threadpoolctl-2.1.0/tests/_openmp_test_helper/__init__.py
2020-05-25 11:10:49.357650500 +0200
+++ new/threadpoolctl-2.2.0/tests/_openmp_test_helper/__init__.py
2021-04-19 23:03:41.698537000 +0200
@@ -1,17 +0,0 @@
-from .openmp_helpers_inner import check_openmp_num_threads
-from .openmp_helpers_inner import get_compiler as get_inner_compiler
-from .openmp_helpers_outer import check_nested_openmp_loops
-from .openmp_helpers_outer import get_compiler as get_outer_compiler
-
-try:
- from .nested_prange_blas import check_nested_prange_blas
-except ImportError:
- # Can happen if numpy and scipy are missing.
- check_nested_prange_blas = None
-
-
-__all__ = ["check_openmp_num_threads",
- "check_nested_openmp_loops",
- "check_nested_prange_blas",
- "get_inner_compiler",
- "get_outer_compiler"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_inner.pxd
new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_inner.pxd
--- old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_inner.pxd
2019-06-05 15:47:27.918565500 +0200
+++ new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_inner.pxd
2021-04-19 23:03:41.698835100 +0200
@@ -1 +1 @@
-cdef int inner_openmp_loop(int) nogil
\ No newline at end of file
+cdef int inner_openmp_loop(int) nogil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_inner.pyx
new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_inner.pyx
--- old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_inner.pyx
2019-06-05 15:47:27.918565500 +0200
+++ new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_inner.pyx
2021-04-19 23:03:41.698938000 +0200
@@ -36,7 +36,3 @@
return -1
return num_threads
-
-
-def get_compiler():
- return CC_INNER_LOOP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_outer.pyx
new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_outer.pyx
--- old/threadpoolctl-2.1.0/tests/_openmp_test_helper/openmp_helpers_outer.pyx
2019-06-05 15:47:27.918565500 +0200
+++ new/threadpoolctl-2.2.0/tests/_openmp_test_helper/openmp_helpers_outer.pyx
2021-04-19 23:03:41.699032500 +0200
@@ -20,7 +20,3 @@
outer_num_threads = openmp.omp_get_num_threads()
return outer_num_threads, inner_num_threads
-
-
-def get_compiler():
- return CC_OUTER_LOOP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/tests/test_threadpoolctl.py
new/threadpoolctl-2.2.0/tests/test_threadpoolctl.py
--- old/threadpoolctl-2.1.0/tests/test_threadpoolctl.py 2020-05-25
11:10:49.357650500 +0200
+++ new/threadpoolctl-2.2.0/tests/test_threadpoolctl.py 2021-07-09
17:07:11.571895800 +0200
@@ -11,6 +11,7 @@
from .utils import cython_extensions_compiled
from .utils import libopenblas_paths
from .utils import scipy
+from .utils import threadpool_info_from_subprocess
def is_old_openblas(module):
@@ -169,7 +170,8 @@
def test_openmp_limit_num_threads(num_threads):
# checks that OpenMP effectively uses the number of threads requested by
# the context manager
- from ._openmp_test_helper import check_openmp_num_threads
+ import tests._openmp_test_helper.openmp_helpers_inner as omp_inner
+ check_openmp_num_threads = omp_inner.check_openmp_num_threads
old_num_threads = check_openmp_num_threads(100)
@@ -179,37 +181,40 @@
@pytest.mark.skipif(not cython_extensions_compiled,
- reason='Requires cython extensions to be compiled')
[email protected]('nthreads_outer', [None, 1, 2, 4])
+ reason="Requires cython extensions to be compiled")
[email protected]("nthreads_outer", [None, 1, 2, 4])
def test_openmp_nesting(nthreads_outer):
# checks that OpenMP effectively uses the number of threads requested by
# the context manager when nested in an outer OpenMP loop.
- from ._openmp_test_helper import check_nested_openmp_loops
- from ._openmp_test_helper import get_inner_compiler
- from ._openmp_test_helper import get_outer_compiler
+ import tests._openmp_test_helper.openmp_helpers_outer as omp_outer
+ check_nested_openmp_loops = omp_outer.check_nested_openmp_loops
- inner_cc = get_inner_compiler()
- outer_cc = get_outer_compiler()
+ # Find which OpenMP lib is used at runtime for inner loop
+ inner_info = threadpool_info_from_subprocess(
+ "tests._openmp_test_helper.openmp_helpers_inner")
+ assert len(inner_info) == 1
+ inner_omp = inner_info[0]["prefix"]
+
+ # Find which OpenMP lib is used at runtime for outer loop
+ outer_info = threadpool_info_from_subprocess(
+ "tests._openmp_test_helper.openmp_helpers_outer")
+ if len(outer_info) == 1:
+ # Only 1 openmp loaded. It has to be this one.
+ outer_omp = outer_info[0]["prefix"]
+ else:
+ # There are 2 openmp, the one from inner and the one from outer.
+ assert len(outer_info) == 2
+ # We already know the one from inner. It has to be the other one.
+ prefixes = {module["prefix"] for module in outer_info}
+ outer_omp = prefixes - {inner_omp}
outer_num_threads, inner_num_threads = check_nested_openmp_loops(10)
-
original_info = _threadpool_info()
- openmp_info = original_info.get_modules("user_api", "openmp")
-
- if "gcc" in (inner_cc, outer_cc):
- assert original_info.get_modules("prefix", "libgomp")
- if "clang" in (inner_cc, outer_cc):
- assert original_info.get_modules("prefix", "libomp")
-
- if inner_cc == outer_cc:
- # The openmp runtime should be shared by default, meaning that
- # the inner loop should automatically be run serially by the OpenMP
- # runtime.
+ if inner_omp == outer_omp:
+ # The OpenMP runtime should be shared by default, meaning that the
+ # inner loop should automatically be run serially by the OpenMP runtime
assert inner_num_threads == 1
- else:
- # There should be at least 2 OpenMP runtime detected.
- assert len(openmp_info) >= 2
with threadpool_limits(limits=1) as threadpoolctx:
max_threads = threadpoolctx.get_original_num_threads()["openmp"]
@@ -229,8 +234,8 @@
assert outer_num_threads == nthreads
# The number of threads available in the inner loop should have been
- # set to 1 so avoid oversubscription and preserve performance:
- if inner_cc != outer_cc:
+ # set to 1 to avoid oversubscription and preserve performance:
+ if inner_omp != outer_omp:
if inner_num_threads != 1:
# XXX: this does not always work when nesting independent openmp
# implementations. See: https://github.com/jeremiedbb/Nested_OpenMP
@@ -271,7 +276,8 @@
# threads requested by the context manager when nested in an outer OpenMP
# loop.
import numpy as np
- from ._openmp_test_helper import check_nested_prange_blas
+ import tests._openmp_test_helper.nested_prange_blas as prange_blas
+ check_nested_prange_blas = prange_blas.check_nested_prange_blas
original_info = _threadpool_info()
@@ -372,7 +378,7 @@
reason='Requires cython extensions to be compiled')
def test_libomp_libiomp_warning(recwarn):
# Trigger the import of a potentially clang-compiled extension:
- from ._openmp_test_helper import check_nested_openmp_loops # noqa
+ import tests._openmp_test_helper.openmp_helpers_outer # noqa
# Trigger the import of numpy to potentially import Intel OpenMP via MKL
pytest.importorskip("numpy.linalg")
@@ -382,8 +388,8 @@
info = _threadpool_info()
prefixes = [module.prefix for module in info]
- if not ("libomp" in prefixes and "libiomp" in prefixes
- and sys.platform == "linux"):
+ if not ("libomp" in prefixes and "libiomp" in prefixes and
+ sys.platform == "linux"):
pytest.skip("Requires both libomp and libiomp loaded, on Linux")
assert len(recwarn) == 1
@@ -396,14 +402,14 @@
def test_command_line_empty():
output = subprocess.check_output(
- "python -m threadpoolctl".split())
+ (sys.executable + " -m threadpoolctl").split())
assert json.loads(output.decode("utf-8")) == []
def test_command_line_command_flag():
pytest.importorskip("numpy")
output = subprocess.check_output(
- ["python", "-m", "threadpoolctl", "-c", "import numpy"])
+ [sys.executable, "-m", "threadpoolctl", "-c", "import numpy"])
cli_info = json.loads(output.decode("utf-8"))
this_process_info = threadpool_info()
@@ -415,7 +421,7 @@
reason="need recent subprocess.run options")
def test_command_line_import_flag():
result = subprocess.run([
- "python", "-m", "threadpoolctl", "-i",
+ sys.executable, "-m", "threadpoolctl", "-i",
"numpy",
"scipy.linalg",
"invalid_package",
@@ -434,3 +440,26 @@
assert "WARNING: could not import scipy.linalg" in warnings
else:
assert "WARNING: could not import scipy.linalg" not in warnings
+
+
+def test_architecture():
+ expected_openblas_architectures = (
+ # XXX: add more as needed by CI or developer laptops
+ "armv8",
+ "Haswell",
+ "SkylakeX",
+ "Sandybridge",
+ )
+ expected_blis_architectures = (
+ # XXX: add more as needed by CI or developer laptops
+ "skx",
+ "haswell",
+ )
+ for module in threadpool_info():
+ if module["internal_api"] == "openblas":
+ assert module["architecture"] in expected_openblas_architectures
+ elif module["internal_api"] == "blis":
+ assert module["architecture"] in expected_blis_architectures
+ else:
+ # Not supported for other modules
+ assert "architecture" not in module
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/tests/utils.py
new/threadpoolctl-2.2.0/tests/utils.py
--- old/threadpoolctl-2.1.0/tests/utils.py 2019-12-05 17:00:26.115491900
+0100
+++ new/threadpoolctl-2.2.0/tests/utils.py 2021-04-19 23:03:41.699715400
+0200
@@ -1,5 +1,10 @@
import os
+import json
+import sys
+import threadpoolctl
from glob import glob
+from os.path import dirname, normpath
+from subprocess import check_output
# Path to shipped openblas for libraries such as numpy or scipy
@@ -32,7 +37,27 @@
try:
- from ._openmp_test_helper import check_openmp_num_threads # noqa: F401
+ import tests._openmp_test_helper.openmp_helpers_inner # noqa: F401
cython_extensions_compiled = True
except ImportError:
cython_extensions_compiled = False
+
+
+def threadpool_info_from_subprocess(module):
+ """Utility to call threadpool_info in a subprocess
+
+ `module` is imported before calling threadpool_info
+ """
+ # set PYTHONPATH to import from non sub-modules
+ path1 = normpath(dirname(threadpoolctl.__file__))
+ path2 = os.path.join(path1, "tests", "_openmp_test_helper")
+ pythonpath = os.pathsep.join([path1, path2])
+ env = os.environ.copy()
+ try:
+ env["PYTHONPATH"] = os.pathsep.join([pythonpath, env["PYTHONPATH"]])
+ except KeyError:
+ env["PYTHONPATH"] = pythonpath
+
+ cmd = [sys.executable, "-m", "threadpoolctl", "-i", module]
+ out = check_output(cmd, env=env).decode("utf-8")
+ return json.loads(out)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/threadpoolctl-2.1.0/threadpoolctl.py
new/threadpoolctl-2.2.0/threadpoolctl.py
--- old/threadpoolctl-2.1.0/threadpoolctl.py 2020-05-29 11:13:31.525606200
+0200
+++ new/threadpoolctl-2.2.0/threadpoolctl.py 2021-07-09 17:08:11.354816400
+0200
@@ -19,7 +19,7 @@
from ctypes.util import find_library
from abc import ABC, abstractmethod
-__version__ = "2.1.0"
+__version__ = "2.2.0"
__all__ = ["threadpool_limits", "threadpool_info"]
@@ -212,8 +212,8 @@
if warning_apis:
warnings.warn(
- "Multiple value possible for following user apis: "
- + ", ".join(warning_apis) + ". Returning the minimum.")
+ "Multiple value possible for following user apis: " +
+ ", ".join(warning_apis) + ". Returning the minimum.")
return num_threads
@@ -660,6 +660,7 @@
def _get_extra_info(self):
self.threading_layer = self.get_threading_layer()
+ self.architecture = self.get_architecture()
def get_threading_layer(self):
"""Return the threading layer of OpenBLAS"""
@@ -670,6 +671,14 @@
return "pthreads"
return "disabled"
+ def get_architecture(self):
+ get_corename = getattr(self._dynlib, "openblas_get_corename", None)
+ if get_corename is None:
+ return None
+
+ get_corename.restype = ctypes.c_char_p
+ return get_corename().decode("utf-8")
+
class _BLISModule(_Module):
"""Module class for BLIS"""
@@ -694,6 +703,7 @@
def _get_extra_info(self):
self.threading_layer = self.get_threading_layer()
+ self.architecture = self.get_architecture()
def get_threading_layer(self):
"""Return the threading layer of BLIS"""
@@ -703,12 +713,27 @@
return "pthreads"
return "disabled"
+ def get_architecture(self):
+ bli_arch_query_id = getattr(self._dynlib, "bli_arch_query_id", None)
+ bli_arch_string = getattr(self._dynlib, "bli_arch_string", None)
+ if bli_arch_query_id is None or bli_arch_string is None:
+ return None
+
+ # the true restype should be BLIS' arch_t (enum) but int should work
+ # for us:
+ bli_arch_query_id.restype = ctypes.c_int
+ bli_arch_string.restype = ctypes.c_char_p
+ return bli_arch_string(bli_arch_query_id()).decode("utf-8")
+
class _MKLModule(_Module):
"""Module class for MKL"""
def get_version(self):
+ if not hasattr(self._dynlib, "MKL_Get_Version_String"):
+ return None
+
res = ctypes.create_string_buffer(200)
- self._dynlib.mkl_get_version_string(res, 200)
+ self._dynlib.MKL_Get_Version_String(res, 200)
version = res.value.decode("utf-8")
group = re.search(r"Version ([^ ]+) ", version)