-
Notifications
You must be signed in to change notification settings - Fork 4
120 lines (102 loc) · 4.57 KB
/
Copy pathunit_tests.yml
File metadata and controls
120 lines (102 loc) · 4.57 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# This workflow runs test when pushing on main and develop branches
name: unit_tests-Linux
on: [push, pull_request]
concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
CI:
continue-on-error: true
strategy:
matrix:
os: ['ubuntu-20.04']
# compiler: [{"vendor": "gnu", "compiler": "g++", "version": "8"},
# {"vendor": "gnu", "compiler": "g++", "version": "9"},
# {"vendor": "clang", "compiler": "clang++", "version": "11"},
# {"vendor": "clang", "compiler": "clang++", "version": "12"}]
compiler: [{"vendor": "gnu", "compiler": "g++", "version": "8"}]
cmake_build_type: ['Release', 'Debug']
backend: [{"name": 'SERIAL', "tag": "Serial"}, {"name": "OPENMP", "tag": "OpenMP"}]
runs-on: ${{ matrix.os }}
steps:
- name: Install/Update Packages
run: |
sudo apt update
sudo apt install googletest
- name: Install/Update Compilers
run: |
sudo apt-get install ${{ matrix.compiler.compiler }}-${{ matrix.compiler.version }} \
libomp-${{ matrix.compiler.version }}-dev
# - name: Setup Intel Compilers
# if: ${{ matrix.compiler.vendor == 'intel' }}
# run: |
# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# sudo apt-get update
# sudo apt-get install intel-basekit
# source /opt/intel/oneapi/setvars.sh
# printenv >> $GITHUB_ENV
- name: set_default_options
run: |
echo "cxx_compiler=${{ matrix.compiler.compiler }}-${{ matrix.compiler.version }}" >> $GITHUB_ENV
echo "kokkos_omp=Off" >> $GITHUB_ENV
echo "debug_mode=Off" >> $GITHUB_ENV
- name: Checkout Kokkos-v3.5.00
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: 3.5.00
path: kokkos
- name: maybe_enable_openmp_backend
if: ${{ matrix.backend.name == 'OPENMP' }}
run: echo "kokkos_omp=On" >> $GITHUB_ENV
- name: maybe_enable_aggressive_vectorization
if: ${{ matrix.cmake_build_type == 'Debug' }}
run: echo "debug_mode=On" >> $GITHUB_ENV
- name: Install Kokkos
working-directory: kokkos
run: |
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ env.cxx_compiler }} \
-DCMAKE_INSTALL_PREFIX=/usr/kokkos-install \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DKokkos_ENABLE_DEBUG_BOUNDS_CHECK=${{ env.debug_mode }} \
-DKokkos_ENABLE_OPENMP=${{ env.kokkos_omp }} \
-DKokkos_ENABLE_SERIAL=On \
-DKokkos_ARCH_NATIVE=On \
-DKokkos_CXX_STANDARD=17 \
-DKokkos_ENABLE_COMPILER_WARNINGS=On \
-DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=${{ env.debug_mode }}\
-DKokkos_ENABLE_TESTS=Off \
-DKokkos_ENABLE_EXAMPLES=Off
sudo cmake --build . --target install --parallel 2
- name: Checkout code
uses: actions/checkout@v3
- name: Configure Morpheus
run: |
cmake -B builddir \
-DCMAKE_CXX_COMPILER=${{ env.cxx_compiler }} \
-DCMAKE_INSTALL_PREFIX=/usr/morpheus-install \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DKokkos_ROOT=/usr/kokkos-install \
-DMorpheus_ENABLE_EXAMPLES=Off \
-DMorpheus_ENABLE_TESTS=On \
-DMorpheus_ENABLE_INDIVIDUAL_TESTS=On
- name: Build Morpheus
run: |
cmake --build builddir --parallel 2
- name: Run Serial Tests
working-directory: builddir
if: ${{ matrix.backend.tag == 'Serial' }}
run: |
mkdir -p mm_output
./core/tests/MorpheusCore_UnitTest_${{ matrix.backend.tag }}
- name: Run OpenMP Tests
working-directory: builddir
if: ${{ matrix.backend.tag == 'OpenMP' }}
run: |
mkdir -p mm_output
export OMP_NUM_THREADS=2 && ./core/tests/MorpheusCore_UnitTest_${{ matrix.backend.tag }} --kokkos-num-threads=2