Skip to content

Commit

Permalink
Merge pull request #625 from evalf/simplify
Browse files Browse the repository at this point in the history
Simplify
  • Loading branch information
gertjanvanzwieten authored Apr 27, 2021
2 parents 5d5c27d + b5a57f6 commit 8a3c8b8
Show file tree
Hide file tree
Showing 14 changed files with 737 additions and 307 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@ jobs:
matrix:
include:
# base
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.9, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
# os
- {os: windows-latest, python-version: 3.8, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: macos-latest , python-version: 3.8, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: windows-latest, python-version: 3.9, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: macos-latest , python-version: 3.9, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
# python-version
- {os: ubuntu-latest , python-version: 3.5, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.6, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.7, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: numpy, nprocs: 1, numpy-version: latest}
# matrix-backend
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: scipy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: mkl , nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: mkl , nprocs: 2, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.9, matrix-backend: scipy, nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.9, matrix-backend: mkl , nprocs: 1, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.9, matrix-backend: mkl , nprocs: 2, numpy-version: latest}
# nprocs
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: numpy, nprocs: 2, numpy-version: latest}
- {os: ubuntu-latest , python-version: 3.9, matrix-backend: numpy, nprocs: 2, numpy-version: latest}
# numpy-version
- {os: ubuntu-latest , python-version: 3.8, matrix-backend: numpy, nprocs: 1, numpy-version: 1.16 }
fail-fast: false
Expand Down Expand Up @@ -100,13 +101,12 @@ jobs:
# Install Nutils from `dist` dir created in job
# `build-python-package`.
python -um pip install --no-index --find-links ./dist nutils
- name: Get library directory
id: get-lib-dir
- name: Configure MKL
id: configure-mkl
if: ${{ matrix.matrix-backend == 'mkl' }}
run: python -um devtools.gha.get_lib_dir
run: python -um devtools.gha.configure_mkl
- name: Test
env:
LD_LIBRARY_PATH: ${{ steps.get-lib-dir.outputs.libdir }}
NUTILS_DEBUG: all
run: |
mkdir testenv
Expand Down Expand Up @@ -135,6 +135,9 @@ jobs:
name: Build container image
needs: build-python-package
runs-on: ubuntu-20.04
env:
# Fixes https://github.com/actions/virtual-environments/issues/3080
STORAGE_OPTS: overlay.mount_program=/usr/bin/fuse-overlayfs
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
25 changes: 25 additions & 0 deletions devtools/gha/configure_mkl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from .. import log
import sys, site, os

libsubdir = 'lib'
prefixes = list(site.PREFIXES)
if hasattr(site, 'getuserbase'):
prefixes.append(site.getuserbase())
for prefix in prefixes:
libdir = os.path.join(prefix, libsubdir)
if not os.path.exists(os.path.join(libdir, 'libmkl_rt.so.1')):
continue
log.set_output('libdir', libdir)
break
else:
log.error('cannot find {} in any of the following dirs: {}'.format('libmkl_rt.so.1', ' '.join(prefixes)))

lib = os.path.join(libdir, 'libmkl_rt.so')
if not os.path.exists(lib):
os.symlink('libmkl_rt.so.1', lib)

github_env = os.environ.get('GITHUB_ENV')
assert github_env
ld_library_path = ':'.join(filter(None, (os.environ.get('LD_LIBRARY_PATH', ''), libdir)))
with open(github_env, 'a') as f:
print('LD_LIBRARY_PATH={}'.format(ld_library_path), file=f)
16 changes: 0 additions & 16 deletions devtools/gha/get_lib_dir.py

This file was deleted.

Loading

0 comments on commit 8a3c8b8

Please sign in to comment.