Skip to content

Commit 819d832

Browse files
committed
merge latest
2 parents 7b08735 + 73370b1 commit 819d832

86 files changed

Lines changed: 2897 additions & 1744 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/action-sanitizers-bazel.yml

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
asan:
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
os: [ubuntu-latest]
7+
# asan:
8+
# runs-on: ${{ matrix.os }}
9+
# strategy:
10+
# matrix:
11+
# os: [ubuntu-latest]
1212

1313
steps:
1414
- uses: actions/checkout@v6
1515

16-
- uses: bazelbuild/setup-bazelisk@v3
16+
# - uses: bazelbuild/setup-bazelisk@v3
1717

18-
- name: Bazel clean
19-
run: bazel clean
18+
# - name: Bazel clean
19+
# run: bazel clean
2020

21-
- name: Bazel build
22-
run: bazel build -c dbg --config=asan //...
21+
# - name: Bazel build
22+
# run: bazel build -c dbg --config=asan //...
2323

24-
- name: Bazel test
25-
run: bazel test -c dbg --config=asan --runs_per_test 3000 //...
24+
# - name: Bazel test
25+
# run: bazel test -c dbg --config=asan --runs_per_test 3 //...
2626

2727
# - name: Upload bazel-testlogs
2828
# uses: actions/upload-artifact@v7
@@ -48,62 +48,91 @@ jobs:
4848
run: bazel build -c dbg --config=tsan //...
4949

5050
- name: Bazel test
51-
run: bazel test -c dbg --config=tsan --runs_per_test 3000 //...
51+
run: bazel test -c dbg --config=tsan --runs_per_test 3 //:TestMipSolver
52+
53+
- name: Bazel test 2
54+
run: bazel test -c dbg --config=tsan --runs_per_test 3 //:TestHighsParallel
5255

5356
# - name: Upload bazel-testlogs
5457
# uses: actions/upload-artifact@v7
5558
# with:
5659
# name: bazel-testlogs-tsan
5760
# path: bazel-testlogs/
5861

59-
lsan:
60-
runs-on: ${{ matrix.os }}
61-
strategy:
62-
matrix:
63-
os: [ubuntu-latest]
62+
# lsan:
63+
# runs-on: ${{ matrix.os }}
64+
# strategy:
65+
# matrix:
66+
# os: [ubuntu-latest]
6467

68+
<<<<<<< HEAD
6569
steps:
6670
- uses: actions/checkout@v6
71+
=======
72+
# steps:
73+
# - uses: actions/checkout@v4
74+
>>>>>>> latest
6775

68-
- uses: bazelbuild/setup-bazelisk@v3
76+
# - uses: bazelbuild/setup-bazelisk@v3
6977

70-
- name: Bazel clean
71-
run: bazel clean
78+
# - name: Bazel clean
79+
# run: bazel clean
7280

73-
- name: Bazel build
74-
run: bazel build -c dbg --config=lsan //...
81+
# - name: Bazel build
82+
# run: bazel build -c dbg --config=lsan //...
7583

76-
- name: Bazel test
77-
run: bazel test -c dbg --config=lsan --runs_per_test 3000 //...
84+
# - name: Bazel test
85+
# run: bazel test -c dbg --config=lsan --runs_per_test 3 //...
7886

87+
<<<<<<< HEAD
7988
# - name: Upload bazel-testlogs
8089
# uses: actions/upload-artifact@v7
8190
# with:
8291
# name: bazel-testlogs-lsan
8392
# path: bazel-testlogs/
84-
85-
ubsan:
86-
runs-on: ${{ matrix.os }}
87-
strategy:
88-
matrix:
89-
os: [ubuntu-latest]
90-
93+
=======
94+
# # - name: Upload bazel-testlogs
95+
# # uses: actions/upload-artifact@v4
96+
# # with:
97+
# # name: bazel-testlogs-lsan
98+
# # path: bazel-testlogs/
99+
>>>>>>> latest
100+
101+
# ubsan:
102+
# runs-on: ${{ matrix.os }}
103+
# strategy:
104+
# matrix:
105+
# os: [ubuntu-latest]
106+
107+
<<<<<<< HEAD
91108
steps:
92109
- uses: actions/checkout@v6
110+
=======
111+
# steps:
112+
# - uses: actions/checkout@v4
113+
>>>>>>> latest
93114

94-
- uses: bazelbuild/setup-bazelisk@v3
115+
# - uses: bazelbuild/setup-bazelisk@v3
95116

96-
- name: Bazel clean
97-
run: bazel clean
117+
# - name: Bazel clean
118+
# run: bazel clean
98119

