I adopted PARDISO to a multiple matrix system, there are hundreds to thousands of matrices to solve. In this situation, each matrix has its own sparsity structure. Thus, each matrix has it own pt values. I tried some benchmarks and got some strange result. In one case, there are thousands of matrix structures. I set the msglvl to 1 and dumped the pt values to see what's going wrong. It turns out the first 14 matrice perform well and their pt values are well-set and different from each other. However, the 15'th matrix (the matrix size is 1x1) has it own pt to be 0. And after the 15'th matrix, all the matrices have pt set to 0 and the PARDISO does not show any messages (even msglvl is 1). I've tried to remove the 1x1 matrix and it turns out to be fine for other matrices until next 1x1 matrix appears. Does 1x1 matrix not set the pt value and affect all other succend matrices? How can I resolve or bypass this issue if I still want the 1x1 matrix to use PARDISO solver (even it's meaningless)? Also, does PARDISO restrict to the number of pt values? I mean does PARDISO has the constraint of the number of different pts. Thanks
ps : In the benchmarking of PARDISO, we force all matrices to use PARDISO solver without regarding the matrix size.
I just find out why this happens. For all matrices, I use one static int iparm for all of them. And the iparms are initialized only once in the beginning. While solving a matrix, I didn't reset its values since I think it should be consistent to the initialization value. However, after solving a matrix, some iparm which does not list in the argument table changes its value. For example, iparm, iparm, ... or what ever, changes its values and I didn't know what they meant. Currently, I reset the iparms before solving each matrix equations. This gives the correct result. But I think this reset process will causes longer run time (since the matrix solving process is called over millions or even more times). Is there any hint about what iparms will be modified and should be reset then. Thanks a lot in advance...
There are two key param for the pardiso. one pt and another is iparm. Both of them are input parameter and output as well. So if you call pardisoin iteration cycle, you need reset both pt and iparm.
There is some explaination on mkl manual aboutthe iparm, like
iparm(63) - the total double precision memory consumption in MBytes that the solver used for factorization and solution phases if the in-core PARDISO is used. iparm(63) is returned only in the in-core mode. It is similar to iparm(17), but iparm(17) returns the value of the memory consumption for both in-core and OOC modes of PARDISO.
and which iparm will be changed after run solver. like
iparm On output, some iparm values will report useful information, for example, numbers of non-zero elements in the factors, and so on.
iparm(7)- number of performed iterative refinement steps. The number of iterative refinement steps that are actually performed during the solve step. iparm(14)- number of perturbed pivots. After factorization, iparm(14) contains the number of perturbed pivots during the elimination process for mtype =11, mtype =13, mtype =-2, mtype =-4, or mtype =-6. iparm(15) - peak memory symbolic factorization. The parameter iparm(15) provides the user with the total peak memory in KBytes that the solver needed during the analysis and symbolic factorization phase. This value is only computed in phase 1. iparm(16) - permanent memory symbolic factorization. .....
You can refer to them. But considering the rest process is simple, it will not take too much timeeither reset themas beginor only reset somemodified.
Thanks for the reply. I'll reset all iparm for each matrix solve process. However, I still have some questions. In my application, I have thousands or even more matrices to solve iteratively. Each matrix has it own sparsity structure and each time to solve the matrix equations, the sparsity structure doesn't change, only the matrix values change. As the manual mentioned, the internal data structure is stored with related to the pt value. Each matrix has it own pt value and phase 11 analysis is performed only once. In the later iteratively solving, only phase 23 needs to perform. This saves the run time. So I should not reset the pt values for each matrix, right?
And since iparm stands for input, output and undefined arguments, why should I reset the output and undefined ones to 0? By the way, iparm (in C) is iparm(64) which is not defined in the manual. I'm just interested in that since all input arguments in iparm are setup once and never change (the input/output arguments, iparm(18) should not affect the behavior even we don't reset them), why the output and undefined ones will affect PARDISO results?
Yes, if the sparsity structure doesn't change, the pt value is not need to reset for each matrix. But please note the ptis not allowed to be changed externallyonce setup as the documentation marked: It is very important that the pointer is initialized with zero at the first call of PARDISO. After that first call you should never modify the pointer, as a serious memory leak can occur.
We had run into some issue regarding to the "pt".About the iparm, it seems not havesuch strict limitation,the manualjust mentioned, the iparm which not listed in documentis reserved and must be initialized with 0. According to your case, it looks the "pt"go wrongfirst, then trace back to iparm.ButIdoubt the root should be someexception like marix become 1x1 broken the pt, the iparm problemisside-effect. Ifpossible, could you please providea test case to me sowe caninvestigatedfurther?