[petsc-users] Copy data from MATMPIAIJ to MATSEQDENSE

Thomas Witkowski Thomas.Witkowski at tu-dresden.de
Tue Nov 22 03:51:19 CST 2011


Zitat von Thomas Witkowski <Thomas.Witkowski at tu-dresden.de>:

> Whats the best way to copy data from a MATMPIAIJ to a local
> MATSEQDENSE? The problem with MatGetSubMatrix seems to be that both
> matrices must have the same communicator. But the MATMPIAIJ has, say,
> PETSC_COMM_WORLD, but the MATSEQDENSE has PETSC_COMM_SELF. If it is
> simpler to extract subvectors from MATMPIAIJ to VECSEQ, this would to
> the same for me.

I would a solution by myself: I call MatGetRow on each rank and than  
use the values to
put them into the dense local matrix.

Thomas


More information about the petsc-users mailing list