<div dir="ltr"><div dir="ltr">On Mon, Jan 11, 2021 at 3:00 PM Sam Guo <<a href="mailto:sam.guo@cd-adapco.com">sam.guo@cd-adapco.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear PETSc Dev Team,<div> The documentation recommends calling
both of the above preallocation routines for simplicity. Do we waste memory by calling both?</div></div></blockquote><div><br></div><div>No. Only one will function, depending on the matrix type.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</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"><div dir="ltr"><div>Thanks,</div><div>Sam</div><div><a name="m_-2499245619606312561_MATAIJ" style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><h1>MATAIJ</h1></a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"></span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATAIJ.html#MATAIJ" style="font-family:"Times New Roman";font-size:medium" target="_blank">MATAIJ</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> = "aij" - A matrix type to be used for sparse matrices. This matrix type is identical to </span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSEQAIJ.html#MATSEQAIJ" style="font-family:"Times New Roman";font-size:medium" target="_blank">MATSEQAIJ</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> when constructed with a single process communicator, and </span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATMPIAIJ.html#MATMPIAIJ" style="font-family:"Times New Roman";font-size:medium" target="_blank">MATMPIAIJ</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> otherwise. As a result, for single process communicators, </span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html#MatSeqAIJSetPreallocation" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatSeqAIJSetPreallocation</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> is supported, and similarly </span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html#MatMPIAIJSetPreallocation" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatMPIAIJSetPreallocation</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">() is supported for communicators controlling multiple processes. It is recommended that you call both of the above preallocation routines for simplicity.</span> <br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>