@@ -313,11 +313,11 @@ end
313313function 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 )
317317end
318318
319319function 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)
344344end
345345
346346function 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
367367end
368-
0 commit comments