<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>  Oh, sorry, it is unusable for MPI AIJ matrixes. We would need a special little additional code for MPIAIJ also to get it to work.<div class=""><br class=""></div><div class="">  Since your matrices were so tiny I just assumed their usage was sequential.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">  For MPI there would need to be a new </div><div class=""><br class=""></div><div class="">   MatMPIAIJSetTotalPreallocation(A, PetscInt d, PetscInt o) that would call the new MatSeqAIJSetTotalPreallocation() on each part of the MPI matrix and a new</div><div class=""><br class=""></div><div class="">   MatSetValues_MPIAIJ_xxx() that found for each row the parts you past in for diagonal part and off diagonal part, mapped the indices appropriately and call the MatSetValues() one each for the two submatrices appropriately. This would mean packing the two off diagonal parts in the input row data structure together for the call to MatSetValues() on the off-diagonal part. Kind of annoying; instead one could add support to the special MatSetValues_SeqIAIJ_xxx() function to allow it to be called multiple times for each row so long as the each new part came after the previous in column index.</div><div class=""><br class=""></div><div class="">Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 22, 2020, at 5:47 PM, Sajid Ali <<a href="mailto:sajidsyed2021@u.northwestern.edu" class="">sajidsyed2021@u.northwestern.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">
<div class="">Hi Barry, <br class=""></div><div class=""><br class=""></div><div class="">Thanks for creating the new function. I'm somewhat confused as to how I'd use it. Given an MPIAIJ matrix, is one supposed to extract the local SeqAIJ matrix and set the preallocation on each mpi-rank independently followed by MatSetValues (on the MPIAIJ matrix) to fill the rows? Or, does one create SeqAIJ matrices on each rank and then combine them into a parallel MPIAIJ matrix say by using MatCreateMPIMatConcatenateSeqMat?<br class=""><br class=""></div><div class="">I tried the second approach but leaving the "number of local columns" for 
MatCreateMPIMatConcatenateSeqMat as PETSC_DECIDE causes a crash (when running with 1 mpi rank). Is this the correct approach to take and if yes what does "number of local columns" mean when combining the seqaij matrices ?<br class=""></div><div class=""><br class=""></div><div class=""><div class="">Thank You,<br class=""></div><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div style="font-size:12.8px" class="">Sajid Ali | PhD Candidate<br class=""></div><div style="font-size:12.8px" class="">Applied Physics<br class=""></div><div style="font-size:12.8px" class="">Northwestern University</div><div style="font-size:12.8px" class=""><a href="http://s-sajid-ali.github.io/" target="_blank" class="">s-sajid-ali.github.io</a></div></div></div></div></div></div></div></div></div>

</div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>