Skip to content

Commit 04109ed

Browse files
committed
compiles yay
1 parent dcac88a commit 04109ed

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/LinearSolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export LUFactorization, SVDFactorization, QRFactorization, GenericFactorization,
4949
export KrylovJL, KrylovJL_CG, KrylovJL_GMRES, KrylovJL_BICGSTAB, KrylovJL_MINRES,
5050
IterativeSolversJL, IterativeSolversJL_CG, IterativeSolversJL_GMRES,
5151
IterativeSolversJL_BICGSTAB, IterativeSolversJL_MINRES,
52-
PardisoJL, PardisoJL_Default
52+
PardisoJL
5353
export DefaultLinSolve
5454

5555
end

src/wrappers.jl

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ end
313313
function PardisoJL(solver_type=Pardiso.nothing,)
314314

315315
return PardisoJL(nthreads, solver_type, matrix_type, solve_phase,
316-
release_phase, setup_func)
316+
release_phase, iparm, dparm)
317317
end
318318

319319
function init_cacheval(alg::PardisoJL, cache::LinearCache)
320-
@unpack nthreads, solver_type, matrix_type
320+
@unpack nthreads, solver_type, matrix_type, iparm, dparm = alg
321321

322322
solver = Pardiso.PARDISO_LOADED[] ? PardisoSolver() : MKLPardisoSolver()
323323

@@ -328,13 +328,13 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
328328
matrix_type !== nothing && Pardiso.set_matrixtype!(solver, matrix_type)
329329
cache.verbose && Pardiso.set_msglvl!(solver, Pardiso.MESSAGE_LEVEL_ON)
330330

331-
iparm !== nothing begin # pass in vector of tuples like [(iparm, key)]
331+
iparm !== nothing && begin # pass in vector of tuples like [(iparm, key)]
332332
for i in length(iparm)
333333
Pardiso.set_iparm!(solver, iparm[i]...)
334334
end
335335
end
336336

337-
dparm !== nothing begin
337+
dparm !== nothing && begin
338338
for i in length(dparm)
339339
Pardiso.set_dparm!(solver, dparm[i]...)
340340
end
@@ -344,25 +344,24 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
344344
end
345345

346346
function SciMLBase.solve(cache::LinearCache, alg::PardisoJL; kwargs...)
347-
@unpack cacheval, A, b, u = cache
347+
@unpack A, b, u, cacheval = cache
348348

349349
if cache.isfresh
350350
solver = init_cacheval(alg, cache)
351351
cache = set_cacheval(cache, solver)
352352
end
353353

354-
abstol = cache.abstol
355-
reltol = cache.reltol
356-
354+
abstol = cache.abstol
355+
reltol = cache.reltol
357356
kwargs = (abstol=abstol, reltol=reltol, alg.kwargs...)
358357

359-
Pardiso.set_phase!(ps, alg.phase)
360-
358+
"""
359+
figure out whatever phase is. should set_phase call be in init_cacheval?
360+
can we use phase to store factorization in cache?
361+
"""
362+
Pardiso.set_phase!(cacheval, alg.solve_phase)
361363
Pardiso.solve!(cacheval, u, A, b)
362-
363-
# is this necessary?
364-
Pardiso.set_phase!(ps, Pardiso.RELEASE_ALL)
364+
Pardiso.set_phase!(cacheval, alg.release_phase) # is this necessary?
365365

366366
return cache.u
367367
end
368-

0 commit comments

Comments
 (0)