GridapPETSc.jl icon indicating copy to clipboard operation
GridapPETSc.jl copied to clipboard

Efficiency of the Garbage Collection

Open JordiManyer opened this issue 2 years ago • 1 comments

Hello all,

@amartinhuertas and me have been working on a Geometric MultiGrid solver/preconditioner for Gridap. To solve the coarsest-level linear system in parallel, we decided to use MUMPS through a PETScLinearSolver from GridapPETSc.

While profiling the resulting algorithm for a Poisson problem, where we use a preconditioned Conjugate Gradient solver with our GMG preconditioner, we find that a weirdly high amount of time is spent in the method gridap_petsc_gc(), which is called from within solve!() at every iteration of the conjugate gradient.

Due to this, we think it could be advantageous to introduce a new flag/kwarg/setting that deactivates all these automatic calls to the GC that are scattered around the code. The idea is to give an advanced user/developer the ability to manually call the GC optimally depending on the application.

Thanks!

JordiManyer avatar Jan 11 '23 11:01 JordiManyer

Thanks for reporting @JordiManyer ! Could you confirm if removing the call to gridap_petsc_gc() the hot spot/bottleneck disappears/is atenuated?

amartinhuertas avatar Jan 11 '23 12:01 amartinhuertas