<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Jan 2019, at 6:26 AM, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">We should repair the MPI matrix implementations so that this works on communicators of size 1</span></div></blockquote><div><br class=""></div>Great, I was worried that I missed somewhere that it is explicitly stated that you should not use MPI types on communicators of size 1.</div><div><br class=""><blockquote type="cite" class=""><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> but why can't you use MatXAIJSetPreallocation().</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>OK, replace my if then else by if(comm_size == 1) VecCreateSeqWithArray else VecCreateMPIWithArray</div><div>There is also no MatXBAIJSetPreallocationCSR or MatXDenseSetPreallocation, so that's other if then elses.</div><div><br class=""></div><div>Or am I missing something?</div><div><br class=""></div><div>Thanks,</div><div>Pierre</div><br class=""><blockquote type="cite" class=""><div class=""><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatXAIJSetPreallocation.html" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatXAIJSetPreallocation.html</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Pierre Jolivet via petsc-dev <</span><a href="mailto:petsc-dev@mcs.anl.gov" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">petsc-dev@mcs.anl.gov</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">> writes:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Cf. the end of my sentence: "(I know, I could switch to SeqAIJ_SeqDense, but that is not an option I have right now)”<br class="">All my Mat are of type MATMPIX. Switching to MATX here as you suggested would mean that I need to add a bunch of if(comm_size == 1) MatSeqXSetPreallocation else MatMPIXSetPreallocation in the rest of my code, which is something I would rather avoid.<br class=""><br class="">Thanks,<br class="">Pierre<br class=""><br class=""><blockquote type="cite" class="">On 14 Jan 2019, at 10:30 PM, Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>> wrote:<br class=""><br class="">Replace<span class="Apple-converted-space"> </span><br class="">ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr);<br class="">to<br class="">ierr = MatSetType(A, MATAIJ);CHKERRQ(ierr);<br class=""><br class="">Replace<span class="Apple-converted-space"> </span><br class="">ierr = MatSetType(B, MATMPIDENSE)i;CHKERRQ(ierr);<br class="">to<br class="">ierr = MatSetType(B, MATDENSE)i;CHKERRQ(ierr);<br class=""><br class="">Then add<br class="">MatSeqAIJSetPreallocation()<br class="">MatSeqDenseSetPreallocation()<br class=""><br class="">Hong<br class=""><br class="">On Mon, Jan 14, 2019 at 2:51 PM Pierre Jolivet via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a><span class="Apple-converted-space"> </span><<a href="mailto:petsc-dev@mcs.anl.gov" class="">mailto:petsc-dev@mcs.anl.gov</a>>> wrote:<br class="">Hello,<br class="">Is there any chance to get MatMatMult_MPIAIJ_MPIDense  and MatTransposeMatMult_MPIAIJ_MPIDense fixed so that the attached program could run _with a single_ process? (I know, I could switch to SeqAIJ_SeqDense, but that is not an option I have right now)<br class=""><br class="">Thanks in advance,<br class="">Pierre</blockquote></blockquote></div></blockquote></div><br class=""></body></html>