[petsc-users] Unequal sparse matrix row distribution for MPI MatMult

Barry Smith bsmith at mcs.anl.gov
Sun Mar 22 17:58:40 CDT 2015


  Steena,

   I am a little unsure of your question.  

   1) you can create a MPIBAIJ matrix with any distribution of block rows per process you want, just set the local row size for each process to be what you like.  Use MatCreateVecs() to get correspondingly laid out vectors.

   or 2) if you have a MPIBAIJ matrix with "equal" row layout and you want a new one with uneven row layout you can simply use MatGetSubMatrix() to create that new matrix.

  Barry

Unless you have another reason to have the matrix with an equal number row layout I would just generate the matrix with the layout you want.


> On Mar 22, 2015, at 5:50 PM, Steena M <stm8086 at yahoo.com> wrote:
> 
> Hello, 
> 
> I need to distribute a sparse matrix such that each proc owns an unequal number of blocked rows before I proceed with MPI MatMult. My initial thoughts on doing this:
> 
> 1) Use  MatGetSubMatrices() on the test MATMPIBAIJ matrix to produce a new matrix where each proc has an unequal number of rows.
> 
> 2) Provide scatter context for vector X (for MatMult )using IS iscol from MatGetSubMatrices() while creating the vector X.
> 
> 3) Call MatMult()
> 
> Will MatMult_MPIBAIJ continue to scatter this matrix and vector such that each proc will own an equal number of matrix rows and corresponding diagonal vector elements? Should I write my own MPIMatMult function to retain my redistribution of the matrix and vector?
> 
> Thanks in advance,
> Steena



More information about the petsc-users mailing list