Skip to content

Commit 59bd429

Browse files
authored
Merge pull request #2602 from ERGO-Code/valgrind-hipo
Valgrind HiGHS with HiPO
2 parents 0992a90 + 3dab010 commit 59bd429

File tree

3 files changed

+629
-63
lines changed

3 files changed

+629
-63
lines changed
Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
name: valgrind-hipo-md
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unit_tests:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Install Valgrind
13+
run: sudo apt-get update && sudo apt-get install valgrind
14+
15+
- name: Checkout METIS
16+
uses: actions/checkout@v4
17+
with:
18+
repository: galabovaa/METIS
19+
ref: 510-ts
20+
path: METIS
21+
22+
- name: Create installs dir
23+
working-directory: ${{runner.workspace}}
24+
run: |
25+
mkdir installs
26+
ls
27+
28+
- name: Install METIS
29+
run: |
30+
cmake \
31+
-S $GITHUB_WORKSPACE/METIS \
32+
-B build \
33+
-DCMAKE_BUILD_TYPE=Debug \
34+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
35+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
36+
cmake --build build --parallel
37+
cmake --install build
38+
39+
# no default blas available on runner
40+
41+
- name: Cache APT packages
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
/var/cache/apt/archives
46+
/var/lib/apt/lists
47+
key: ${{ runner.os }}-apt-libopenblas
48+
49+
- name: Install OpenBLAS
50+
shell: bash
51+
run: |
52+
sudo apt update
53+
sudo apt install libopenblas-dev
54+
- name: Create Build Environment
55+
run: cmake -E make_directory ${{runner.workspace}}/build
56+
57+
- name: Configure CMake
58+
shell: bash
59+
working-directory: ${{runner.workspace}}/build
60+
run: |
61+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
62+
-DCMAKE_BUILD_TYPE=Debug \
63+
-DALL_TESTS=ON \
64+
-DBLA_VENDOR=OpenBLAS \
65+
-DMETIS_ROOT=${{runner.workspace}}/installs
66+
67+
- name: Build
68+
working-directory: ${{runner.workspace}}/build
69+
shell: bash
70+
run: |
71+
cmake --build . -j2
72+
73+
- name: Test
74+
working-directory: ${{runner.workspace}}/build
75+
shell: bash
76+
run: |
77+
valgrind \
78+
--leak-check=full \
79+
--show-leak-kinds=all \
80+
--track-origins=yes \
81+
-s \
82+
./bin/unit_tests \
83+
2>&1 | tee logfile
84+
85+
- name: Check log for Errors
86+
working-directory: ${{runner.workspace}}/build
87+
shell: bash
88+
run: |
89+
cat logfile
90+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
91+
if grep -q "$OUTPUT" logfile; then
92+
exit 0
93+
fi
94+
exit 1
95+
96+
instance_tests:
97+
runs-on: ${{ matrix.os }}
98+
strategy:
99+
matrix:
100+
os: [ubuntu-latest]
101+
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Install Valgrind
106+
run: sudo apt-get update && sudo apt-get install valgrind
107+
108+
- name: Checkout METIS
109+
uses: actions/checkout@v4
110+
with:
111+
repository: galabovaa/METIS
112+
ref: 510-ts
113+
path: METIS
114+
115+
- name: Create installs dir
116+
working-directory: ${{runner.workspace}}
117+
run: |
118+
mkdir installs
119+
ls
120+
121+
- name: Install METIS
122+
run: |
123+
cmake \
124+
-S $GITHUB_WORKSPACE/METIS \
125+
-B build \
126+
-DCMAKE_BUILD_TYPE=Debug \
127+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
128+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
129+
cmake --build build --parallel
130+
cmake --install build
131+
132+
# no default blas available on runner
133+
134+
- name: Cache APT packages
135+
uses: actions/cache@v4
136+
with:
137+
path: |
138+
/var/cache/apt/archives
139+
/var/lib/apt/lists
140+
key: ${{ runner.os }}-apt-libopenblas
141+
142+
- name: Install OpenBLAS
143+
shell: bash
144+
run: |
145+
sudo apt update
146+
sudo apt install libopenblas-dev
147+
- name: Create Build Environment
148+
run: cmake -E make_directory ${{runner.workspace}}/build
149+
150+
- name: Create Build Environment
151+
run: cmake -E make_directory ${{runner.workspace}}/build
152+
153+
- name: Configure CMake
154+
shell: bash
155+
working-directory: ${{runner.workspace}}/build
156+
run: |
157+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
158+
-DCMAKE_BUILD_TYPE=Debug \
159+
-DALL_TESTS=ON \
160+
-DBLA_VENDOR=OpenBLAS \
161+
-DMETIS_ROOT=${{runner.workspace}}/installs
162+
163+
- name: Build
164+
working-directory: ${{runner.workspace}}/build
165+
shell: bash
166+
run: |
167+
cmake --build . -j2
168+
169+
- name: Test
170+
working-directory: ${{runner.workspace}}/build
171+
shell: bash
172+
run: |
173+
valgrind \
174+
--leak-check=full \
175+
--show-leak-kinds=all \
176+
--track-origins=yes \
177+
-s \
178+
ctest -E unit.* \
179+
--timeout 1000 \
180+
--output-on-failure \
181+
2>&1 | tee logfile2
182+
183+
- name: Check log for Errors
184+
working-directory: ${{runner.workspace}}/build
185+
shell: bash
186+
run: |
187+
cat logfile2
188+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
189+
if grep -q "$OUTPUT" logfile2; then
190+
exit 0
191+
fi
192+
exit 1
193+
194+
examples:
195+
runs-on: ${{ matrix.os }}
196+
strategy:
197+
matrix:
198+
os: [ubuntu-latest]
199+
200+
steps:
201+
- uses: actions/checkout@v4
202+
203+
- name: Install Valgrind
204+
run: sudo apt-get update && sudo apt-get install valgrind
205+
206+
- name: Checkout METIS
207+
uses: actions/checkout@v4
208+
with:
209+
repository: galabovaa/METIS
210+
ref: 510-ts
211+
path: METIS
212+
213+
- name: Create installs dir
214+
working-directory: ${{runner.workspace}}
215+
run: |
216+
mkdir installs
217+
ls
218+
219+
- name: Install METIS
220+
run: |
221+
cmake \
222+
-S $GITHUB_WORKSPACE/METIS \
223+
-B build \
224+
-DCMAKE_BUILD_TYPE=Debug \
225+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
226+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
227+
cmake --build build --parallel
228+
cmake --install build
229+
230+
# no default blas available on runner
231+
232+
- name: Cache APT packages
233+
uses: actions/cache@v4
234+
with:
235+
path: |
236+
/var/cache/apt/archives
237+
/var/lib/apt/lists
238+
key: ${{ runner.os }}-apt-libopenblas
239+
240+
- name: Install OpenBLAS
241+
shell: bash
242+
run: |
243+
sudo apt update
244+
sudo apt install libopenblas-dev
245+
- name: Create Build Environment
246+
run: cmake -E make_directory ${{runner.workspace}}/build
247+
248+
- name: Create Build Environment
249+
run: cmake -E make_directory ${{runner.workspace}}/build
250+
251+
- name: Configure CMake
252+
shell: bash
253+
working-directory: ${{runner.workspace}}/build
254+
run: |
255+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
256+
-DCMAKE_BUILD_TYPE=Debug \
257+
-DALL_TESTS=ON \
258+
-DBLA_VENDOR=OpenBLAS \
259+
-DMETIS_ROOT=${{runner.workspace}}/installs
260+
261+
262+
- name: Build
263+
working-directory: ${{runner.workspace}}/build
264+
shell: bash
265+
run: |
266+
cmake --build . -j2
267+
268+
- name: Test cpp example
269+
working-directory: ${{runner.workspace}}/build
270+
shell: bash
271+
run: |
272+
valgrind \
273+
--leak-check=full \
274+
--show-leak-kinds=all \
275+
--track-origins=yes \
276+
-s \
277+
./bin/call_highs_from_cpp \
278+
--timeout 1000 \
279+
--output-on-failure \
280+
2>&1 | tee logfile2
281+
282+
- name: Check log for Errors
283+
working-directory: ${{runner.workspace}}/build
284+
shell: bash
285+
run: |
286+
cat logfile2
287+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
288+
if grep -q "$OUTPUT" logfile2; then
289+
exit 0
290+
fi
291+
exit 1
292+
293+
- name: Test C example
294+
working-directory: ${{runner.workspace}}/build
295+
shell: bash
296+
run: |
297+
valgrind \
298+
--leak-check=full \
299+
--show-leak-kinds=all \
300+
--track-origins=yes \
301+
-s \
302+
./bin/call_highs_from_c_minimal \
303+
--timeout 1000 \
304+
--output-on-failure \
305+
2>&1 | tee logfile2
306+
307+
- name: Check log for Errors
308+
working-directory: ${{runner.workspace}}/build
309+
shell: bash
310+
run: |
311+
cat logfile2
312+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
313+
if grep -q "$OUTPUT" logfile2; then
314+
exit 0
315+
fi
316+
exit 1

0 commit comments

Comments
 (0)