[petsc-users] Copy data from MATMPIAIJ to MATSEQDENSE

Barry Smith bsmith at mcs.anl.gov
Tue Nov 22 07:44:51 CST 2011


On Nov 22, 2011, at 3:51 AM, Thomas Witkowski wrote:

> 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.
> 
    Why not MatConvert() or MatGetSubMatrices()?

    Why convert a parallel matrix to sequential?


   Barry

  
> Thomas



More information about the petsc-users mailing list