Browse Source

Drop support for Julia < 1.10.

pull/27/head
Fredrik Ekre 1 year ago
parent
commit
3c23b77a5e
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 6
      .github/workflows/Test.yml
  2. 7
      Project.toml
  3. 23
      ext/HYPREPartitionedArrays.jl
  4. 7
      src/HYPRE.jl

6
.github/workflows/ci.yml → .github/workflows/Test.yml

@ -1,11 +1,11 @@
name: CI name: Test
on: on:
push: push:
branches: branches:
- 'master' - 'master'
- 'release-' - 'release-'
tags: '*' tags: ['*']
pull_request: pull_request:
jobs: jobs:
@ -15,7 +15,7 @@ jobs:
strategy: strategy:
matrix: matrix:
version: version:
- '1.6' - '1.10'
- '1' - '1'
- 'nightly' - 'nightly'
os: os:

7
Project.toml

@ -1,15 +1,12 @@
name = "HYPRE" name = "HYPRE"
uuid = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" uuid = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771"
version = "1.6.0" version = "1.7.0"
[deps] [deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
HYPRE_jll = "0a602bbd-b08b-5d75-8d32-0de6eef44785" HYPRE_jll = "0a602bbd-b08b-5d75-8d32-0de6eef44785"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseMatricesCSR = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1"
[weakdeps] [weakdeps]
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
@ -26,7 +23,7 @@ CEnum = "0.4, 0.5"
MPI = "0.19, 0.20" MPI = "0.19, 0.20"
PartitionedArrays = "0.5" PartitionedArrays = "0.5"
SparseMatricesCSR = "0.6" SparseMatricesCSR = "0.6"
julia = "1.6" julia = "1.10"
[extras] [extras]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

23
ext/HYPREPartitionedArrays.jl

@ -14,14 +14,6 @@ using SparseMatricesCSR: SparseMatrixCSR, colvals
# PartitionedArrays.PSparseMatrix -> HYPREMatrix # # PartitionedArrays.PSparseMatrix -> HYPREMatrix #
################################################## ##################################################
function subarray_unsafe_supported()
# Wrapping of SubArrays as raw pointers may or may not be supported
# depending on the Julia version. If this is not supported, we have to fall
# back to allocation of an intermediate buffer. This logic can be removed if
# HYPRE.jl drops support for Julia < 1.9.
return VERSION >= v"1.9.0"
end
function Internals.to_hypre_data( function Internals.to_hypre_data(
A::SplitMatrix{<:SparseMatrixCSC}, r::AbstractLocalIndices, c::AbstractLocalIndices A::SplitMatrix{<:SparseMatrixCSC}, r::AbstractLocalIndices, c::AbstractLocalIndices
) )
@ -261,15 +253,8 @@ function Base.copy!(dst::PVector{<:AbstractVector{HYPRE_Complex}}, src::HYPREVec
iu_src_part = o_to_g[end] iu_src_part = o_to_g[end]
nvalues = HYPRE_Int(iu_src_part - il_src_part + 1) nvalues = HYPRE_Int(iu_src_part - il_src_part + 1)
indices = collect(HYPRE_BigInt, il_src_part:iu_src_part) indices = collect(HYPRE_BigInt, il_src_part:iu_src_part)
if subarray_unsafe_supported() values = ov
values = ov
else
values = collect(HYPRE_Complex, ov)
end
@check HYPRE_IJVectorGetValues(src, nvalues, indices, values) @check HYPRE_IJVectorGetValues(src, nvalues, indices, values)
if !subarray_unsafe_supported()
@. ov = values
end
end end
return dst return dst
end end
@ -284,11 +269,7 @@ function Base.copy!(dst::HYPREVector, src::PVector{<:AbstractVector{HYPRE_Comple
iupper_src_part = o_to_g[end] iupper_src_part = o_to_g[end]
nvalues = HYPRE_Int(iupper_src_part - ilower_src_part + 1) nvalues = HYPRE_Int(iupper_src_part - ilower_src_part + 1)
indices = collect(HYPRE_BigInt, ilower_src_part:iupper_src_part) indices = collect(HYPRE_BigInt, ilower_src_part:iupper_src_part)
if subarray_unsafe_supported() values = ov
values = ov
else
values = collect(HYPRE_Complex, ov)
end
@check HYPRE_IJVectorSetValues(dst, nvalues, indices, values) @check HYPRE_IJVectorSetValues(dst, nvalues, indices, values)
end end
# TODO: It shouldn't be necessary to assemble here since we only set owned rows (?) # TODO: It shouldn't be necessary to assemble here since we only set owned rows (?)

7
src/HYPRE.jl

@ -415,11 +415,4 @@ end
include("solvers.jl") include("solvers.jl")
include("solver_options.jl") include("solver_options.jl")
# Compatibility for Julias that doesn't support package extensions
if !(isdefined(Base, :get_extension))
include("../ext/HYPREPartitionedArrays.jl")
include("../ext/HYPRESparseArrays.jl")
include("../ext/HYPRESparseMatricesCSR.jl")
end
end # module HYPRE end # module HYPRE

Loading…
Cancel
Save