On Fri, Apr 16, 2021 at 9:46 AM Ivano Barletta <[email protected]> wrote:
> Dear all, > > I have an MPI FEM application with an elliptic problem that I > solve with PETSc. For debugging purposes I want to > let the master process to solve the global system. > > Is there any simple way in PETSc to gather the distributed matrix > (the type is MATMPIAIJ) on a single MPI process? > You could use https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateSubMatrices.html to extract a single, serial matrix on process 0. However, you can do this with the solver automatically using https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCTELESCOPE.html If you have the memory, you can do this more simply with https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCREDUNDANT.html Thanks, Matt > Thanks, > Ivano > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
