Skip to content

Commit c0d06fa

Browse files
Sébastien LoiselSébastien Loisel
authored andcommitted
Clean up CI and fix MPI desync issues
- Remove tmate debug session - Restore Julia 1.10 and use Pkg.add(url=...) for dependencies - Remove [sources] section from Project.toml (requires Julia 1.11) - Enable julia-actions/cache - Remove logfile=io0() from test_parabolic.jl (caused desync with QuietTestSet) - Remove amgb_assert_uniform MPI implementation (no longer used)
1 parent 790d631 commit c0d06fa

3 files changed

Lines changed: 10 additions & 138 deletions

File tree

.github/workflows/CI.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,10 @@ jobs:
3737
3838
- uses: julia-actions/setup-julia@v2
3939
with:
40-
version: '1.11'
40+
version: '1.10'
4141
arch: x64
4242

43-
# Skip cache - we need fresh builds from git main branches
44-
# - uses: julia-actions/cache@v2
45-
46-
- name: Clear stale compiled packages and clones
47-
run: |
48-
rm -rf ~/.julia/compiled
49-
rm -rf ~/.julia/packages/LinearAlgebraMPI
50-
rm -rf ~/.julia/packages/MultiGridBarrier
51-
rm -rf ~/.julia/clones
43+
- uses: julia-actions/cache@v2
5244

5345
- name: Build package with system Python
5446
env:
@@ -57,19 +49,15 @@ jobs:
5749
julia --project=. -e '
5850
using Pkg
5951
Pkg.add(name="OpenSSL_jll", version="3.0")
52+
Pkg.add(url="https://github.com/sloisel/LinearAlgebraMPI.jl.git", rev="main")
53+
Pkg.add(url="https://github.com/sloisel/MultiGridBarrier.jl.git", rev="main")
6054
Pkg.instantiate()
6155
Pkg.build("PyCall")
6256
'
6357
6458
- name: Precompile package
6559
uses: julia-actions/julia-buildpkg@v1
6660

67-
- name: Setup tmate debug session
68-
uses: mxschmitt/action-tmate@v3
69-
with:
70-
limit-access-to-actor: true
71-
timeout-minutes: 30
72-
7361
- name: Run tests with coverage
7462
uses: julia-actions/julia-runtest@v1
7563
with:
@@ -110,17 +98,9 @@ jobs:
11098
11199
- uses: julia-actions/setup-julia@v2
112100
with:
113-
version: '1.11'
114-
115-
# Skip cache - we need fresh builds from git main branches
116-
# - uses: julia-actions/cache@v2
101+
version: '1.10'
117102

118-
- name: Clear stale compiled packages and clones
119-
run: |
120-
rm -rf ~/.julia/compiled
121-
rm -rf ~/.julia/packages/LinearAlgebraMPI
122-
rm -rf ~/.julia/packages/MultiGridBarrier
123-
rm -rf ~/.julia/clones
103+
- uses: julia-actions/cache@v2
124104

125105
- name: Configure doc environment
126106
env:
@@ -130,6 +110,8 @@ jobs:
130110
using Pkg
131111
Pkg.develop(PackageSpec(path=pwd()))
132112
Pkg.add(name="OpenSSL_jll", version="3.0")
113+
Pkg.add(url="https://github.com/sloisel/LinearAlgebraMPI.jl.git", rev="main")
114+
Pkg.add(url="https://github.com/sloisel/MultiGridBarrier.jl.git", rev="main")
133115
Pkg.instantiate()
134116
Pkg.build("PyCall")
135117
'

Project.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1313
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1414
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515

16-
[sources]
17-
LinearAlgebraMPI = {url = "https://github.com/sloisel/LinearAlgebraMPI.jl.git", rev = "main"}
18-
MultiGridBarrier = {url = "https://github.com/sloisel/MultiGridBarrier.jl.git", rev = "main"}
19-
2016
[compat]
2117
BenchmarkTools = "1.6"
2218
LinearAlgebraMPI = "0.1"
2319
MPI = "0.20"
2420
MultiGridBarrier = "0.11"
2521
PrecompileTools = "1"
26-
julia = "1.11"
22+
julia = "1.10"
2723

2824
[extras]
2925
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"

src/MultiGridBarrierMPI.jl

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ using PrecompileTools
5858
# ============================================================================
5959

6060
# Import the functions we need to extend
61-
import MultiGridBarrier: amgb_zeros, amgb_all_isfinite, amgb_assert_uniform, amgb_diag, amgb_blockdiag, map_rows, map_rows_gpu, vertex_indices, _raw_array, _to_cpu_array, _rows_to_svectors
61+
import MultiGridBarrier: amgb_zeros, amgb_all_isfinite, amgb_diag, amgb_blockdiag, map_rows, map_rows_gpu, vertex_indices, _raw_array, _to_cpu_array, _rows_to_svectors
6262

