@@ -313,11 +313,11 @@ end
313
313
function PardisoJL (solver_type= Pardiso. nothing ,)
314
314
315
315
return PardisoJL (nthreads, solver_type, matrix_type, solve_phase,
316
- release_phase, setup_func )
316
+ release_phase, iparm, dparm )
317
317
end
318
318
319
319
function init_cacheval (alg:: PardisoJL , cache:: LinearCache )
320
- @unpack nthreads, solver_type, matrix_type
320
+ @unpack nthreads, solver_type, matrix_type, iparm, dparm = alg
321
321
322
322
solver = Pardiso. PARDISO_LOADED[] ? PardisoSolver () : MKLPardisoSolver ()
323
323
@@ -328,13 +328,13 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
328
328
matrix_type != = nothing && Pardiso. set_matrixtype! (solver, matrix_type)
329
329
cache. verbose && Pardiso. set_msglvl! (solver, Pardiso. MESSAGE_LEVEL_ON)
330
330
331
- iparm != = nothing begin # pass in vector of tuples like [(iparm, key)]
331
+ iparm != = nothing && begin # pass in vector of tuples like [(iparm, key)]
332
332
for i in length (iparm)
333
333
Pardiso. set_iparm! (solver, iparm[i]. .. )
334
334
end
335
335
end
336
336
337
- dparm != = nothing begin
337
+ dparm != = nothing && begin
338
338
for i in length (dparm)
339
339
Pardiso. set_dparm! (solver, dparm[i]. .. )
340
340
end
@@ -344,25 +344,24 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
344
344
end
345
345
346
346
function SciMLBase. solve (cache:: LinearCache , alg:: PardisoJL ; kwargs... )
347
- @unpack cacheval, A, b, u = cache
347
+ @unpack A, b, u, cacheval = cache
348
348
349
349
if cache. isfresh
350
350
solver = init_cacheval (alg, cache)
351
351
cache = set_cacheval (cache, solver)
352
352
end
353
353
354
- abstol = cache. abstol
355
- reltol = cache. reltol
356
-
354
+ abstol = cache. abstol
355
+ reltol = cache. reltol
357
356
kwargs = (abstol= abstol, reltol= reltol, alg. kwargs... )
358
357
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)
361
363
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?
365
365
366
366
return cache. u
367
367
end
368
-
0 commit comments