High Performance Computing Center North
Remember to load the SLEPc module (which will include the PETSc module as well).
In this exercise you will solve linear systems in parallel with PETSc. The program lab1.c solves the Poisson equation using the finite-difference method on a square regular grid with n+1 subdivisions on each side. Modify the program so that it computes the residual norm and prints it, together with the number of iterations performed by the solver.
Try different combinations of iterative solver and preconditioner, such as gmres+bjacobi or bcgs+sor. Use -ksp_view to check the actual parameters used by the solver. Compare also with a direct linear solver.
The program lab2.c is similar to the previous one, but loads the matrix from a binary file. Use the -log_summary option to make a performance analysis for varying number of processes with matrix 'bbmat'.
The idea of this second part is to take a guided tour on SLEPc functionality through the hands-on exercises available at http://www.grycap.upv.es/slepc/handson
After that you should be able to compute the following:
The source code is available on abisko. The following command will create a directory with the files:
tar xzf ~mr/Public/HPCII/ass2.tgz
The matrices needed can be found in