<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> No, it uses the exact layout you provided. <div><br></div><div> You can use <a href="https://petsc.org/release/manualpages/PC/PCREDISTRIBUTE/#pcredistribute">https://petsc.org/release/manualpages/PC/PCREDISTRIBUTE/#pcredistribute</a> to have the solver redistribute the rows to have an equal number per MPI process during the solve process, which will give you the effect you are looking for.</div><div><br></div><div> Barry</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Feb 8, 2024, at 4:07 AM, Maruthi NH <maruthinh@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>Hi Barry, <br></div><div>Thanks. Yes, the global column index was wrong. I have one more question regarding
MatCreateMPIAIJWithArrays. If I have 100 elements in rank 0 and 50 in rank 1, does PETSc redistribute equally among procs before solving? <br></div><div><br></div><div>Regards,</div><div>Maruthi <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 5, 2024 at 2:18 AM 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>
Is each rank trying to create its own sequential matrix with MatCreateSeqAIJWithArrays() or did you mean MatCreateMPIAIJWithArrays()?<br>
<br>
If the latter, then possibly one of your size arguments is wrong or the indices are incorrect for the given sizes.<br>
<br>
Barry<br>
<br>
<br>
> On Feb 4, 2024, at 3:15 PM, Maruthi NH <<a href="mailto:maruthinh@gmail.com" target="_blank">maruthinh@gmail.com</a>> wrote:<br>
> <br>
> Hi all,<br>
> <br>
> I have a row, col, and A values in CSR format; let's say rank 0 has 200 unknowns and rank 1 has 100 unknowns. If I use MatCreateSeqAIJWithArrays to create a Matrix, it crashes. However, if each rank has an equal number of unknowns, it works fine. Please let me know how to proceed<br>
> <br>
> <br>
> Regards,<br>
> Maruthi<br>
<br>
</blockquote></div>
</div></blockquote></div><br></div></body></html>