99-
- name: Bazel build
100-
run: bazel build -c dbg --config=ubsan //...
120+
# - name: Bazel build
121+
# run: bazel build -c dbg --config=ubsan //...
101122

102-
- name: Bazel test
103-
run: bazel test -c dbg --config=ubsan --runs_per_test 3000 //...
123+
# - name: Bazel test
124+
# run: bazel test -c dbg --config=ubsan --runs_per_test 3000 //...
104125

126+
<<<<<<< HEAD
105127
# - name: Upload bazel-testlogs
106128
# uses: actions/upload-artifact@v7
107129
# with:
108130
# name: bazel-testlogs-ubsan
109131
# path: bazel-testlogs/
132+
=======
133+
# # - name: Upload bazel-testlogs
134+
# # uses: actions/upload-artifact@v4
135+
# # with:
136+
# # name: bazel-testlogs-ubsan
137+
# # path: bazel-testlogs/
138+
>>>>>>> latest

.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

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ TEST_NAMES = [
202202
"TestHighsHessian",
203203
"TestHighsIntegers",
204204
"TestHighsModel",
205-
# "TestHighsParallel",
205+
"TestHighsParallel",
206206
"TestHighsRbTree",
207207
"TestHSet",
208208
"TestICrash",

check/TestCAPI.c

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,16 @@ void assertLogical(const char* name, const HighsInt is) {
241241
void createBlendingLp(void* highs) {
242242
// Special variant of the blending LP, with redundant constraint so
243243
// that LP is reduced by presolve - but not to empty!
244-
const double inf = Highs_getInfinity(highs);
244+
const double kHighsInf = Highs_getInfinity(highs);
245245

246246
HighsInt num_col = 2;
247247
HighsInt num_row = 3;
248248
HighsInt num_nz = 6;
249249
HighsInt sense = -1;
250250
double col_cost[2] = {8, 10};
251251
double col_lower[2] = {0, 0};
252-
double col_upper[2] = {inf, inf};
253-
double row_lower[3] = {-inf, -inf, -inf};
252+
double col_upper[2] = {kHighsInf, kHighsInf};
253+
double row_lower[3] = {-kHighsInf, -kHighsInf, -kHighsInf};
254254
double row_upper[3] = {500, 120, 210};
255255
HighsInt a_index[6] = {0, 1, 0, 1, 0, 1};
256256
double a_value[6] = {0.5, 0.5, 0.3, 0.5, 0.7, 0.5};
@@ -488,41 +488,64 @@ void minimalApiQp() {
488488
HighsInt num_col = 3;
489489
HighsInt num_row = 1;
490490
HighsInt num_nz = 2;
491-
HighsInt q_num_nz = 4;
492491
HighsInt a_format = kHighsMatrixFormatColwise;
493-
HighsInt q_format = kHighsHessianFormatTriangular;
494492
HighsInt sense = kHighsObjSenseMinimize;
495493
double offset = 0;
496494
double col_cost[3] = {0.0, -1.0, -3.0};
497495
double col_lower[3] = {-inf, -inf, -inf};
498496
double col_upper[3] = {inf, inf, inf};
499497
double row_lower[1] = {-inf};
500498
double row_upper[1] = {2};
499+
501500
HighsInt a_start[3] = {0, 1, 1};
502501
HighsInt a_index[2] = {0, 0};
503502
double a_value[2] = {1.0, 1.0};
503+
504+
// Start with triangular Hessian, then
505+
HighsInt q_format = kHighsHessianFormatTriangular;
506+
HighsInt q_num_nz = 4;
504507
HighsInt q_start[3] = {0, 2, 3};
505508
HighsInt q_index[4] = {0, 2, 1, 2};
506509
double q_value[4] = {2.0, -1.0, 0.2, 2.0};
507510

511+
double required_x[3] = {0.5, 5.0, 1.5};
512+
508513
double* col_value = (double*)malloc(sizeof(double) * num_col);
514+
509515
HighsInt model_status;
510-
HighsInt return_status = Highs_qpCall(
511-
num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset,
512-
col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index,
513-
a_value, q_start, q_index, q_value, col_value, NULL, NULL, NULL, NULL,
514-
NULL, &model_status);
516+
HighsInt return_status =
517+
Highs_qpCall(num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset,
518+
col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index,
519+
a_value, q_start, q_index, q_value, col_value, NULL, NULL, NULL, NULL,
520+
NULL, &model_status);
515521
assert(return_status == kHighsStatusOk);
516522
assertIntValuesEqual("Model status for QP qph", model_status,
517-
kHighsModelStatusOptimal);
518-
double required_x[3] = {0.5, 5.0, 1.5};
519-
if (dev_run) {
520-
for (HighsInt iCol = 0; iCol < num_col; iCol++) {
521-
printf("x%d1 = %g\n", (int)iCol, col_value[iCol]);
522-
assertDoubleValuesEqual("Solution value for QP qph", col_value[iCol],
523-
required_x[iCol]);
524-
}
523+
kHighsModelStatusOptimal);
524+
for (HighsInt iCol = 0; iCol < num_col; iCol++) {
525+
if (dev_run) printf("x%d1 = %g\n", (int)iCol, col_value[iCol]);
526+
assertDoubleValuesEqual("Solution value for QP qph", col_value[iCol],
527+
required_x[iCol]);
525528
}
529+
530+
HighsInt square_q_format = kHighsHessianFormatSquare;
531+
HighsInt square_q_num_nz = 5;
532+
HighsInt square_q_start[3] = {0, 2, 3};
533+
HighsInt square_q_index[5] = {0, 2, 1, 0, 2};
534+
double square_q_value[5] = {2.0, -1.0, 0.2, -1.0, 2.0};
535+
536+
Highs_qpCall(num_col, num_row, num_nz, square_q_num_nz, a_format, square_q_format, sense, offset,
537+
col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index,
538+
a_value, square_q_start, square_q_index, square_q_value, col_value, NULL, NULL, NULL, NULL,
539+
NULL, &model_status);
540+
assert(return_status == kHighsStatusOk);
541+
assertIntValuesEqual("Model status for QP qph", model_status,
542+
kHighsModelStatusOptimal);
543+
for (HighsInt iCol = 0; iCol < num_col; iCol++) {
544+
if (dev_run) printf("x%d1 = %g\n", (int)iCol, col_value[iCol]);
545+
assertDoubleValuesEqual("Solution value for QP qph", col_value[iCol],
546+
required_x[iCol]);
547+
}
548+
526549
free(col_value);
527550
}
528551

@@ -1513,23 +1536,33 @@ void testPassHessian() {
15131536
HighsInt index[1] = {0};
15141537
double value[1] = {-2.0};
15151538
HighsInt return_status;
1516-
return_status = Highs_passHessian(highs, 1, 1, 1, start, index, value);
1517-
assertIntValuesEqual("Return of passHessian", return_status, kHighsStatusOk);
1518-
Highs_run(highs);
1519-
// Solving max -x^2 + 2x
1539+
15201540
const double optimal_objective_value = 1;
15211541
const double primal = 1;
15221542
const double dual = 0;
1523-
assertIntValuesEqual("Status", Highs_getModelStatus(highs),
1524-
kHighsModelStatusOptimal); // kOptimal
15251543
double col_value[1] = {-123.0};
15261544
double col_dual[1] = {0.0};
1527-
Highs_getSolution(highs, col_value, col_dual, NULL, NULL);
1528-
double objective_value = Highs_getObjectiveValue(highs);
1529-
assertDoubleValuesEqual("Objective", objective_value,
1530-
optimal_objective_value);
1531-
assertDoubleValuesEqual("Primal", col_value[0], primal);
1532-
assertDoubleValuesEqual("Dual", col_dual[0], dual);
1545+
1546+
for (HighsInt k = 0; k < 2; k++) {
1547+
HighsInt q_format = -1;
1548+
if (k == 0) {
1549+
q_format = kHighsHessianFormatTriangular;
1550+
} else {
1551+
q_format = kHighsHessianFormatSquare;
1552+
}
1553+
return_status = Highs_passHessian(highs, 1, 1, q_format, start, index, value);
1554+
assertIntValuesEqual("Return of passHessian", return_status, kHighsStatusOk);
1555+
Highs_run(highs);
1556+
// Solving max -x^2 + 2x
1557+
assertIntValuesEqual("Status", Highs_getModelStatus(highs),
1558+
kHighsModelStatusOptimal); // kOptimal
1559+
Highs_getSolution(highs, col_value, col_dual, NULL, NULL);
1560+
double objective_value = Highs_getObjectiveValue(highs);
1561+
assertDoubleValuesEqual("Objective", objective_value,
1562+
optimal_objective_value);
1563+
assertDoubleValuesEqual("Primal", col_value[0], primal);
1564+
assertDoubleValuesEqual("Dual", col_dual[0], dual);
1565+
}
15331566

15341567
Highs_destroy(highs);
15351568
}

0 commit comments

Comments
 (0)