forked from devitocodes/devito
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.63 KB
/
Copy pathpytest-gpu.yml
File metadata and controls
90 lines (77 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Runner information:
# Standard NC24_Promo (24 vcpus, 224 GiB memory)
# NVIDIA Tesla K80, Intel Xeon E5-2690 v3 (Haswell)
name: CI-gpu
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.tags }}
strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
matrix:
name: [
pytest-gpu-omp,
pytest-gpu-acc
]
include:
- name: pytest-gpu-omp
test_file: "tests/test_gpu_openmp.py"
arch: "clang"
platform: "nvidiaX"
language: "openmp"
tags: ["self-hosted", "gpu", "openmp"]
- name: pytest-gpu-acc
test_file: "tests/test_gpu_openacc.py"
arch: "pgcc"
platform: "nvidiaX"
language: "openacc"
tags: ["self-hosted", "gpu", "openacc"]
steps:
- name: Checkout devito
uses: actions/checkout@v1
- name: set environment variables
uses: allenevans/set-env@v1.0.0
with:
DEVITO_ARCH: ${{ matrix.arch }}
DEVITO_PLATFORM: ${{ matrix.platform }}
DEVITO_LANGUAGE: ${{ matrix.language }}
OMPI_CC: ${{ matrix.arch }}
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install -e .[extras]
- name: Test with pytest
run: |
if [ "${{ matrix.name }}" == 'pytest-gpu-acc' ]; then
pgaccelinfo
fi
pytest --cov --cov-config=.coveragerc --cov-report=xml ${{ matrix.test_file }}
- name: Test examples
run: |
pytest examples/seismic/acoustic/acoustic_example.py
pytest examples/seismic/elastic/elastic_example.py
pytest examples/seismic/tti/tti_example.py
pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Test examples with MPI
run: |
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/acoustic/acoustic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/elastic/elastic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/tti/tti_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.6
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}