Skip to content

Commit f65a683

Browse files
authored
Merge pull request #2969 from ERGO-Code/hipo-mangle
Mangle symbols of metis, amd, rcm
2 parents ae4c0c3 + 073b504 commit f65a683

19 files changed

Lines changed: 317 additions & 38 deletions

.github/workflows/hipo-mangle.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: hipo-mangle
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check-metis:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
config: [Release]
12+
all_tests: [OFF]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Checkout METIS
18+
uses: actions/checkout@v4
19+
with:
20+
repository: galabovaa/METIS
21+
ref: 510-w
22+
path: METIS
23+
24+
- name: Create installs dir
25+
working-directory: ${{runner.workspace}}
26+
run: |
27+
mkdir installs
28+
ls
29+
30+
- name: Install METIS
31+
run: |
32+
cmake \
33+
-S $GITHUB_WORKSPACE/METIS \
34+
-B build \
35+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
36+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
37+
cmake --build build
38+
cmake --install build
39+
40+
- name: Create Build Environment
41+
run: cmake -E make_directory ${{runner.workspace}}/build
42+
43+
- name: Configure CMake
44+
working-directory: ${{runner.workspace}}/build
45+
run: |
46+
cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \
47+
-DALL_TESTS=${{ matrix.all_tests }}
48+
49+
- name: Build HiGHS
50+
working-directory: ${{runner.workspace}}/build
51+
run: |
52+
cmake --build . -j2
53+
54+
- name: Generate METIS symbols
55+
working-directory: ${{runner.workspace}}
56+
run: |
57+
nm installs/lib/libmetis.a | grep -e "[tT] [^ ]+$" -oE | sort > metis.txt
58+
59+
- name: Generate HiGHS symbols
60+
working-directory: ${{runner.workspace}}
61+
run: |
62+
nm build/lib/libhighs.a | grep -e "[tT] [^ ]+$" -oE | sort > highs.txt
63+
64+
- name: Compare symbols
65+
working-directory: ${{runner.workspace}}
66+
run: comm -12 highs.txt metis.txt > common.txt
67+
68+
- name: Check
69+
working-directory: ${{runner.workspace}}
70+
run: |
71+
if [[ "$(wc -l < common.txt)" -eq 0 ]]; then
72+
exit 0
73+
fi
74+
echo "Metis symbols"
75+
cat metis.txt
76+
echo "Highs symbols"
77+
cat highs.txt
78+
echo "Common symbols"
79+
cat compare.txt
80+
exit 1

