[petsc-users] MatGetSubMatrices error

Joshua Booth jdbst21 at gmail.com
Thu Mar 3 11:01:58 CST 2011


>
>
>
Hello,

I am running a job on two processors and a matmpiaij. I want to set a
submatrix of this on the one processor (rank==1).

So I made

Mat *localB;
If(rank==1)
{
  IS irow;
      IS icol;
      ISCreateGeneral(PETSC_COMM_SELF, end_pos-start_pos+1, order_array,
&irow);
      ISCreateGeneral(PETSC_COMM_SELF, end_pos-start_pos+1, order_array,
&icol);
      MatGetSubMatrices(A, 1, &irow, &icol, MAT_INITIAL_MATRIX, &localB);
}
else
 {
      IS irow;
      IS icol;
      ISCreateStride(PETSC_COMM_SELF, 0, 0, 1, &irow);
      ISCreateStride(PETSC_COMM_SELF, 0, 0, 1, &icol);
      MatGetSubMatrices(A,0,&irow,&icol,MAT_INITIAL_MATRIX,&localB);

   }
However, I get a segmentation violation from MatGetSubMatrices_MPIAIJ_Local
on rank=0 when I track back with gdb.
I have already use MatGetSubMatrices on all cores than destroy.

Joshua Booth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110303/38401ca6/attachment.htm>


More information about the petsc-users mailing list