-
Notifications
You must be signed in to change notification settings - Fork 47
223 lines (189 loc) · 6.75 KB
/
qphix-build.yaml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: qphix-build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
# handling of environment variable: https://stackoverflow.com/a/57969570
- name: lscpu
if: ${{ always() }}
run: |
lscpu; \
echo "nb_cores=$(lscpu | grep \^CPU\(s\)\: | awk '{print $2}')" >> $GITHUB_ENV
- name: gcc_version
if: ${{ always() }}
run: gcc --version
- name: echo_nb_cores
if: ${{ always() }}
run: echo "Number of cores ${nb_cores}"
- name: get_packages
run: sudo apt update && sudo apt install openmpi-bin openmpi-common libopenmpi3 libopenmpi-dev numdiff
- name: mpicc_version
if: ${{ always() }}
run: mpicc --version
- name: get_lime
uses: actions/checkout@v3
with:
repository: usqcd-software/c-lime
path: lime
- name: autogen_lime
working-directory: ${{github.workspace}}/lime
run: ./autogen.sh && mkdir build
- name: build_lime
working-directory: ${{github.workspace}}/lime/build
run: |
CC=gcc \
CFLAGS="-march=haswell -mtune=haswell -O2" \
../configure --prefix=$(pwd)/install_dir
make -j
make install
- name: Archive lime config.log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: lime_config_output
path: ${{github.workspace}}/lime/build/config.log
- name: get_lemon
uses: actions/checkout@v3
with:
repository: etmc/lemon
path: lemon
- name: autogen_lemon
working-directory: ${{github.workspace}}/lemon
run: |
autoreconf -i -f
mkdir build
- name: build_lemon
working-directory: ${{github.workspace}}/lemon/build
run: |
CC=mpicc \
CFLAGS="-march=haswell -mtune=haswell -O2" \
../configure \
--prefix=$(pwd)/install_dir
make -j
make install
- name: Archive lemon config.log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: lemon_config_output
path: ${{github.workspace}}/lemon/build/config.log
- name: get_qmp
uses: actions/checkout@v3
with:
repository: usqcd-software/qmp
path: qmp
- name: autogen_qmp
working-directory: ${{github.workspace}}/qmp
run: |
autoreconf -i -f
mkdir build
- name: build_qmp
working-directory: ${{github.workspace}}/qmp/build
run: |
CC=mpicc \
CFLAGS="-std=c99 -O2 -mtune=haswell -march=haswell" \
../configure \
--prefix=$(pwd)/install_dir \
--with-qmp-comms-type=MPI
make -j
make install
- name: Archive qmp config.log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: qmp_config_output
path: ${{github.workspace}}/qmp/build/config.log
- name: get_qphix
uses: actions/checkout@v3
with:
repository: JeffersonLab/qphix
ref: sysctl_deprecated
path: qphix
- name: create_qphix_builddir
working-directory: ${{github.workspace}}/qphix
run: mkdir build
- name: cache_qphix
id: cache-qphix
uses: actions/cache@v3
with:
path: qphix/build
key: ${{ runner.os }}-haswell-qphix
- name: build_qphix
working-directory: ${{github.workspace}}/qphix/build
if: steps.cache-qphix.outputs.cache-hit != 'true'
run: |
cmake \
-DQMP_DIR=${{github.workspace}}/qmp/build/install_dir \
-Disa=avx2 \
-Dparallel_arch=parscalar \
-Dhost_cxx=g++ \
-Dtm_clover=ON \
-Dtwisted_mass=ON \
-Dtesting=OFF \
-Drecursive_jN=$(( ${nb_cores} + 3 )) \
-DCMAKE_CXX_COMPILER=mpicxx \
-DCMAKE_CXX_FLAGS="-std=c++11 -O2 -mavx2 -mfma -mtune=haswell -march=haswell -fopenmp" \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_C_FLAGS="-std=c99 -O2 -mavx2 -mfma -mtune=haswell -march=haswell -fopenmp" \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install_dir \
..
VERBOSE=1 make -j $(( ${nb_cores} + 3 ))
make install
- name: get_tmlqcd
uses: actions/checkout@v3
with:
path: main
- name: create_builddir
shell: bash
run: mkdir ${{github.workspace}}/main/build
- name: autogen_tmlqcd
working-directory: ${{github.workspace}}/main
run: autoconf
- name: configure_and_build
shell: bash
working-directory: ${{github.workspace}}/main/build
run: |
CC=mpicc CXX=mpicxx \
LDFLAGS="-fopenmp" \
CFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
CXXFLAGS="-O2 -mtune=haswell -march=haswell -mavx2 -mfma -DOMPI_SKIP_MPICXX -fopenmp" \
../configure \
--enable-mpi \
--with-mpidimension=4 \
--enable-omp \
--disable-sse2 \
--disable-sse3 \
--with-limedir=${{github.workspace}}/lime/build/install_dir \
--with-lemondir=${{github.workspace}}/lemon/build/install_dir \
--with-lapack="-lblas -llapack" \
--with-qmpdir=${{github.workspace}}/qmp/build/install_dir \
--with-qphixdir=${{github.workspace}}/qphix/build/install_dir \
--enable-qphix-soalen=4 || cat config.log
make -j
- name: Archive tmLQCD config.log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: tmlqcd_config_output
path: ${{github.workspace}}/main/build/config.log
- name: nf2_qphix_hmc_tmcloverdetratio
working-directory: ${{github.workspace}}/main/build
run: |
mpirun -np 2 ./hmc_tm \
-f ../sample-input/sample-hmc-qphix-tmcloverdetratio.input
- name: Archive nf2_qphix_hmc_tmcloverdetratio output
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: tmlqcd_test_output
path: ${{github.workspace}}/main/build/output.data
- name: compare_nf2_qphix_hmc_tmcloverdetratio
working-directory: ${{github.workspace}}/main/build
run: |
refpath=${{github.workspace}}/main/sample-output/hmc-qphix-tmcloverdetratio
numdiff -r 1e-4 -X 1:10 -X 1:5-8 -X 2:10 -X 2:5-8 output.data ${refpath}/output.data
for i in $(seq 0 2 18); do \
f=onlinemeas.$(printf %06d $i); \
numdiff -r 1e-4 ${f} ${refpath}/${f}; \
done