[petsc-users] I find slow performance of SNES

Pedro Gonzalez pedro.gonzalez at u-bordeaux.fr
Sun Sep 15 17:35:15 CDT 2019


Dear all, 

I am working on a code that solves a nonlinear system of equations G(x)=0 with Gauss-Seidel method. I managed to parallelize it by using DMDA with very good results. The previous week I changed my Gauss-Seidel solver by SNES. The code using SNES gives the same result as before, but I do not obtain the performance that I expected: 
1) When using the Gauss-Seidel method (-snes_type ngs) the residual G(x) seems not be scallable to the amplitude of x and I have to add the option -snes_secant_h in order to make SNES converge. However, I varied the step from 1.E-1 to 1.E50 and obtained the same result within the same computation time. Is it normal that snes_secant_h can vary so many orders of magnitude? 
2) Compared to my Gauss-Seidel algorithm, SNES does (approximately) the same number of iterations (with the same convergence criterium) but it is about 100 times slower. What can be the reason(s) of this slow performance of SNES solver? I do not use preconditioner with my algorithm so I did not add one to SNES. 

The main PETSc subroutines that I have included (in this order) are the following: 
call DMDACreate3D 
call DMSetUp 
call DMCreateLocalVector 
call DMCreateGlobalVector 
call SNESCreate 
call SNESSetConvergenceTest 
call SNESSetDM 
call DMDASNESSetFunctionLocal 
call SNESSetFromOptions 
call SNESSolve 

Thanks in advance for you help. 

Best regards, 
Pedro 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190916/8a9b2582/attachment.html>


More information about the petsc-users mailing list