cmake/sources.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ set(hipo_orderings_headers
304304
../extern/metis/GKlib/gk_arch.h
305305
../extern/metis/GKlib/gk_defs.h
306306
../extern/metis/GKlib/gk_macros.h
307+
../extern/metis/GKlib/gk_mangle.h
307308
../extern/metis/GKlib/gk_mkblas.h
308309
../extern/metis/GKlib/gk_mkmemory.h
309310
../extern/metis/GKlib/gk_mkpqueue.h
@@ -319,6 +320,7 @@ set(hipo_orderings_headers
319320
../extern/metis/libmetis/defs.h
320321
../extern/metis/libmetis/gklib_defs.h
321322
../extern/metis/libmetis/macros.h
323+
../extern/metis/libmetis/metis_mangle.h
322324
../extern/metis/libmetis/metislib.h
323325
../extern/metis/libmetis/proto.h
324326
../extern/metis/libmetis/stdheaders.h

extern/amd/amd_1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "amd_internal.h"
2828

29-
void amd_1
29+
void Highs_amd_1
3030
(
3131
amd_int n, /* n > 0 */
3232
const amd_int Ap [ ], /* input of size n+1, not modified */

extern/amd/amd_2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* === clear_flag ========================================================== */
2020
/* ========================================================================= */
2121

22-
static amd_int clear_flag (amd_int wflg, amd_int wbig, amd_int W [ ], amd_int n)
22+
static amd_int Highs_amd_clear_flag (amd_int wflg, amd_int wbig, amd_int W [ ], amd_int n)
2323
{
2424
amd_int x ;
2525
if (wflg < 2 || wflg >= wbig)
@@ -624,7 +624,7 @@ void Highs_amd_2
624624

625625
/* initialize wflg */
626626
wbig = amd_int_max - n ;
627-
wflg = clear_flag (0, wbig, W, n) ;
627+
wflg = Highs_amd_clear_flag (0, wbig, W, n) ;
628628

629629
/* --------------------------------------------------------------------- */
630630
/* initialize degree lists and eliminate dense and empty rows */
@@ -992,7 +992,7 @@ void Highs_amd_2
992992
/* With the current value of wflg, wflg+n must not cause integer
993993
* overflow */
994994

995-
wflg = clear_flag (wflg, wbig, W, n) ;
995+
wflg = Highs_amd_clear_flag (wflg, wbig, W, n) ;
996996

997997
/* ========================================================================= */
998998
/* COMPUTE (W [e] - wflg) = |Le\Lme| FOR ALL ELEMENTS */
@@ -1274,7 +1274,7 @@ void Highs_amd_2
12741274
/* make sure that wflg+n does not cause integer overflow */
12751275
lemax = MAX (lemax, degme) ;
12761276
wflg += lemax ;
1277-
wflg = clear_flag (wflg, wbig, W, n) ;
1277+
wflg = Highs_amd_clear_flag (wflg, wbig, W, n) ;
12781278
/* at this point, W [0..n-1] < wflg holds */
12791279

12801280
/* ========================================================================= */
@@ -1682,7 +1682,7 @@ void Highs_amd_2
16821682
/* postorder the assembly tree */
16831683
/* ========================================================================= */
16841684

1685-
amd_postorder (n, Pe, Nv, Elen,
1685+
Highs_amd_postorder (n, Pe, Nv, Elen,
16861686
W, /* output order */
16871687
Head, Next, Last) ; /* workspace */
16881688

extern/amd/amd_aat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "amd_internal.h"
1919

20-
size_t amd_aat /* returns nz in A+A' */
20+
size_t Highs_amd_aat /* returns nz in A+A' */
2121
(
2222
amd_int n,
2323
const amd_int Ap [ ],

extern/amd/amd_internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
/* AMD routine definitions (not user-callable) */
8080
/* ------------------------------------------------------------------------- */
8181

82-
size_t amd_aat
82+
size_t Highs_amd_aat
8383
(
8484
amd_int n,
8585
const amd_int Ap [ ],
@@ -89,7 +89,7 @@ size_t amd_aat
8989
double Info [ ]
9090
) ;
9191

92-
void amd_1
92+
void Highs_amd_1
9393
(
9494
amd_int n,
9595
const amd_int Ap [ ],
@@ -103,7 +103,7 @@ void amd_1
103103
double Info [ ]
104104
) ;
105105

106-
void amd_postorder
106+
void Highs_amd_postorder
107107
(
108108
amd_int nn,
109109
amd_int Parent [ ],
@@ -115,7 +115,7 @@ void amd_postorder
115115
amd_int Stack [ ]
116116
) ;
117117

118-
amd_int amd_post_tree
118+
amd_int Highs_amd_post_tree
119119
(
120120
amd_int root,
121121
amd_int k,
@@ -125,7 +125,7 @@ amd_int amd_post_tree
125125
amd_int Stack [ ]
126126
) ;
127127

128-
void amd_preprocess
128+
void Highs_amd_preprocess
129129
(
130130
amd_int n,
131131
const amd_int Ap [ ],

extern/amd/amd_order.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int Highs_amd_order
118118
return (AMD_OUT_OF_MEMORY) ;
119119
}
120120
/* use Len and Pinv as workspace to create R = A' */
121-
amd_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ;
121+
Highs_amd_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ;
122122
Cp = Rp ;
123123
Ci = Ri ;
124124
}
@@ -135,7 +135,7 @@ int Highs_amd_order
135135
/* determine the symmetry and count off-diagonal nonzeros in A+A' */
136136
/* --------------------------------------------------------------------- */
137137

138-
nzaat = amd_aat (n, Cp, Ci, Len, P, Info) ;
138+
nzaat = Highs_amd_aat (n, Cp, Ci, Len, P, Info) ;
139139

140140

141141

@@ -179,7 +179,7 @@ int Highs_amd_order
179179
/* order the matrix */
180180
/* --------------------------------------------------------------------- */
181181

182-
amd_1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ;
182+
Highs_amd_1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ;
183183

184184
/* --------------------------------------------------------------------- */
185185
/* free the workspace */

extern/amd/amd_post_tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "amd_internal.h"
1414

15-
amd_int amd_post_tree
15+
amd_int Highs_amd_post_tree
1616
(
1717
amd_int root, /* root of the tree */
1818
amd_int k, /* start numbering at k */
@@ -42,7 +42,7 @@ amd_int amd_post_tree
4242
i = root ;
4343
for (f = Child [i] ; f != EMPTY ; f = Sibling [f])
4444
{
45-
k = amd_post_tree (f, k, Child, Sibling, Order, Stack, nn) ;
45+
k = Highs_amd_post_tree (f, k, Child, Sibling, Order, Stack, nn) ;
4646
}
4747
Order [i] = k++ ;
4848
return (k) ;

extern/amd/amd_postorder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "amd_internal.h"
1414

15-
void amd_postorder
15+
void Highs_amd_postorder
1616
(
1717
/* inputs, not modified on output: */
1818
amd_int nn, /* nodes are in the range 0..nn-1 */
@@ -134,7 +134,7 @@ void amd_postorder
134134
if (Parent [i] == EMPTY && Nv [i] > 0)
135135
{
136136

137-
k = amd_post_tree (i, k, Child, Sibling, Order, Stack) ;
137+
k = Highs_amd_post_tree (i, k, Child, Sibling, Order, Stack) ;
138138
}
139139
}
140140
}

extern/amd/amd_preprocess.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* On input, the condition (AMD_valid (n,n,Ap,Ai) != AMD_INVALID) must hold.
2323
*/
2424

25-
void amd_preprocess
25+
void Highs_amd_preprocess
2626
(
2727
amd_int n, /* input matrix: A is n-by-n */
2828
const amd_int Ap [ ], /* size n+1 */

0 commit comments

Comments
 (0)