<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 16, 2019 at 6:28 PM William Coirier via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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">Ok, got it. My misinterpretation was how to fill the d_nnz and o_nnz arrays. <br>
<br>
Thank you for your help!<br>
<br>
Might I make a suggestion related to the documentation? Perhaps I have not fully read the page on the MatMPIBAIJSetPreallocation so you can simply disregard and I'm ok with that! The documentation has for the d_nnz:<br>
<br>
d_nnz - array containing the number of block nonzeros in the various block rows of the in diagonal portion of the local (possibly different for each block row) or NULL. If you plan to factor the matrix you must leave room for the diagonal entry and set it even if it is zero. <br>
<br>
Am I correct in that this array should be of size numRows, where numRows is found from calling MatGetOwnershipRange(J,&iLow,&iHigh) so numRows=iHigh-iLow.<br></blockquote><div><br></div><div>yes, this interface does not change if you set the block size or not. It is at the equation level.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I think my error was allocating this only to be numRows/bs since I thought it's a block size thing.<br><br></blockquote><div><br></div><div>This documentation looks wrong to me, and at least confusing. "number of block nonzeros" reads wrong to me. We now have:</div><div></div><br>d_nz- number of block nonzeros per block row in diagonal portion of local submatrix (same for all local rows)<br>d_nnz- array containing the number of block nonzeros in the various block rows of the in diagonal portion of the local (possibly different for each block row) or NULL. If you plan to factor the matrix you must leave room for the diagonal entry and set it even if it is zero.<br>o_nz- number of block nonzeros per block row in the off-diagonal portion of local submatrix (same for all local rows).<br>o_nnz- array containing the number of nonzeros in the various block rows of the off-diagonal portion of the local submatrix (possibly different for each block row) or NULL.</div><div class="gmail_quote"><br></div><div class="gmail_quote">I can suggest:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">d_nz- number of nonzeros per row in diagonal portion of local submatrix (same for all local rows)<br>d_nnz- array containing the number of nonzeros in each row of the diagonal portion of the local matrix (the same for each row within a block) or NULL. You must have a diagonal entry and set it even if it is zero if you plan to factor the matrix.<br>o_nz- number of nonzeros per row in the off-diagonal portion of local submatrix (same for all local rows).<br>o_nnz- array containing the number of nonzeros in each row of the off-diagonal portion of the local submatrix (the same for each row within a block) or NULL.</div><br class="gmail-Apple-interchange-newline"></div><div class="gmail_quote">I can change this if this is acceptable.</div><div class="gmail_quote"><br><div><br></div><div><br></div></div></div>