Skip to content

Commit 905d9ca

Browse files
authored
The Cbc optimizer does not support Apple Silicon thus tests fail. Switch to HiGHS for tests. (#22)
The apple silicon CI fails with a hard crash and no core dump due to jump-dev/Cbc.jl#193 As suggested in the linked issues, use HiGHS instead of Cbc as it is overall better. This concerns only our tests, not actual dependency. Finally tests run on Apple Silicon.
1 parent 2d2a3bb commit 905d9ca

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: CI
22
env:
33
JULIA_NUM_THREADS: 2
4+
concurrency:
5+
# group by workflow and ref; the last slightly strange component ensures that for pull
6+
# requests, we limit to 1 concurrent job, but for the master branch we don't
7+
group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main') || github.run_number }}
8+
# Cancel intermediate builds, but only if it is a pull request build.
9+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
410
on:
511
pull_request:
612
branches:

Project.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,3 @@ JuMP = "1"
2626
LEMONGraphs = "0.1.0"
2727
MathOptInterface = "1"
2828
julia = "1.10"
29-
30-
[extras]
31-
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
32-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
33-
34-
[targets]
35-
test = ["Test", "Cbc"]

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[deps]
2-
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
32
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
3+
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
44
Hungarian = "e91730f6-4275-51fb-a7a0-7064cfbd3b39"
55
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

test/REQUIRE

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/runtests.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Graphs
22
using GraphsMatching
33
using Test
4-
using Cbc
4+
using HiGHS
55
using JuMP
66
using LinearAlgebra: I
77

@@ -21,7 +21,7 @@ end
2121
w = transpose(w) * w
2222
match_sol = maximum_weight_matching(
2323
g,
24-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
24+
HiGHS.Optimizer,
2525
w,
2626
)
2727
match_red = maximum_weight_matching_reduction(g, w)
@@ -44,7 +44,7 @@ end
4444
]
4545
match = maximum_weight_matching(
4646
g,
47-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
47+
HiGHS.Optimizer,
4848
w,
4949
)
5050
@test match.mate[1] == 3
@@ -57,7 +57,7 @@ end
5757
w[1, 3] = 1
5858
match = maximum_weight_matching(
5959
g,
60-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
60+
HiGHS.Optimizer,
6161
w,
6262
)
6363
@test match.weight 1
@@ -75,7 +75,7 @@ end
7575

7676
match = maximum_weight_matching(
7777
g,
78-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
78+
HiGHS.Optimizer,
7979
w,
8080
)
8181
@test match.weight 3
@@ -91,7 +91,7 @@ end
9191
add_edge!(g, 3, 4)
9292
match = maximum_weight_matching(
9393
g,
94-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
94+
HiGHS.Optimizer,
9595
)
9696
@test match.weight 2
9797
@test match.mate[1] == 2
@@ -107,7 +107,7 @@ end
107107

108108
match = maximum_weight_matching(
109109
g,
110-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
110+
HiGHS.Optimizer,
111111
w,
112112
)
113113
@test match.weight 2
@@ -124,7 +124,7 @@ end
124124

125125
match = maximum_weight_matching(
126126
g,
127-
optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
127+
HiGHS.Optimizer,
128128
w,
129129
)
130130
@test match.weight 5
@@ -147,7 +147,7 @@ end
147147
g,
148148
w,
149149
algorithm = LPAlgorithm(),
150-
optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
150+
optimizer = HiGHS.Optimizer,
151151
)
152152
@test match.weight 21
153153
@test match.mate[1] == 3
@@ -165,7 +165,7 @@ end
165165
g,
166166
w,
167167
algorithm = LPAlgorithm(),
168-
optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
168+
optimizer = HiGHS.Optimizer,
169169
)
170170
@test match.weight 11.5
171171
@test match.mate[1] == 4
@@ -185,7 +185,7 @@ end
185185
g,
186186
w,
187187
algorithm = LPAlgorithm(),
188-
optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
188+
optimizer = HiGHS.Optimizer,
189189
cutoff = 0,
190190
)
191191
@test match.weight 11.5
@@ -206,7 +206,7 @@ end
206206
g,
207207
w,
208208
algorithm = LPAlgorithm(),
209-
optimizer = optimizer_with_attributes(Cbc.Optimizer, "LogLevel" => 0),
209+
optimizer = HiGHS.Optimizer,
210210
cutoff = 0,
211211
)
212212
@test match.weight 12

0 commit comments

Comments
 (0)