-
Notifications
You must be signed in to change notification settings - Fork 20
129 lines (128 loc) · 6.13 KB
/
buildandtest.yml
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
121
122
123
124
125
126
127
128
129
name: Build and Test
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
omp: [OFF, ON]
mpi: [OFF, ON]
compiler:
[
"GCC 10",
"GCC 13",
"Clang 15",
"Clang 11",
]
env:
OMP_NUM_THREADS: 4
name: "Ubuntu 22.04 ( ${{ matrix.compiler }} OpenMP ( ${{ matrix.omp }} ) , MPI ( ${{ matrix.mpi }} ))"
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt install -y libopenblas-dev liblapack-dev libhdf5-dev libhdf5-openmpi-dev libscalapack-openmpi-dev python3-pip gfortran cmake -o Acquire::Retries=3 --fix-missing
pip3 install numpy
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: "Set up output var: CC_VERSION"
id: extract_matrix
run: |
CC_VERSION=$( echo "${{ matrix.compiler }}" | awk '{ print $2; }')
echo "CC_VERSION=${CC_VERSION}" >> "$GITHUB_OUTPUT"
- name: Install GCC
if: ${{ startsWith(matrix.compiler, 'GCC') }}
run: sudo apt install -y g++-${{ steps.extract_matrix.outputs.CC_VERSION }}
- name: Install Clang
if: ${{ startsWith(matrix.compiler, 'Clang') }}
run: |
sudo apt install -y clang-${{ steps.extract_matrix.outputs.CC_VERSION }}
sudo apt install -y libomp-${{ steps.extract_matrix.outputs.CC_VERSION }}-dev
- name: Configure
run: |
CC_NAME=$(echo "${{ matrix.compiler }}" | awk '{ print tolower($1); }')
CC_VER=$( echo "${{ matrix.compiler }}" | awk '{ print $2; }')
test "${CC_NAME}" = "gcc" && CC_EXE="g++"
test "${CC_NAME}" = "clang" && CC_EXE="clang++"
cmake -S . -B build -DCMAKE_CXX_COMPILER="${CC_EXE}-${CC_VER}" -DOMP_AVAIL=${{ matrix.omp }} -DKokkos_ENABLE_OPENMP=${{ matrix.omp }} -DMPI_AVAIL=${{ matrix.mpi }} -DHDF5_AVAIL=ON
- name: Build
run: cmake --build build -- -j4
- name: Build Test
run: cmake --build build --target runTests
- name: RunTests
run: |
cd build
./runTests
- name: Download test data
if: ${{ matrix.compiler == 'GCC 10' }}
run: |
wget github.com/mir-group/phoebe-data/archive/master.zip
unzip -j master.zip "phoebe-data-master/example/Silicon-ph/qe-phonons/*" -d "example/Silicon-ph/qe-phonons"
unzip -j master.zip "phoebe-data-master/example/Silicon-ph/qe-ph-anharmonic/*" -d "example/Silicon-ph/thirdorder.py-anharmonic"
unzip -j master.zip "phoebe-data-master/example/Silicon-el/qe-elph/*" -d "example/Silicon-el/qe-elph"
unzip 'example/Silicon-el/qe-elph/silicon.phoebe.*.dat.zip' -d example/Silicon-el/qe-elph/
cp example/Silicon-el/qe-elph/* example/Silicon-epa/qe-elph
mkdir example/Silicon-epa/qe-elph/out
unzip -j master.zip "phoebe-data-master/example/Silicon-epa/qe-elph/out/*" -d "example/Silicon-epa/qe-elph/out"
- name: Run epa example without MPI
if: ${{ matrix.compiler == 'GCC 10' }}
working-directory: example/Silicon-epa
run: |
../../build/phoebe -in qeToPhoebeEPA.in
../../build/phoebe -in epaTransport.in
../../build/phoebe -in electronFourierBands.in
../../build/phoebe -in electronFourierDos.in
python3 reference/run_check.py
- name: Run epa example with MPI
if: ${{ matrix.compiler == 'GCC 10' && matrix.mpi == 'ON'}}
working-directory: example/Silicon-epa
run: |
mpirun -np 4 --oversubscribe ../../build/phoebe -in epaTransport.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronFourierBands.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronFourierDos.in
python3 reference/run_check.py
- name: Run ph example without MPI
if: ${{ matrix.compiler == 'GCC 10' }}
working-directory: example/Silicon-ph
run: |
../../build/phoebe -in phononTransport.in
../../build/phoebe -in phononBands.in
../../build/phoebe -in phononDos.in
../../build/phoebe -in phononLifetimes.in
python3 reference/run_check.py
- name: Run ph example with MPI
if: ${{ matrix.compiler == 'GCC 10' && matrix.mpi == 'ON' }}
working-directory: example/Silicon-ph
run: |
mpirun -np 4 --oversubscribe ../../build/phoebe -in phononTransport.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in phononBands.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in phononDos.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in phononLifetimes.in
python3 reference/run_check.py
- name: Run el example without MPI
if: ${{ matrix.compiler == 'GCC 10' }}
working-directory: example/Silicon-el
run: |
../../build/phoebe -in qeToPhoebeWannier.in
../../build/phoebe -in electronWannierTransport.in
../../build/phoebe -in electronWannierBands.in
../../build/phoebe -in electronWannierDos.in
../../build/phoebe -in electronLifetimes.in
python3 reference/run_check.py
- name: Run el example with MPI
if: ${{ matrix.compiler == 'GCC 10' && matrix.mpi == 'ON' }}
working-directory: example/Silicon-el
run: |
# Note: don't run this as it runs out-of-memory on the VM
#mpirun -np 4 --oversubscribe ../../build/phoebe -in qeToPhoebeWannier.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronWannierTransport.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronWannierBands.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronWannierDos.in
mpirun -np 4 --oversubscribe ../../build/phoebe -in electronLifetimes.in
python3 reference/run_check.py
mpirun -np 4 --oversubscribe ../../build/phoebe -ps 2 -in electronWannierTransport.in
mpirun -np 4 --oversubscribe ../../build/phoebe -ps 2 -in electronLifetimes.in
python3 reference/run_check.py