<div dir="ltr"><div><div>Hi all,<br><br></div>I wish to extract a parallel AIJ submatrix (B) from another parallel AIJ matrix (A), in particular, if I have an NxN matrix, I wish to extract the first N-1 rows and N-1 columns of A.<br>
<br></div>I can do this perfectly fine when running my code sequentially using ISCreateStride and MatGetSubMatrix like so:<br><span style="font-family:verdana,sans-serif">ISCreateStride(PETSC_COMM_WORLD,N,1,1,&is);</span><br>
<span style="font-family:verdana,sans-serif">MatGetSubMatrix(A,is,is,MAT_INITIAL_MATRIX,&B);<br></span><div><br></div><div>And it behaves as I would expect, but when running in parallel, the B matrix increases past it's allocated size of N-1xN-1. I've pasted the example of a simple example output below:<br>
<br><br>ORIGINAL SEQUENTIAL MATRIX<br>row 0: (0, 1) (1, 2) (2, 3) (3, 4)<br>row 1: (0, 1) (1, 2) (2, 3) (3, 4)<br>row 2: (0, 1) (1, 2) (2, 3) (3, 4)<br>row 3: (0, 1) (1, 2) (2, 3) (3, 4)<br>SEQUENTIAL SUBMATRIX<br>
row 0: (0, 1) (1, 2) (2, 3)<br>row 1: (0, 1) (1, 2) (2, 3)<br>row 2: (0, 1) (1, 2) (2, 3)<br><br><br>ORIGINAL PARALLEL MATRIX<br>row 0: (0, 1) (1, 2) (2, 3) (3, 4)<br>row 1: (0, 1) (1, 2) (2, 3) (3, 4)<br>row 2: (0, 1) (1, 2) (2, 3) (3, 4)<br>
row 3: (0, 1) (1, 2) (2, 3) (3, 4)<br></div><div>PARALLEL "SUBMATRIX"<br></div><div>row 0: (3, 1) (4, 2) (5, 3)<br>row 1: (3, 1) (4, 2) (5, 3)<br>row 2: (3, 1) (4, 2) (5, 3)<br>row 3: (3, 1) (4, 2) (5, 3)<br>
row 4: (3, 1) (4, 2) (5, 3)<br>row 5: (3, 1) (4, 2) (5, 3)<br><br><br></div><div>I'm not really sure what is going on with the index set, and I would really appreciate some help.<br><br><br></div><div>Thanks,<br>Arthur<br>
</div><div><br></div></div>