中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助
鲲鹏小智

可替换性

MKL中包含单机版直接求解器PARDISO(Parallel Direct Sparse Solver Interface)和集群版直接求解器PARDISO-Cluster(Parallel Direct Sparse Solver for Cluster Interface)。前者为shared-memory版本的并行稀疏求解器,而后者则和SCADSS一样,支持MPI和OPENMP技术的混合模式。直接求解器包含Analyze,Factorize,Solve三个核心阶段,每个阶段都可以单独调用。这一点与用户的实际问题相关,比如用户在求解部分包含时间项的偏微分方程的时候,系数矩阵是保持不变的,因此Analyze和Factorize只需要进行一次,重复调用Solve阶段即可。再比如,系数矩阵的数值发生了变化,但是矩阵的非零元位置未发生变化,那么Analyze只需要进行一次,重复调用Solve阶段即可。在这里给出MKL中的direct solver与SCADSS的接口映射关系。

表1 PARDISO-Cluster与SCADSS的替换映射关系

PARDISO-Cluster接口

SCADSS接口

mtype=2;或者mtype = 4;

phase = 11;

cluster_sparse_solver(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &comm, &error);

KmlScadssSpdAnalyzeDI(&handle);或者

KmlScadssHpdAnalyzeDI(&handle);

mtype=2;或者mtype = 4;

phase = 22;

cluster_sparse_solver(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &comm, &error);

KmlScadssSpdFactorizeDI(&handle);或者

KmlScadssSpdFactorizeDI(&handle);

mtype=2;或者mtype = 4;

phase = 33;

cluster_sparse_solver(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &comm, &error);

KmlScadssSpdSolveDI(&handle);或者

KmlScadssSpdSolveDI(&handle);

mtype=2;或者mtype = 4;

phase = -1;

cluster_sparse_solver(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &comm, &error);

KmlScadssSpdCleanDI(&handle);或者

KmlScadssSpdCleanDI(&handle);

  1. MKL中direct solver通过mtype参数确定输入稀疏矩阵的类型,mtype=2表示SPD矩阵,mtype=4则表示HPD矩阵。
  2. phase参数控制MKL direct solver执行的操作,除上表中列举的取值外,还可以取别的值。例如取12时表示执行Analyze,Factorize两个过程。
表2 PARDISO与SCADSS的替换映射关系

PARDISO接口

SCADSS接口

mtype=2;或者mtype = 4;

phase = 11;

pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &error);

KmlScadssSpdAnalyzeDI(&handle);或者

KmlScadssHpdAnalyzeDI(&handle);

mtype=2;或者mtype = 4;

phase = 22;

pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &error);

KmlScadssSpdFactorizeDI(&handle);或者

KmlScadssHpdFactorizeDI(&handle);

mtype=2;或者mtype = 4;

phase = 33;

pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &error);

KmlScadssSpdSolveDI(&handle);或者

KmlScadssHpdSolveDI(&handle);

mtype=2;或者mtype = 4;

phase = -1;

pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &perm, &nrhs, iparm, &msglvl, b, x, &error);

KmlScadssSpdCleanDI(&handle);或者

KmlScadssHpdCleanDI(&handle);