Skip to content

Commit 328bcd5

Browse files
Sébastien LoiselSébastien Loisel
authored andcommitted
Remove amgb_assert_uniform (MPI sync points); bump to 0.11.39
1 parent 9d6d878 commit 328bcd5

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MultiGridBarrier"
22
uuid = "9e2c1f1d-9131-4ad4-b32f-bd2a0b0ecd1e"
33
authors = ["Sébastien Loisel"]
4-
version = "0.11.38"
4+
version = "0.11.39"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/AlgebraicMultiGridBarrier.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export amgb, Geometry, Convex, convex_linear, convex_Euclidian_power, AMGBConvergenceFailure, apply_D, linesearch_illinois, linesearch_backtracking, stopping_exact, stopping_inexact, interpolate, intersect, plot, Log, default_idx, multigrid_from_fine_grid, map_rows, map_rows_gpu, amgb_assert_uniform
1+
export amgb, Geometry, Convex, convex_linear, convex_Euclidian_power, AMGBConvergenceFailure, apply_D, linesearch_illinois, linesearch_backtracking, stopping_exact, stopping_inexact, interpolate, intersect, plot, Log, default_idx, multigrid_from_fine_grid, map_rows, map_rows_gpu
22

33
@doc raw"""
44
Log(x::T) where {T} = x<=0 ? T(-Inf) : Base.log(x) # "Convex programmer's log"
@@ -79,10 +79,6 @@ amgb_zeros(::LinearAlgebra.Adjoint{T, Matrix{T}},m,n) where {T} = zeros(T,m,n)
7979
amgb_zeros(::Type{Vector{T}}, m) where {T} = zeros(T, m)
8080
amgb_all_isfinite(z::Vector{T}) where {T} = all(isfinite.(z))
8181

82-
# Assert that a value is uniform across all MPI ranks (no-op for non-MPI)
83-
# Override in MultiGridBarrierMPI to actually check uniformity
84-
amgb_assert_uniform(x, msg="") = nothing
85-
8682
amgb_diag(::SparseMatrixCSC{T,Int}, z::Vector{T},m=length(z),n=length(z)) where {T} = spdiagm(m,n,0=>z)
8783
amgb_diag(::Matrix{T}, z::Vector{T},m=length(z),n=length(z)) where {T} = diagm(m,n,0=>z)
8884

@@ -1527,7 +1523,6 @@ function barrier(Q::Convex{T})::Barrier where T
15271523
y = map_rows_gpu(F0, args..., Dz)
15281524
# GPU-compatible: avoid inline closure by splitting computation
15291525
result = dot(w, y) + sum(w .* map_rows_gpu(dot, c, Dz))
1530-
amgb_assert_uniform(result, "f0: barrier function result")
15311526
result
15321527
end
15331528

@@ -1690,7 +1685,6 @@ function amgb_step(Q::Vector{<:Convex{T}},
16901685
line_search=ls,
16911686
printlog)
16921687
its[J] += SOL.k
1693-
amgb_assert_uniform(SOL.converged, "eta: SOL.converged at j=$j J=$J")
16941688
if SOL.converged
16951689
z = z + R*SOL.x
16961690
end
@@ -1964,19 +1958,15 @@ function newton(::Type{Mat}, ::Type{T},
19641958
n = solve(symmetric(H), g)
19651959
@assert amgb_all_isfinite(n)
19661960
inc = dot(g,n)
1967-
amgb_assert_uniform(inc, "newton: inc after dot(g,n)")
19681961
@debug("k=",k," y=",y," ‖g‖=",norm(g), " λ^2=",inc)
19691962
if inc<=0
19701963
converged = true
1971-
amgb_assert_uniform(converged, "newton: converged after inc<=0")
19721964
break
19731965
end
19741966
(xnext,ynext,gnext) = line_search(x,y,g,n,F0,F1;printlog)
1975-
amgb_assert_uniform(ynext, "newton: ynext after line_search")
19761967
if stopping_criterion(ymin,ynext,gmin,gnext,n,sqrt(incmin),sqrt(inc)) #ynext>=ymin && norm(gnext)>=theta*norm(g)
19771968
@debug("converged: ymin=",ymin," ynext=",ynext," ‖gnext‖=",norm(gnext)," λ=",sqrt(inc)," λmin=",sqrt(incmin))
19781969
converged = true
1979-
amgb_assert_uniform(converged, "newton: converged after stopping_criterion")
19801970
end
19811971
x,y,g = xnext,ynext,gnext
19821972
gmin = min(gmin,norm(g))

0 commit comments

Comments
 (0)