Hi all, I want to solve a linear system using gamg and time the setup and solve phases. I have tried PetscLogDefaultBegin(). It prints many timings including KSPSetUp and KSPSolve. Is it accurate to only report these two timings for the setup and solve phases? Thanks, Majid.
You can use -log_view and not change your code instead of adding this (this is the first time I have seen PetscLogDefaultBegin). The default PETSc timers will give you data on parts of the GAMG setup. (look for "GAMG" and PAPt). There is also a line in the log data for KSPSetup. This is mostly GAMG setup. The tricky part is getting the solve time without the setup. You can call KSPSetup(ksp) to get pure solve times in the KSPSolve line. The next step, if you like, is to create a timer (PetscLogEventRegister) and then Begin and End that event around a KSPSetup, or PCSetup, call to get a line in the log data with what you want, but that should be the same as what is measured by PETSc. On Sat, Apr 10, 2021 at 1:31 AM Majid Rasouli <[email protected]> wrote:
Hi all,
I want to solve a linear system using gamg and time the setup and solve phases. I have tried PetscLogDefaultBegin(). It prints many timings including KSPSetUp and KSPSolve. Is it accurate to only report these two timings for the setup and solve phases?
Thanks, Majid.
participants (2)
-
Majid Rasouli -
Mark Adams