<div dir="ltr"><div>Thank you for your reply, with petsc4py the only error message I get is:</div><div><br>Traceback (most recent call last):<br> File "../../../exhume-fenics-prototype/demos/exhume_poisson.py", line 228, in <module><br> solveKSP(dR_b,R_b,u_p, method=LINEAR_SOLVER, PC=PRECONDITIONER, bfr_tol=bfr_tol_set)<br> File "/home/jennifer/Work/exhume/exhume-fenics-prototype/EXHUME/common.py", line 958, in solveKSP<br> A,b = trimNodes(A,b=b, bfr_tol=bfr_tol)<br> File "/home/jennifer/Work/exhume/exhume-fenics-prototype/EXHUME/common.py", line 314, in trimNodes<br> A.zeroRows(nz_id)<br> File "PETSc/Mat.pyx", line 993, in petsc4py.PETSc.Mat.zeroRows<br>petsc4py.PETSc.Error: error code 63</div><div><br></div><div>When I print out the matrix size and the row IDs I want to zero (for each processor), I get</div><div>((36, 72), (36, 72))<br>[36, 37, 43, 45, 62, 64, 70, 71]<br>((36, 72), (36, 72))<br>[0, 1, 2, 8, 9, 11, 24, 26, 27, 33, 34, 35]</div><div><br></div><div>Is there a way I can get petsc4py to pass me the entire PETSC error message?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 15, 2022 at 3:42 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Yes, this sounds like the intended usage. The only expected reason this would error is if one of the indices is less than 0 or greater than or equal to the number of rows in the entire matrix. In the error message, it should print both the index and the number of rows in the matrix. Can you send the full error message, cut and paste?<br>
<br>
Barry<br>
<br>
<br>
> On Apr 15, 2022, at 5:09 PM, Jennifer Ellen Fromm <<a href="mailto:jefromm@eng.ucsd.edu" target="_blank">jefromm@eng.ucsd.edu</a>> wrote:<br>
> <br>
> Hello,<br>
> I am using petsc4py, and attempting to zero rows of an mpiaij matrix (and set the diagonal to 1). I loop over the owned row indices to identify the rows I want to zero, then attempt to call zeroRows() with the list of owned indices. When I run in parallel (mpirun --np 2) I get petsc4py error 63, 'input argument out of range'. I have tried to adjust several matrix options but nothing has worked. Is this a valid method for trying to zero rows? <br>
> Thanks,<br>
> Jennifer <br>
<br>
</blockquote></div>