6363
# amgb_zeros: Create distributed zero matrices/vectors using Base.zeros from LinearAlgebraMPI
6464
MultiGridBarrier.amgb_zeros(::SparseMatrixMPI{T,Ti,AV}, m, n) where {T,Ti,AV} =
@@ -87,112 +87,6 @@ function MultiGridBarrier.amgb_all_isfinite(z::VectorMPI{T,AV}) where {T,AV}
8787
MPI.Allreduce(local_all_finite, &, MPI.COMM_WORLD)
8888
end
8989

90-
# amgb_assert_uniform: Assert that a scalar value is identical on all MPI ranks
91-
# Gathers all values to rank 0, checks uniformity, and aborts if not uniform
92-
function MultiGridBarrier.amgb_assert_uniform(x::T, msg::String="") where T<:Number
93-
comm = MPI.COMM_WORLD
94-
rank = MPI.Comm_rank(comm)
95-
nranks = MPI.Comm_size(comm)
96-
97-
# Gather all values to rank 0
98-
all_values = MPI.Gather(x, 0, comm)
99-
100-
# Check uniformity on rank 0
101-
is_uniform = true
102-
if rank == 0
103-
ref_val = all_values[1]
104-
for i in 2:nranks
105-
# Use isequal for exact equality (handles NaN correctly: isequal(NaN,NaN)=true)
106-
if !isequal(all_values[i], ref_val)
107-
is_uniform = false
108-
break
109-
end
110-
end
111-
end
112-
113-
# Broadcast uniformity result to all ranks
114-
is_uniform = MPI.Bcast(is_uniform, 0, comm)
115-
116-
if !is_uniform
117-
# Print error info on rank 0 only (use stdout for visibility)
118-
if rank == 0
119-
println("\n" * "="^60)
120-
println("MPI UNIFORMITY ASSERTION FAILED: $msg")
121-
println("="^60)
122-
println("Values across ranks:")
123-
for i in 1:nranks
124-
println(" Rank $(i-1): $(all_values[i])")
125-
end
126-
println("\nStack trace:")
127-
for frame in stacktrace()
128-
println(" ", frame)
129-
end
130-
println("="^60)
131-
flush(stdout)
132-
end
133-
134-
# Small delay to ensure output is flushed before abort
135-
sleep(0.1)
136-
137-
# Abort all ranks
138-
MPI.Abort(comm, 1)
139-
end
140-
141-
return nothing
142-
end
143-
144-
# Also handle boolean specifically for converged flags
145-
function MultiGridBarrier.amgb_assert_uniform(x::Bool, msg::String="")
146-
comm = MPI.COMM_WORLD
147-
rank = MPI.Comm_rank(comm)
148-
nranks = MPI.Comm_size(comm)
149-
150-
# Convert to Int for MPI (some MPI implementations don't handle Bool well)
151-
x_int = Int32(x)
152-
all_values = MPI.Gather(x_int, 0, comm)
153-
154-
# Check uniformity on rank 0
155-
is_uniform = true
156-
if rank == 0
157-
ref_val = all_values[1]
158-
for i in 2:nranks
159-
if all_values[i] != ref_val
160-
is_uniform = false
161-
break
162-
end
163-
end
164-
end
165-
166-
# Broadcast uniformity result to all ranks
167-
is_uniform = MPI.Bcast(is_uniform, 0, comm)
168-
169-
if !is_uniform
170-
# Print error info on rank 0 only (use stdout for visibility)
171-
if rank == 0
172-
println("\n" * "="^60)
173-
println("MPI UNIFORMITY ASSERTION FAILED: $msg")
174-
println("="^60)
175-
println("Boolean values across ranks:")
176-
for i in 1:nranks
177-
println(" Rank $(i-1): $(Bool(all_values[i]))")
178-
end
179-
println("\nStack trace:")
180-
for frame in stacktrace()
181-
println(" ", frame)
182-
end
183-
println("="^60)
184-
flush(stdout)
185-
end
186-
187-
# Small delay to ensure output is flushed before abort
188-
sleep(0.1)
189-
190-
MPI.Abort(comm, 1)
191-
end
192-
193-
return nothing
194-
end
195-
19690
# amgb_diag: Create diagonal matrix from vector
19791
# SparseMatrixMPI with VectorMPI - preserves vector's array type in nzval
19892
MultiGridBarrier.amgb_diag(::SparseMatrixMPI{T,Ti,AV}, z::VectorMPI{T,AV2}, m=length(z), n=length(z)) where {T,Ti,AV,AV2} =

0 commit comments

Comments
 (0)