Skip to content
Snippets Groups Projects
Commit 0330b3ca authored by Markus Holzer's avatar Markus Holzer Committed by Michael Kuron
Browse files

Bump minimum SymPy version and add Python 3.9 to CI

parent 6374f339
Branches
Tags
No related merge requests found
...@@ -36,6 +36,31 @@ tests-and-coverage: ...@@ -36,6 +36,31 @@ tests-and-coverage:
cobertura: coverage.xml cobertura: coverage.xml
junit: report.xml junit: report.xml
# pipeline with latest python version
latest-python:
stage: test
except:
variables:
- $ENABLE_NIGHTLY_BUILDS
image: i10git.cs.fau.de:5005/pycodegen/pycodegen/latest_python
before_script:
- pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
script:
- env
- pip list
- export NUM_CORES=$(nproc --all)
- mkdir -p ~/.config/matplotlib
- echo "backend:template" > ~/.config/matplotlib/matplotlibrc
- mkdir public
- py.test -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
tags:
- docker
- AVX
artifacts:
when: always
reports:
junit: report.xml
# Nightly test - runs "long run" jobs only # Nightly test - runs "long run" jobs only
test-longrun: test-longrun:
stage: test stage: test
...@@ -85,15 +110,18 @@ ubuntu: ...@@ -85,15 +110,18 @@ ubuntu:
variables: variables:
- $ENABLE_NIGHTLY_BUILDS - $ENABLE_NIGHTLY_BUILDS
image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
script: before_script:
- apt-get -y remove python3-sympy
- ln -s /usr/include/locale.h /usr/include/xlocale.h
- pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'` - pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
- pip3 install `grep -Eo 'numpy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'` - pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
script:
- export NUM_CORES=$(nproc --all)
- mkdir -p ~/.config/matplotlib - mkdir -p ~/.config/matplotlib
- echo "backend:template" > ~/.config/matplotlib/matplotlibrc - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
- pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
- env - env
- pip3 list - pip3 list
- pytest-3 -v -m "not longrun" --junitxml=report.xml - pytest-3 -v -n $NUM_CORES -m "not longrun" --junitxml=report.xml
tags: tags:
- docker - docker
- cuda11 - cuda11
......
from hashlib import sha256 from hashlib import sha256
from lbmpy.creationfunctions import create_lb_ast from lbmpy.creationfunctions import create_lb_ast
from pystencils.llvm.llvmjit import generate_llvm
def test_hash_equivalence_llvm(): def test_hash_equivalence_llvm():
import pytest
pytest.importorskip("llvmlite")
from pystencils.llvm.llvmjit import generate_llvm
ref_value = "6db6ed9e2cbd05edae8fcaeb8168e3178dd578c2681133f3ae9228b23d2be432" ref_value = "6db6ed9e2cbd05edae8fcaeb8168e3178dd578c2681133f3ae9228b23d2be432"
ast = create_lb_ast(stencil='D3Q19', method='srt', optimization={'target': 'llvm'}) ast = create_lb_ast(stencil='D3Q19', method='srt', optimization={'target': 'llvm'})
code = generate_llvm(ast) code = generate_llvm(ast)
......
import pytest
from lbmpy.methods import create_srt from lbmpy.methods import create_srt
from lbmpy.stencils import get_stencil from lbmpy.stencils import get_stencil
from lbmpy.methods.creationfunctions import create_with_default_polynomial_cumulants from lbmpy.methods.creationfunctions import create_with_default_polynomial_cumulants
@pytest.mark.parametrize('stencil_name', ['D2Q9', 'D3Q19', 'D3Q27'])
def test_weights(): def test_weights(stencil_name):
for stencil_name in ('D2Q9', 'D3Q19', 'D3Q27'): stencil = get_stencil(stencil_name)
stencil = get_stencil(stencil_name) cumulant_method = create_with_default_polynomial_cumulants(stencil, [1])
cumulant_method = create_with_default_polynomial_cumulants(stencil, [1]) moment_method = create_srt(stencil, 1, cumulant=False, compressible=True, maxwellian_moments=True)
moment_method = create_srt(stencil, 1, cumulant=False, compressible=True, maxwellian_moments=True) assert cumulant_method.weights == moment_method.weights
assert cumulant_method.weights == moment_method.weights
from lbmpy.creationfunctions import create_lb_ast from lbmpy.creationfunctions import create_lb_ast
import pytest
def test_gpu_block_size_limiting(): def test_gpu_block_size_limiting():
pytest.importorskip("pycuda")
too_large = 2048*2048 too_large = 2048*2048
opt = {'target': 'gpu', 'gpu_indexing_params': {'block_size': (too_large, too_large, too_large)}} opt = {'target': 'gpu', 'gpu_indexing_params': {'block_size': (too_large, too_large, too_large)}}
ast = create_lb_ast(stencil='D3Q19', cumulant=True, relaxation_rate=1.8, optimization=opt, ast = create_lb_ast(stencil='D3Q19', cumulant=True, relaxation_rate=1.8, optimization=opt,
......
This diff is collapsed.
...@@ -70,7 +70,7 @@ setup(name='lbmpy', ...@@ -70,7 +70,7 @@ setup(name='lbmpy',
author_email='martin.bauer@fau.de', author_email='martin.bauer@fau.de',
url='https://i10git.cs.fau.de/pycodegen/lbmpy/', url='https://i10git.cs.fau.de/pycodegen/lbmpy/',
packages=['lbmpy'] + ['lbmpy.' + s for s in find_packages('lbmpy')], packages=['lbmpy'] + ['lbmpy.' + s for s in find_packages('lbmpy')],
install_requires=['pystencils', 'sympy>=1.1', 'numpy'], install_requires=['pystencils', 'sympy>=1.2', 'numpy>=1.11.0'],
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Framework :: Jupyter', 'Framework :: Jupyter',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment