Skip to content

Commit

Permalink
Merge pull request #132 from SciML/unpack
Browse files Browse the repository at this point in the history
Add Unpack.jl to LinearSolvePardiso
  • Loading branch information
ChrisRackauckas authored May 21, 2022
2 parents bcb4791 + bd0d330 commit 9cf1981
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group:
- All
- Core
- LinearSolvePardiso
version:
- '1'
Expand All @@ -25,7 +26,6 @@ jobs:
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
GROUP: ${{ matrix.group }}
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
Expand All @@ -35,11 +35,9 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
5 changes: 4 additions & 1 deletion lib/LinearSolvePardiso/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
SciMLBase = "1.25"
LinearSolve = "1"
Pardiso = "0.5"
UnPack = "1"
julia = "1.6"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Random", "Test"]
1 change: 1 addition & 0 deletions lib/LinearSolvePardiso/src/LinearSolvePardiso.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module LinearSolvePardiso

using Pardiso, LinearSolve, SciMLBase
using UnPack

Base.@kwdef struct PardisoJL <: LinearSolve.SciMLLinearSolveAlgorithm
nprocs::Union{Int,Nothing} = nothing
Expand Down
5 changes: 3 additions & 2 deletions lib/LinearSolvePardiso/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using LinearSolve, LinearSolvePardiso, SparseArrays
using LinearSolve, LinearSolvePardiso, SparseArrays, Random

A1 = sparse([1.0 0 -2 3
0 5 1 2
Expand All @@ -8,10 +8,12 @@ b1 = rand(4)
prob1 = LinearProblem(A1, b1)

lambda = 3
n = 4
e = ones(n)
e2 = ones(n - 1)
A2 = spdiagm(-1 => im * e2, 0 => lambda * e, 1 => -im * e2)
b2 = rand(n) + im * zeros(n)
cache_kwargs = (; verbose=true, abstol=1e-8, reltol=1e-8, maxiter=30)

prob2 = LinearProblem(A2, b2)

Expand All @@ -29,7 +31,6 @@ for alg in (
@test_broken A2 * u b2
end

n = 4
Random.seed!(10)
A = sprand(n, n, 0.8);
A2 = 2.0 .* A;
Expand Down
26 changes: 17 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,35 @@ const LONGER_TESTS = false
const GROUP = get(ENV, "GROUP", "All")

function dev_subpkg(subpkg)
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
Pkg.develop(PackageSpec(path=subpkg_path))
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
Pkg.develop(PackageSpec(path=subpkg_path))
end

function activate_subpkg_env(subpkg)
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
Pkg.activate(subpkg_path)
Pkg.develop(PackageSpec(path=subpkg_path))
Pkg.instantiate()
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
Pkg.activate(subpkg_path)
Pkg.develop(PackageSpec(path=subpkg_path))
Pkg.instantiate()
end

@show GROUP, GROUP == "LinearSolvePardiso"

if GROUP == "All" || GROUP == "Core"
@time @safetestset "Basic Tests" begin include("basictests.jl") end
@time @safetestset "Basic Tests" begin
include("basictests.jl")
end
end

if GROUP == "LinearSolveCUDA"
dev_subpkg("LinearSolveCUDA")
@time @safetestset "CUDA" begin include("../lib/LinearSolveCUDA/test/runtests.jl") end
@time @safetestset "CUDA" begin
include("../lib/LinearSolveCUDA/test/runtests.jl")
end
end

if GROUP == "LinearSolvePardiso"
dev_subpkg("LinearSolvePardiso")
@time @safetestset "Pardiso" begin include("../lib/LinearSolvePardiso/test/runtests.jl") end
@time @safetestset "Pardiso" begin
include("../lib/LinearSolvePardiso/test/runtests.jl")
end
end

0 comments on commit 9cf1981

Please sign in to comment.