[petsc-users] Suggestions for single process setup code

Jasper Hatton jasper.hatton at mail.utoronto.ca
Thu Aug 21 14:42:20 CDT 2025


Hi,

I am looking for advice on using PETSc in a situation where I don't want the initial setup part of my application to run on multiple processes. The solution stage is taking up most of the time, so I would like to avoid making the setup stage a fully parallel code for now.

My solution stage takes a shell matrix, which includes an FFT as well as multiple sparse mat-vec products. So I was planning to use the rank zero process to setup the distributed FFT and put values into the distributed matrices, then execute KSPSolve on all ranks.

However, I see there is also the MPI linear solver server option. It seems mostly useful for cases where the input to KSPSolve is a sparse/dense matrix rather than a shell code. Is it something I should consider for my case?

This is meant to be an first step which can at least run well on a 2-socket node with many cores available, and eventually could be made a fully distributed code in the future.

Any advice would be apreciated!

Thanks,

Jasper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250821/95fe4d8f/attachment.html>


More information about the petsc-users mailing list