diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index f0dca21a..abf1a60d 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -2,7 +2,7 @@ name: Documentation on: push: branches: - - master + - main tags: '*' pull_request: types: [opened, synchronize, reopened] @@ -10,20 +10,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Set up Homebrew - id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master - - name: Install MUMPS from Homebrew - id: set-up-mumps - run: | - brew tap brewsci/num - brew tap dpo/mumps-jl - brew install gcc openblas cmake - brew install mpich-mumps - echo "$(brew --prefix)/bin" >> $GITHUB_PATH - echo "::set-output name=prefix::$(brew --prefix)" - echo "::set-output name=gfortran::$(which gfortran)" - echo "::set-output name=mpif90::$(which mpif90)" - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest with: @@ -31,19 +17,8 @@ jobs: arch: x64 - name: Install dependencies run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build("MUMPS")' - env: - MUMPS_PREFIX: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich-mumps" - SCALAPACK_PREFIX: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich-scalapack" - JULIA_MPI_PATH: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich" - JULIA_MPI_Fortran_COMPILER: "${{steps.set-up-mumps.outputs.mpif90}}" - FC: "${{steps.set-up-mumps.outputs.prefix}}/opt/gcc/bin/gfortran" - name: Build and deploy run: julia --project=docs --color=yes docs/make.jl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - MUMPS_PREFIX: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich-mumps" - SCALAPACK_PREFIX: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich-scalapack" - JULIA_MPI_PATH: "${{steps.set-up-mumps.outputs.prefix}}/opt/mpich" - JULIA_MPI_Fortran_COMPILER: "${{steps.set-up-mumps.outputs.mpif90}}" - FC: "${{steps.set-up-mumps.outputs.prefix}}/opt/gcc/bin/gfortran" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ed07d9b..edc2d0ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: branches: - - master + - main pull_request: types: [opened, synchronize, reopened] jobs: diff --git a/src/MUMPS.jl b/src/MUMPS.jl index 1a6c60da..fa5496b2 100644 --- a/src/MUMPS.jl +++ b/src/MUMPS.jl @@ -11,7 +11,7 @@ This mode of operation gives the user complete control as described in the MUMPS manual, though it exposes unsafe operations, so beware. More convenient are the use of the functions [`mumps_solve`](@ref), [`mumps_factorize`](@ref), -[`mumps_det`](@ref), [`mumps_schur`](@ref), and [`mumps_select_inv`](@ref), which all have +[`mumps_det`](@ref), [`mumps_schur_complement`](@ref), and [`mumps_select_inv`](@ref), which all have mutating counterparts (such as [`mumps_solve!`](@ref)). These can take matrices and right hand sides directly, so, for example, the equation `A*x=y`, solved in Base by `x=A\\y` or `LinearAlbegra.ldiv!(x,A,y)`, can be solved with MUMPS diff --git a/src/convenience.jl b/src/convenience.jl index d24fba43..329e983c 100644 --- a/src/convenience.jl +++ b/src/convenience.jl @@ -170,17 +170,17 @@ function mumps_det(A) end """ - mumps_schur!(mumps, schur_inds) - mumps_schur!(mumps, x) + mumps_schur_complement!(mumps, schur_inds) + mumps_schur_complement!(mumps, x) `schur_inds` is integer array of Schur indices. If `x` is sparse, Schur indices determined from populated rows of `x` -See also: [`mumps_schur`](@ref), [`get_schur!`](@ref), [`get_schur`](@ref) +See also: [`mumps_schur_complement`](@ref), [`get_schur_complement!`](@ref), [`get_schur_complement`](@ref) """ -function mumps_schur! end +function mumps_schur_complement! end -function mumps_schur!(mumps::Mumps, schur_inds::AbstractArray{Int, 1}) +function mumps_schur_complement!(mumps::Mumps, schur_inds::AbstractArray{Int, 1}) set_schur_centralized_by_column!(mumps, schur_inds) if mumps.job ∈ [1] # if analyzed only, factorize mumps.job = 2 @@ -190,26 +190,26 @@ function mumps_schur!(mumps::Mumps, schur_inds::AbstractArray{Int, 1}) invoke_mumps!(mumps) end -mumps_schur!(mumps::Mumps, x::SparseMatrixCSC) = mumps_schur!(mumps, unique!(sort(x.rowval))) +mumps_schur_complement!(mumps::Mumps, x::SparseMatrixCSC) = mumps_schur_complement!(mumps, unique!(sort(x.rowval))) -mumps_schur!(mumps::Mumps, x::SparseVector) = mumps_schur!(mumps, x.nzind) +mumps_schur_complement!(mumps::Mumps, x::SparseVector) = mumps_schur_complement!(mumps, x.nzind) """ - mumps_schur(A,schur_inds) -> S - mumps_schur(A,x) -> S + mumps_schur_complement(A,schur_inds) -> S + mumps_schur_complement(A,x) -> S `schur_inds` is integer array `x` is sparse, populated rows are Schur indices `S` is Schur complement matrix. -See also: [`mumps_schur!`](@ref) +See also: [`mumps_schur_complement!`](@ref) """ -function mumps_schur(A::AbstractArray, x) +function mumps_schur_complement(A::AbstractArray, x) mumps = Mumps(A) suppress_display!(mumps) set_icntl!(mumps, 8, 0) # turn scaling off, not used with schur anyway (suppresses warning message with schur) - mumps_schur!(mumps, x) - S = get_schur(mumps) + mumps_schur_complement!(mumps, x) + S = get_schur_complement(mumps) finalize!(mumps) return S end diff --git a/src/interface.jl b/src/interface.jl index 81d02607..97848002 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -350,18 +350,18 @@ function get_sol(mumps::Mumps{T}) where {T} end """ - get_schur!(S,mumps) + get_schur_complement!(S,mumps) Retrieve Schur complement matrix from `mumps` into pre-allocated `S` -See also: [`get_schur`](@ref), [`mumps_schur!`](@ref), [`mumps_schur`](@ref) +See also: [`get_schur_complement`](@ref), [`mumps_schur_complement!`](@ref), [`mumps_schur_complement`](@ref) """ -function get_schur!(S, mumps::Mumps) +function get_schur_complement!(S, mumps::Mumps) has_schur(mumps) || throw(MUMPSException("schur complement not yet allocated.")) - get_schur_unsafe!(S, mumps) + get_schur_complement_unsafe!(S, mumps) end -function get_schur_unsafe!(S, mumps::Mumps) +function get_schur_complement_unsafe!(S, mumps::Mumps) for i ∈ LinearIndices(S) S[i] = unsafe_load(mumps.schur, i) end @@ -369,15 +369,15 @@ function get_schur_unsafe!(S, mumps::Mumps) end """ - get_schur(mumps) -> S + get_schur_complement(mumps) -> S Retrieve Schur complement matrix `S` from `mumps` -See also: [`get_schur!`](@ref), [`mumps_schur!`](@ref), [`mumps_schur`](@ref) +See also: [`get_schur_complement!`](@ref), [`mumps_schur_complement!`](@ref), [`mumps_schur_complement`](@ref) """ -function get_schur(mumps::Mumps{T}) where {T} +function get_schur_complement(mumps::Mumps{T}) where {T} S = Array{T}(undef, mumps.size_schur, mumps.size_schur) - get_schur!(S, mumps) + get_schur_complement!(S, mumps) end """ @@ -386,7 +386,7 @@ end Set up Schur complement matrix calculation for the "centralized by column" method suggested in the MUMPS manual -See also: [`mumps_schur!`](@ref), [`mumps_schur`](@ref) +See also: [`mumps_schur_complement!`](@ref), [`mumps_schur_complement`](@ref) """ function set_schur_centralized_by_column!(mumps::Mumps{T}, schur_inds::AbstractArray{Int}) where {T} mumps.size_schur = length(schur_inds)