PARDISO, reuse symbolic factorization
12 views (last 30 days)
Show older comments
I installed the matlab package from pardiso-project.org, and I built the .mex linking with libpardiso600-WIN-X86-64.lib.
I'm solving in a loop a series of problems Ax=b, where A changes, but still has the same sparsity pattern. To exploit that, in the initialization, I only perform symbolic factoriazation once (which supposes to allocate the data structures), and I free it only once; this is the general idea:
pardiso_info = []
bSolverInitialized = 0;
for i = 1:n
A = As{i};
rhs = rhses{i};
A = A + eps*speye(size(A)); % diagonal must be full
A = tril(A);
% initialize
if ~bSolverInitialized
bSolverInitialized = 1;
pardiso_info = pardisoinit(-2,0);
% Analyze the matrix and compute a symbolic factorization.
pardiso_info = pardisoreorder(A, pardiso_info, false);
end
% Compute the numeric factorization
pardiso_info = pardisofactor(A, pardiso_info, false);
% Compute the solutions using the symbolic factorization
[sol, obj.pardiso_info] = pardisosolve(A, rhs, pardiso_info, false);
end
pardisofree(pardiso_info);
clear pardiso_info;
I execute this code many times (in an outer loop). Matlab memory usage increases until it hangs. I suspect a memory leak, and pardiso is my prime suspect. I'll need to do further testing to try and pinpoint the problem, but I thought to verify first that I'm using it correctly since the manual didn't mention reusing symbolic factorization.
I'm not sure if it's the right place for the question. pardiso-project.org doesn't seem to have a forum, but Intel may support it as part of MKL.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!