Hi, I am using the iterative.cu under ViennaCL-1.7.0/examples/tutorial to learn how to use the sparse iterative solver and of course the preconditioners combination. I would like to show my appreciation first for such an easy to compile and use package, and of course the very clear documents.
I have one question about the number of iterations across different sparse iterative solvers. Based on one example in the manual, I set a customized threshold and max iterations as
viennacl::linalg::cg_tagcustom_cg(1e-3,12000);
I use custom_cg.iters() to get access to the number of iterations the solvers need and then printed out as shown follows.
I did the same code modification for the three different iterative solvers, CG, BiCGSTAB, and GMRES with no preconditioner, ILUT, and Jacobi preconditioners. The results shown shat, the number of iterations are the same no matter what kind of iterative solver I am using as follows. The preconditioners do have a impact though.
However my point is that I am expecting that CG, BiCGSTAB and GMRES should give me different number of iterations. Maybe BiCGSTAB could have similar number of iterations as CG for SPD matrices. I don't expect GMRES can get exact the same number of iterations as CG or CG variations.
Another point I should mention is that, this observations hold for not only the example system mat65k.mtx, but also for my all other 13 test systems ranging from 200 by 200 to 25000 by 25000. I haven't confirmed that they are positive definite or not.
I do appreciate any comments or suggestion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree that you should not see the same iteration counts and residuals for the same solver. Could you please verify that you are using the correct solver tag types? They should be
In terms of preconditioners, you are observing the expected behavior. You matrix is likely to have the same diagonal entries (maybe all 1), hence you see the same iteration counts with 'NoP' and 'Jac'.
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you so much for the quick response! I checked my code. Yes you are right. I forget to use different tags for different iterative solvers. I have updated them and now everything makes sense, like 'NoP' uses most iterations; ILUT keeps a stable performance, Jacobi works very well for systems very diagonally dominant.
Thanks again!
Kayla
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I am using the iterative.cu under ViennaCL-1.7.0/examples/tutorial to learn how to use the sparse iterative solver and of course the preconditioners combination. I would like to show my appreciation first for such an easy to compile and use package, and of course the very clear documents.
I have one question about the number of iterations across different sparse iterative solvers. Based on one example in the manual, I set a customized threshold and max iterations as
I use custom_cg.iters() to get access to the number of iterations the solvers need and then printed out as shown follows.
I did the same code modification for the three different iterative solvers, CG, BiCGSTAB, and GMRES with no preconditioner, ILUT, and Jacobi preconditioners. The results shown shat, the number of iterations are the same no matter what kind of iterative solver I am using as follows. The preconditioners do have a impact though.
However my point is that I am expecting that CG, BiCGSTAB and GMRES should give me different number of iterations. Maybe BiCGSTAB could have similar number of iterations as CG for SPD matrices. I don't expect GMRES can get exact the same number of iterations as CG or CG variations.
Another point I should mention is that, this observations hold for not only the example system mat65k.mtx, but also for my all other 13 test systems ranging from 200 by 200 to 25000 by 25000. I haven't confirmed that they are positive definite or not.
I do appreciate any comments or suggestion.
Hi Kayla,
I agree that you should not see the same iteration counts and residuals for the same solver. Could you please verify that you are using the correct solver tag types? They should be
Maybe a copy&paste error?
In terms of preconditioners, you are observing the expected behavior. You matrix is likely to have the same diagonal entries (maybe all 1), hence you see the same iteration counts with 'NoP' and 'Jac'.
Best regards,
Karli
Karli
Thank you so much for the quick response! I checked my code. Yes you are right. I forget to use different tags for different iterative solvers. I have updated them and now everything makes sense, like 'NoP' uses most iterations; ILUT keeps a stable performance, Jacobi works very well for systems very diagonally dominant.
Thanks again!
Kayla