Skip to content

Commit

Permalink
Remove StrideOneVector alias (#174)
Browse files Browse the repository at this point in the history
* remove StrideOneVector alias

- StrideOneVector lead to type inference issues

* remove StrideOneVector in lib folder

* refact linear solvers' interfaces

* fix tests on GPU

* StrideOneVector removed

* fix MadNLPPardiso

* remove StrideOneVector for all subpackages

* ma27 update

* minor fix

* typo fixed

* view fix

* typo fix

* typo fix

* hsl typo fix

* pardisomkl

* black commit to force ci

* test passing

* _madnlp_unsafe_wrapper

Co-authored-by: Sungho Shin <sshin@anl.gov>
  • Loading branch information
frapac and sshin23 committed Jul 2, 2022
1 parent ad48437 commit 03d728e
Show file tree
Hide file tree
Showing 29 changed files with 214 additions and 199 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pkg> add MadNLPHSL, MadNLPPardiso, MadNLPMumps, MadNLPGPU, MadNLPGraph, MadNLPIt
These packages are stored in the `lib` subdirectory within the main MadNLP repository. Some extension packages may require additional dependencies or specific hardware. For the instructions for the build procedure, see the following links: [MadNLPHSL](https://github.com/sshin23/MadNLP.jl/tree/master/lib/MadNLPHSL), [MadNLPPardiso](https://github.com/sshin23/MadNLP.jl/tree/master/lib/MadNLPHSL), [MadNLPGPU](https://github.com/sshin23/MadNLP.jl/tree/master/lib/MadNLPGPU).


## Usage
## Usage
### Interfaces
MadNLP is interfaced with modeling packages:
- [JuMP](https://github.com/jump-dev/JuMP.jl)
Expand Down
2 changes: 1 addition & 1 deletion lib/MadNLPGPU/src/kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end
end
end

function MadNLP.treat_fixed_variable!(kkt::MadNLP.AbstractKKTSystem{T, MT}) where {T, MT<:CuMatrix{T}}
function MadNLP.treat_fixed_variable!(kkt::MadNLP.AbstractKKTSystem{T, VT, MT}) where {T, VT, MT<:CuMatrix{T}}
length(kkt.ind_fixed) == 0 && return
aug = kkt.aug_com
d_ind_fixed = kkt.ind_fixed |> CuVector # TODO: allocate ind_fixed directly on the GPU
Expand Down
2 changes: 1 addition & 1 deletion lib/MadNLPGraph/src/MadNLPGraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import MadNLP:
eval_objective_gradient, eval_function, eval_constraint, eval_hessian_lagrangian, eval_constraint_jacobian,
@kwdef, Logger, @debug, @warn, @error, @sprintf,
AbstractOptions, AbstractLinearSolver, EmptyLinearSolver, set_options!,
SparseMatrixCSC, SubVector, StrideOneVector,
SparseMatrixCSC, SubVector,
SymbolicException,FactorizationException,SolveException,InertiaException,
introduce, factorize!, solve!, improve!, is_inertia, inertia,
default_linear_solver, default_dense_solver, get_csc_view, get_cscsy_view, nnz, mul!,
Expand Down
4 changes: 2 additions & 2 deletions lib/MadNLPGraph/src/schur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module MadNLPSchur

import ..MadNLPGraph:
@kwdef, Logger, @debug, @warn, @error,
AbstractOptions, AbstractLinearSolver, EmptyLinearSolver, set_options!, SparseMatrixCSC, SubVector, StrideOneVector,
AbstractOptions, AbstractLinearSolver, EmptyLinearSolver, set_options!, SparseMatrixCSC, SubVector,
SymbolicException,FactorizationException,SolveException,InertiaException,
introduce, factorize!, solve!, improve!, is_inertia, inertia,
default_linear_solver, default_dense_solver, get_csc_view, get_cscsy_view, nnz, mul!,
Expand Down Expand Up @@ -92,7 +92,7 @@ function SolverWorker(tsp,V_0,csc::SparseMatrixCSC{Float64},inds::Vector{Int},k,
SubproblemSolverModule::Module,logger::Logger,option_dict::Dict{Symbol,Any})

V = findall(tsp.part.==k)

csc_k,csc_k_view = get_cscsy_view(csc,V,inds=inds)
compl,compl_view = get_csc_view(csc,V,V_0,inds=inds)
V_0_nz = findnz(compl.colptr)
Expand Down
2 changes: 1 addition & 1 deletion lib/MadNLPGraph/src/schwarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module MadNLPSchwarz

import ..MadNLPGraph:
@kwdef, Logger, @debug, @warn, @error,
default_linear_solver,SparseMatrixCSC, SubVector, StrideOneVector, get_cscsy_view, nnz,
default_linear_solver,SparseMatrixCSC, SubVector, get_cscsy_view, nnz,
SymbolicException,FactorizationException,SolveException,InertiaException,
AbstractOptions, AbstractLinearSolver, set_options!,
MonolevelPartition, MonolevelStruc, BilevelPartition, BilevelStruc,
Expand Down
4 changes: 2 additions & 2 deletions lib/MadNLPHSL/src/MadNLPHSL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module MadNLPHSL

import Libdl: dlopen, RTLD_DEEPBIND
import MadNLP: @kwdef, Logger, @debug, @warn, @error,
AbstractOptions, AbstractLinearSolver, set_options!, SparseMatrixCSC, SubVector, StrideOneVector,
AbstractOptions, AbstractLinearSolver, set_options!, SparseMatrixCSC, SubVector,
SymbolicException,FactorizationException,SolveException,InertiaException,
introduce, factorize!, solve!, improve!, is_inertia, inertia, findIJ, nnz,
get_tril_to_full, transfer!, input_type
get_tril_to_full, transfer!, input_type, _madnlp_unsafe_wrap

include(joinpath("..","deps","deps.jl"))

Expand Down
15 changes: 6 additions & 9 deletions lib/MadNLPHSL/src/ma27.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# MadNLP.jl
# Created by Sungho Shin (sungho.shin@wisc.edu)

const ma27_default_icntl = Int32[
6,6,0,2139062143,1,32639,32639,32639,32639,14,9,8,8,9,10,32639,32639,32639,32689,24,11,9,8,9,10,0,0,0,0,0]
const ma27_default_cntl = [.1,1.0,0.,0.,0.]
Expand All @@ -24,7 +21,7 @@ mutable struct Ma27Solver <: AbstractLinearSolver
info::Vector{Int32}

a::Vector{Float64}
a_view::StrideOneVector{Float64}
a_view::Vector{Float64}
la::Int32
ikeep::Vector{Int32}

Expand All @@ -39,7 +36,7 @@ mutable struct Ma27Solver <: AbstractLinearSolver
logger::Logger
end

ma27ad!(n::Cint,nz::Cint,I::StrideOneVector{Cint},J::StrideOneVector{Cint},
ma27ad!(n::Cint,nz::Cint,I::Vector{Cint},J::Vector{Cint},
iw::Vector{Cint},liw::Cint,ikeep::Vector{Cint},iw1::Vector{Cint},
nsteps::Vector{Cint},iflag::Cint,icntl::Vector{Cint},cntl::Vector{Cdouble},
info::Vector{Cint},ops::Cdouble) = ccall(
Expand All @@ -51,8 +48,8 @@ ma27ad!(n::Cint,nz::Cint,I::StrideOneVector{Cint},J::StrideOneVector{Cint},
Ptr{Cint},Ref{Cdouble}),
n,nz,I,J,iw,liw,ikeep,iw1,nsteps,iflag,icntl,cntl,info,ops)

ma27bd!(n::Cint,nz::Cint,I::StrideOneVector{Cint},J::StrideOneVector{Cint},
a::StrideOneVector{Cdouble},la::Cint,iw::Vector{Cint},liw::Cint,
ma27bd!(n::Cint,nz::Cint,I::Vector{Cint},J::Vector{Cint},
a::Vector{Cdouble},la::Cint,iw::Vector{Cint},liw::Cint,
ikeep::Vector{Cint},nsteps::Vector{Cint},maxfrt::Vector{Cint},iw1::Vector{Cint},
icntl::Vector{Cint},cntl::Vector{Cdouble},info::Vector{Cint}) = ccall(
(:ma27bd_,libhsl),
Expand Down Expand Up @@ -101,7 +98,7 @@ function Ma27Solver(csc::SparseMatrixCSC;

la = ceil(Int32,max(nz,opt.ma27_la_init_factor*info[5]))
a = Vector{Float64}(undef,la)
a_view = view(a,1:nnz(csc))
a_view = _madnlp_unsafe_wrap(a,nnz(csc))
liw= ceil(Int32,opt.ma27_liw_init_factor*info[6])
resize!(iw,liw)
maxfrt=Int32[1]
Expand Down Expand Up @@ -134,7 +131,7 @@ function factorize!(M::Ma27Solver)
return M
end

function solve!(M::Ma27Solver,rhs::StrideOneVector{Float64})
function solve!(M::Ma27Solver,rhs::Vector{Float64})
length(M.w)<M.maxfrt[1] && resize!(M.w,M.maxfrt[1])
length(M.iw1)<M.nsteps[1] && resize!(M.iw1,M.nsteps[1])
ma27cd!(Int32(M.csc.n),M.a,M.la,M.iw,M.liw,M.w,M.maxfrt,rhs,
Expand Down
11 changes: 4 additions & 7 deletions lib/MadNLPHSL/src/ma57.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# MadNLP.jl
# Created by Sungho Shin (sungho.shin@wisc.edu)

const ma57_default_icntl = Int32[0,0,6,1,0,5,1,0,10,0,16,16,10,100,0,0,0,0,0,0]
const ma57_default_cntl = Float64[1e-8,1.0e-20,0.5,0.0,0.0]

Expand Down Expand Up @@ -45,7 +42,7 @@ mutable struct Ma57Solver <: AbstractLinearSolver
end


ma57ad!(n::Cint,nz::Cint,I::StrideOneVector{Cint},J::StrideOneVector{Cint},lkeep::Cint,
ma57ad!(n::Cint,nz::Cint,I::Vector{Cint},J::Vector{Cint},lkeep::Cint,
keep::Vector{Cint},iwork::Vector{Cint},icntl::Vector{Cint},
info::Vector{Cint},rinfo::Vector{Cdouble}) = ccall(
(:ma57ad_,libhsl),
Expand All @@ -55,7 +52,7 @@ ma57ad!(n::Cint,nz::Cint,I::StrideOneVector{Cint},J::StrideOneVector{Cint},lkeep
Ptr{Cint},Ptr{Cdouble}),
n,nz,I,J,lkeep,keep,iwork,icntl,info,rinfo)

ma57bd!(n::Cint,nz::Cint,V::StrideOneVector{Cdouble},fact::Vector{Cdouble},
ma57bd!(n::Cint,nz::Cint,V::Vector{Cdouble},fact::Vector{Cdouble},
lfact::Cint,ifact::Vector{Cint},lifact::Cint,lkeep::Cint,
keep::Vector{Cint},iwork::Vector{Cint},icntl::Vector{Cint},cntl::Vector{Cdouble},
info::Vector{Cint},rinfo::Vector{Cdouble}) = ccall(
Expand All @@ -68,7 +65,7 @@ ma57bd!(n::Cint,nz::Cint,V::StrideOneVector{Cdouble},fact::Vector{Cdouble},
n,nz,V,fact,lfact,ifact,lifact,lkeep,keep,iwork,icntl,cntl,info,rinfo)

ma57cd!(job::Cint,n::Cint,fact::Vector{Cdouble},lfact::Cint,
ifact::Vector{Cint},lifact::Cint,nrhs::Cint,rhs::StrideOneVector{Cdouble},
ifact::Vector{Cint},lifact::Cint,nrhs::Cint,rhs::Vector{Cdouble},
lrhs::Cint,work::Vector{Cdouble},lwork::Cint,iwork::Vector{Cint},
icntl::Vector{Cint},info::Vector{Cint}) = ccall(
(:ma57cd_,libhsl),
Expand Down Expand Up @@ -146,7 +143,7 @@ function factorize!(M::Ma57Solver)
return M
end

function solve!(M::Ma57Solver,rhs::StrideOneVector{Float64})
function solve!(M::Ma57Solver,rhs::Vector{Float64})
ma57cd!(one(Int32),Int32(M.csc.n),M.fact,M.lfact,M.ifact,
M.lifact,one(Int32),rhs,Int32(M.csc.n),M.work,M.lwork,M.iwork,M.icntl,M.info)
M.info[1]<0 && throw(SolveException())
Expand Down
36 changes: 21 additions & 15 deletions lib/MadNLPHSL/src/ma77.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# MadNLP.jl
# Created by Sungho Shin (sungho.shin@wisc.edu)



@kwdef mutable struct Ma77Options <: AbstractOptions
ma77_buffer_lpage::Int = 4096
ma77_buffer_npage::Int = 1600
Expand Down Expand Up @@ -175,14 +170,14 @@ ma77_open_d(n::Cint,fname1::String,fname2::String,fname3::String,fname4::String,
(Cint,Ptr{Cchar},Ptr{Cchar},Ptr{Cchar},Ptr{Cchar},
Ptr{Ptr{Cvoid}},Ref{Ma77Control},Ref{Ma77Info}),
n,fname1,fname2,fname3,fname4,keep,control,info)
ma77_input_vars_d(idx::Cint,nvar::Cint,list::StrideOneVector{Cint},
ma77_input_vars_d(idx::Cint,nvar::Cint,list::Vector{Cint},
keep::Vector{Ptr{Cvoid}},control::Ma77Control,info::Ma77Info) = ccall(
(:ma77_input_vars_d,libhsl),
Cvoid,
(Cint,Cint,Ptr{Cint},
Ptr{Ptr{Cvoid}},Ref{Ma77Control},Ref{Ma77Info}),
idx,nvar,list,keep,control,info)
ma77_input_reals_d(idx::Cint,length::Cint,reals::StrideOneVector{Cdouble},
ma77_input_reals_d(idx::Cint,length::Cint,reals::Vector{Cdouble},
keep::Vector{Ptr{Cvoid}},control::Ma77Control,info::Ma77Info) = ccall(
(:ma77_input_reals_d,libhsl),
Cvoid,
Expand Down Expand Up @@ -271,34 +266,45 @@ function Ma77Solver(csc::SparseMatrixCSC{Float64,Int32};
info.flag < 0 && throw(SymbolicException())

for i=1:full.n
ma77_input_vars_d(Int32(i),full.colptr[i+1]-full.colptr[i],
view(full.rowval,full.colptr[i]:full.colptr[i+1]-1),
keep,control,info);
ma77_input_vars_d(
Int32(i),full.colptr[i+1]-full.colptr[i],
_madnlp_unsafe_wrap(
full.rowval,
full.colptr[i+1]-full.colptr[i],
full.colptr[i]
),
keep,control,info);
info.flag < 0 && throw(LinearSymbolicException())
end

ma77_analyse_d(order,keep,control,info)
info.flag<0 && throw(SymbolicException())

M = Ma77Solver(csc,full,tril_to_full_view,
control,info,mc68_control,mc68_info,order,keep,opt,logger)
control,info,mc68_control,mc68_info,order,keep,opt,logger)
finalizer(finalize,M)
return M
end

function factorize!(M::Ma77Solver)
M.full.nzval.=M.tril_to_full_view
for i=1:M.full.n
ma77_input_reals_d(Int32(i),M.full.colptr[i+1]-M.full.colptr[i],
view(M.full.nzval,M.full.colptr[i]:M.full.colptr[i+1]-1),
M.keep,M.control,M.info)
ma77_input_reals_d(
Int32(i),M.full.colptr[i+1]-M.full.colptr[i],
_madnlp_unsafe_wrap(
M.full.nzval,
M.full.colptr[i+1]-M.full.colptr[i],
M.full.colptr[i]
),
M.keep,M.control,M.info
)
M.info.flag < 0 && throw(FactorizationException())
end
ma77_factor_d(Int32(0),M.keep,M.control,M.info,C_NULL)
M.info.flag < 0 && throw(FactorizationException())
return M
end
function solve!(M::Ma77Solver,rhs::StrideOneVector{Float64})
function solve!(M::Ma77Solver,rhs::Vector{Float64})
ma77_solve_d(Int32(0),Int32(1),Int32(M.full.n),rhs,M.keep,M.control,M.info,C_NULL);
M.info.flag < 0 && throw(SolveException())
return rhs
Expand Down
13 changes: 5 additions & 8 deletions lib/MadNLPHSL/src/ma86.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# MadNLP.jl
# Created by Sungho Shin (sungho.shin@wisc.edu)

@kwdef mutable struct Ma86Options <: AbstractOptions
ma86_num_threads::Int = 1
ma86_print_level::Float64 = -1
Expand Down Expand Up @@ -72,16 +69,16 @@ ma86_default_control_d(control::Ma86Control) = ccall(
Nothing,
(Ref{Ma86Control},),
control)
ma86_analyse_d(n::Cint,colptr::StrideOneVector{Cint},rowval::StrideOneVector{Cint},
order::StrideOneVector{Cint},keep::Vector{Ptr{Nothing}},
ma86_analyse_d(n::Cint,colptr::Vector{Cint},rowval::Vector{Cint},
order::Vector{Cint},keep::Vector{Ptr{Nothing}},
control::Ma86Control,info::Ma86Info) = ccall(
(:ma86_analyse_d,libhsl),
Nothing,
(Cint,Ptr{Cint},Ptr{Cint},Ptr{Cdouble},
Ptr{Ptr{Nothing}},Ref{Ma86Control},Ref{Ma86Info}),
n,colptr,rowval,order,keep,control,info)
ma86_factor_d(n::Cint,colptr::StrideOneVector{Cint},rowval::StrideOneVector{Cint},
nzval::StrideOneVector{Cdouble},order::StrideOneVector{Cint},
ma86_factor_d(n::Cint,colptr::Vector{Cint},rowval::Vector{Cint},
nzval::Vector{Cdouble},order::Vector{Cint},
keep::Vector{Ptr{Nothing}},control::Ma86Control,info::Ma86Info,
scale::Ptr{Nothing}) = ccall(
(:ma86_factor_d,libhsl),
Expand Down Expand Up @@ -152,7 +149,7 @@ function factorize!(M::Ma86Solver)
M.info.flag<0 && throw(FactorizationException())
return M
end
function solve!(M::Ma86Solver,rhs::StrideOneVector{Float64})
function solve!(M::Ma86Solver,rhs::Vector{Float64})
ma86_solve_d(Int32(0),Int32(1),Int32(M.csc.n),rhs,
M.order,M.keep,M.control,M.info,C_NULL)
M.info.flag<0 && throw(SolveException())
Expand Down
12 changes: 4 additions & 8 deletions lib/MadNLPHSL/src/ma97.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# MadNLP.jl
# Created by Sungho Shin (sungho.shin@wisc.edu)


@kwdef mutable struct Ma97Options <: AbstractOptions
ma97_num_threads::Int = 1
ma97_print_level::Int = -1
Expand Down Expand Up @@ -78,7 +74,7 @@ ma97_default_control_d(control::Ma97Control) = ccall(
(Ref{Ma97Control},),
control)

ma97_analyse_d(check::Cint,n::Cint,ptr::StrideOneVector{Cint},row::StrideOneVector{Cint},
ma97_analyse_d(check::Cint,n::Cint,ptr::Vector{Cint},row::Vector{Cint},
val::Ptr{Nothing},akeep::Vector{Ptr{Nothing}},
control::Ma97Control,info::Ma97Info,
order::Ptr{Nothing}) = ccall(
Expand All @@ -88,14 +84,14 @@ ma97_analyse_d(check::Cint,n::Cint,ptr::StrideOneVector{Cint},row::StrideOneVect
Ptr{Ptr{Nothing}},Ref{Ma97Control},Ref{Ma97Info},Ptr{Cint}),
check,n,ptr,row,val,akeep,control,info,order)
ma97_factor_d(matrix_type::Cint,ptr::Ptr{Nothing},row::Ptr{Nothing},
val::StrideOneVector{Cdouble},akeep::Vector{Ptr{Nothing}},fkeep::Vector{Ptr{Nothing}},
val::Vector{Cdouble},akeep::Vector{Ptr{Nothing}},fkeep::Vector{Ptr{Nothing}},
control::Ma97Control,info::Ma97Info,scale::Ptr{Nothing}) = ccall(
(:ma97_factor_d,libhsl),
Nothing,
(Cint,Ptr{Cint},Ptr{Cint},Ptr{Cdouble},Ptr{Ptr{Nothing}},
Ptr{Ptr{Nothing}},Ref{Ma97Control},Ref{Ma97Info},Ptr{Cdouble}),
matrix_type,ptr,row,val,akeep,fkeep,control,info,scale)
ma97_solve_d(job::Cint,nrhs::Cint,x::StrideOneVector{Cdouble},ldx::Cint,
ma97_solve_d(job::Cint,nrhs::Cint,x::Vector{Cdouble},ldx::Cint,
akeep::Vector{Ptr{Nothing}},fkeep::Vector{Ptr{Nothing}},
control::Ma97Control,info::Ma97Info) = ccall(
(:ma97_solve_d,libhsl),
Expand Down Expand Up @@ -151,7 +147,7 @@ function factorize!(M::Ma97Solver)
M.info.flag<0 && throw(FactorizationException())
return M
end
function solve!(M::Ma97Solver,rhs::StrideOneVector{Float64})
function solve!(M::Ma97Solver,rhs::Vector{Float64})
ma97_solve_d(Int32(0),Int32(1),rhs,M.n,M.akeep,M.fkeep,M.control,M.info)
M.info.flag<0 && throw(SolveException())
return rhs
Expand Down
4 changes: 2 additions & 2 deletions lib/MadNLPKrylov/src/MadNLPKrylov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module MadNLPKrylov
import MadNLP:
@kwdef, Logger, @debug, @warn, @error,
AbstractOptions, AbstractIterator, set_options!, @sprintf,
solve_refine!, mul!, ldiv!, size, StrideOneVector
solve_refine!, mul!, ldiv!, size
import IterativeSolvers:
FastHessenberg, ArnoldiDecomp, Residual, init!, init_residual!, expand!, Identity,
orthogonalize_and_normalize!, update_residual!, gmres_iterable!, GMRESIterable, converged,
Expand All @@ -28,7 +28,7 @@ size(A::VirtualMatrix,i) = (A.m,A.n)[i]
struct VirtualPreconditioner
ldiv!::Function
end
ldiv!(Pl::VirtualPreconditioner,x::StrideOneVector{Float64}) = Pl.ldiv!(x)
ldiv!(Pl::VirtualPreconditioner,x::Vector{Float64}) = Pl.ldiv!(x)

mutable struct KrylovIterator <: AbstractIterator
g::Union{Nothing,GMRESIterable}
Expand Down
4 changes: 2 additions & 2 deletions lib/MadNLPMumps/src/MadNLPMumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MUMPS_seq_jll
import MadNLP:
parsefile, dlopen,
@kwdef, Logger, @debug, @warn, @error,
SparseMatrixCSC, SubVector, StrideOneVector,
SparseMatrixCSC, SubVector,
SymbolicException,FactorizationException,SolveException,InertiaException,
AbstractOptions, AbstractLinearSolver, set_options!, input_type,
introduce, factorize!, solve!, improve!, is_inertia, inertia, findIJ, nnz
Expand Down Expand Up @@ -425,7 +425,7 @@ function factorize!(M::MumpsSolver)
return M
end

function solve!(M::MumpsSolver, rhs::StrideOneVector{Float64})
function solve!(M::MumpsSolver,rhs::Vector{Float64})
M.is_singular && return rhs
M.mumps_struc.rhs = pointer(rhs)
M.mumps_struc.job = 3
Expand Down
2 changes: 1 addition & 1 deletion lib/MadNLPPardiso/src/MadNLPPardiso.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include(joinpath("..","deps","deps.jl"))
import Libdl: dlopen, RTLD_DEEPBIND
import MadNLP:
MadNLP, @kwdef, Logger, @debug, @warn, @error,
SubVector, StrideOneVector, SparseMatrixCSC,
SubVector, SparseMatrixCSC,
SymbolicException,FactorizationException,SolveException,InertiaException,
AbstractOptions, AbstractLinearSolver, set_options!,
introduce, factorize!, solve!, improve!, is_inertia, inertia, input_type,
Expand Down
4 changes: 2 additions & 2 deletions lib/MadNLPPardiso/src/pardiso.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _pardiso(
pt::Vector{Int},maxfct::Ref{Cint},mnum::Ref{Cint},mtype::Ref{Cint},
phase::Ref{Cint},n::Ref{Cint},a::Vector{Cdouble},ia::Vector{Cint},ja::Vector{Cint},
perm::Vector{Cint},nrhs::Ref{Cint},iparm::Vector{Cint},msglvl::Ref{Cint},
b::StrideOneVector{Cdouble},x::StrideOneVector{Cdouble},err::Ref{Cint},dparm::Vector{Cdouble}) =
b::Vector{Cdouble},x::Vector{Cdouble},err::Ref{Cint},dparm::Vector{Cdouble}) =
ccall(
(:pardiso,libpardiso),
Cvoid,
Expand Down Expand Up @@ -98,7 +98,7 @@ function factorize!(M::PardisoSolver)
M.err.x < 0 && throw(FactorizationException())
return M
end
function solve!(M::PardisoSolver,rhs::StrideOneVector{Float64})
function solve!(M::PardisoSolver,rhs::Vector{Float64})
_pardiso(M.pt,Ref{Int32}(1),Ref{Int32}(1),Ref{Int32}(-2),Ref{Int32}(33),
Ref{Int32}(M.csc.n),M.csc.nzval,M.csc.colptr,M.csc.rowval,M.perm,
Ref{Int32}(1),M.iparm,M.msglvl,rhs,M.w,M.err,M.dparm)
Expand Down
Loading

0 comments on commit 03d728e

Please sign in to comment.