Skip to content

Commit

Permalink
Manual commit for PR #550 to backport to 1.10 (#577)
Browse files Browse the repository at this point in the history
* Disable nested dissection (from #550)

* Update CI for Julia 1.10

---------

Co-authored-by: Viral B. Shah <[email protected]>
  • Loading branch information
ViralBShah and ViralBShah authored Nov 2, 2024
1 parent d2a80a6 commit 2d762b3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,26 @@ jobs:
fail-fast: false
matrix:
version:
- '~1.10.0-0'
- '1.10'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
include:
- os: macOS-latest
arch: aarch64
version: '1.10'
- os: ubuntu-latest
arch: x86
version: '1.10'
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -55,17 +57,18 @@ jobs:
env:
SPARSEARRAYS_AQUA_TEST: true
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
# version: '1.6'
version: 'nightly'
version: '1.10'
- name: Generate docs
run: |
julia --color=yes -e 'write("Project.toml", replace(read("Project.toml", String), r"uuid = .*?\n" =>"uuid = \"3f01184e-e22b-5df5-ae63-d93ebab69eaf\"\n"));'
Expand Down
28 changes: 18 additions & 10 deletions src/solvers/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1258,25 +1258,33 @@ end

## Compute that symbolic factorization only
function symbolic(A::Sparse{<:VTypes, Ti};
perm::Union{Nothing,AbstractVector{<:Integer}}=nothing,
postorder::Bool=isnothing(perm)||isempty(perm), userperm_only::Bool=true) where Ti
perm::Union{Nothing,AbstractVector{<:Integer}}=nothing,
postorder::Bool=isnothing(perm)||isempty(perm),
userperm_only::Bool=true,
nested_dissection::Bool=false) where Ti

sA = unsafe_load(pointer(A))
sA.stype == 0 && throw(ArgumentError("sparse matrix is not symmetric/Hermitian"))

@cholmod_param postorder = postorder begin
if perm === nothing || isempty(perm) # TODO: deprecate empty perm
return analyze(A)
else # user permutation provided
if userperm_only # use perm even if it is worse than AMD
@cholmod_param nmethods = 1 begin
# The default is to just use AMD. Use nested dissection only if explicitly asked for.
# https://github.com/JuliaSparse/SparseArrays.jl/issues/548
# https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/26ababc7f3af725c5fb9168a1b94850eab74b666/CHOLMOD/Include/cholmod.h#L555-L574
@cholmod_param nmethods = (nested_dissection ? 0 : 2) begin
@cholmod_param postorder = postorder begin
if perm === nothing || isempty(perm) # TODO: deprecate empty perm
return analyze(A)
else # user permutation provided
if userperm_only # use perm even if it is worse than AMD
@cholmod_param nmethods = 1 begin
return analyze_p(A, Ti[p-1 for p in perm])
end
else
return analyze_p(A, Ti[p-1 for p in perm])
end
else
return analyze_p(A, Ti[p-1 for p in perm])
end
end
end

end

function cholesky!(F::Factor{Tv}, A::Sparse{Tv};
Expand Down

0 comments on commit 2d762b3

Please sign in to comment.