<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Marius:</div><div class="gmail_quote">Current PETSc interface supports sequential sparse <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">multiple right-hand side, but not distributed.</span></div><div class="gmail_quote">It turns out that mumps does not support <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">distributed sparse multiple right-hand sides at</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">the moment (see attached email). </span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Jean-Yves invites you to communicate with him directly. </span><br></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Let me know what we can help on this matter, </span></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">e.g., add support for parallel implementation of <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">sparse </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline">multiple right-hand side with </span></span></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline">centralized rhs input?</span></span></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline"><br></span></span></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hong</span></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">----------------------</span></div><div class="gmail_quote"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div class="gmail-gE gmail-iv gmail-gt" style="padding:10px 0px 3px;font-size:12.8px;color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><table cellpadding="0" class="gmail-cf gmail-gJ" style="border-collapse:collapse;margin-top:0px;width:auto"><tbody><tr class="gmail-acZ" style="height:16px"><td class="gmail-gF gmail-gK" style="font-family:arial,sans-serif;margin:0px;text-align:left;white-space:nowrap;padding-right:8px;vertical-align:top;width:270.667px;padding-top:0px"><table cellpadding="0" class="gmail-cf gmail-ix" style="border-collapse:collapse;table-layout:fixed;width:270.667px"><tbody><tr><td style="font-family:arial,sans-serif;margin:0px"><h3 class="gmail-iw" style="overflow:hidden;white-space:nowrap;max-width:92%;display:inline-block;font-size:inherit;font-weight:inherit;margin:inherit"><span name="Jean-Yves LExcellent" class="gmail-gD" style="color:rgb(34,34,34);font-size:12.8px;font-weight:bold;white-space:nowrap;display:inline;vertical-align:top">Jean-Yves LExcellent</span><span> </span><span class="gmail-go" style="vertical-align:top;color:rgb(85,85,85)"><span><</span><a href="mailto:Jean-Yves.L.Excellent@ens-lyon.fr">Jean-Yves.L.Excellent@ens-lyon.fr</a><span>></span></span></h3></td></tr></tbody></table></td><td class="gmail-gH gmail-bAk" style="font-family:arial,sans-serif;margin:0px;text-align:right;white-space:nowrap;vertical-align:top;color:rgb(34,34,34)"><div class="gmail-gK" style="padding-top:0px;padding-right:2px"><span></span><span id="gmail-:pm" class="gmail-g3" title="Fri, Jun 1, 2018 at 5:14 AM" alt="Fri, Jun 1, 2018 at 5:14 AM" style="vertical-align:top;margin-right:3px">5:14 AM (3 hours ago)</span><div class="gmail-zd gmail-bi4" title="Not starred" tabindex="0" style="display:inline-block;height:20px;outline:0px"><span class="gmail-T-KT" style="display:inline-block;height:19px;text-align:center;width:19px;padding:2px"><img class="gmail-f gmail-T-KT-JX" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="margin-top: 0px; vertical-align: top;"></span></div></div></td><td class="gmail-gH" style="font-family:arial,sans-serif;margin:0px;text-align:right;white-space:nowrap;vertical-align:top;color:rgb(34,34,34)"></td><td class="gmail-gH gmail-acX gmail-bAm" rowspan="2" style="font-family:arial,sans-serif;margin:0px;text-align:right;white-space:nowrap;vertical-align:top;color:rgb(34,34,34)"><div class="gmail-T-I gmail-J-J5-Ji gmail-T-I-Js-IF gmail-aaq gmail-T-I-ax7 gmail-L3" tabindex="0" style="display:inline-block;border-radius:2px 0px 0px 2px;font-size:11px;font-weight:bold;text-align:center;white-space:nowrap;margin-right:0px;height:27px;line-height:27px;min-width:32px;outline:0px;padding:0px 8px;background-color:rgb(245,245,245);color:rgb(68,68,68);border:1px solid rgba(0,0,0,0.1)"><img class="gmail-hB gmail-T-I-J3" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="background: url("https://ssl.gstatic.com/mail/sprites/general_2x-8f803f655d38e38581ce96b4bca05016.png") 0px -377px / 24px 882px no-repeat; height: 21px; vertical-align: middle; width: 21px; opacity: 0.55;"></div><div id="gmail-:px" class="gmail-T-I gmail-J-J5-Ji gmail-T-I-Js-Gs gmail-aap gmail-T-I-awG gmail-T-I-ax7 gmail-L3" tabindex="0" style="display:inline-block;border-radius:0px 2px 2px 0px;font-size:11px;font-weight:bold;text-align:center;white-space:nowrap;margin-right:0px;height:27px;line-height:27px;min-width:21px;outline:0px;padding:0px;background-color:rgb(245,245,245);color:rgb(68,68,68);border:1px solid rgba(0,0,0,0.1)"><img class="gmail-hA gmail-T-I-J3" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="background: url("https://ssl.gstatic.com/mail/sprites/general_2x-8f803f655d38e38581ce96b4bca05016.png") 0px -262px / 24px 882px no-repeat; height: 21px; width: 21px; vertical-align: middle; opacity: 0.55;"></div></td></tr><tr class="gmail-acZ gmail-xD" style="height:16px"><td colspan="3" style="font-family:arial,sans-serif;margin:0px"><table cellpadding="0" class="gmail-cf gmail-adz" style="border-collapse:collapse;table-layout:fixed;white-space:nowrap;width:434.667px"><tbody><tr><td class="gmail-ady" style="font-family:arial,sans-serif;margin:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"><div class="gmail-iw gmail-ajw" style="overflow:hidden;white-space:nowrap;max-width:92%;display:inline-block"><span class="gmail-hb" style="vertical-align:top;color:rgb(119,119,119)">to<span> </span><span dir="ltr" name="Hong" class="gmail-g2">Hong</span>,<span> </span><span dir="ltr" name="mumps-dev" class="gmail-g2">mumps-dev</span></span></div><div class="gmail-ajy" tabindex="0" style="display:inline-block;margin-left:5px;vertical-align:top"><img class="gmail-ajz" id="gmail-:pw" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="background: url("//ssl.gstatic.com/ui/v1/icons/mail/skinnable/skinnable_ltr_light_1x.png") -60px -100px no-repeat; cursor: pointer; padding: 0px 0px 1px; vertical-align: bottom; height: 12px; width: 12px;"></div></td></tr></tbody></table></td></tr></tbody></table></div><div id="gmail-:pi" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div class="gmail-qQVYZb"></div><div class="gmail-utdU2e"></div><div class="gmail-btm"></div></div><div class="gmail-" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div class="gmail-aHl" style=""></div><div id="gmail-:pv" tabindex="-1" class="gmail-ajV" style="outline:none;padding:5px 0px;width:22px;margin:0px"><div id="gmail-:qe" class="gmail-ajR" tabindex="0" style="background-color:rgb(241,241,241);border:1px solid rgb(221,221,221);clear:both;line-height:6px;outline:none;width:20px"><img class="gmail-ajT" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="background: url("//ssl.gstatic.com/ui/v1/icons/mail/ellipsis.png") no-repeat; height: 8px; opacity: 0.3; width: 20px;"></div></div><div id="gmail-:pk" class="gmail-ii gmail-gt gmail-adP" style="font-size:12.8px;direction:ltr;margin:5px 15px 0px 0px;padding-bottom:5px"><div id="gmail-:pj" class="gmail-a3s gmail-aXjCH gmail-m163bad8b399eea70" style="overflow:hidden">Hello,<br><br>We do not support distributed sparse multiple right-hand sides at<br>the moment. From the feedback we have from applications, the<br>right-hand sides are often very sparse, and having them distributed<br>did not seem critical.<br><br>Since we are specifying a distributed right-hand sides feature at the<br>moment, could you let us know in more detail the need regarding<br>distributed sparse right-hand side (e.g., do all columns have the same<br>nonzero structure in that case) or put us in contact with the user who<br>needs this?<br><br>Thanks,<br>Jean-Yves and Patrick</div></div></div><br></span></div><div class="gmail_quote"><span style="font-size:12.8px"><br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks a lot guys, very helpful.<br>
<span class=""> <br>
<br>
<br>
<br>
I see MUMPS <a href="http://mumps.enseeiht.fr/" rel="noreferrer" target="_blank">http://mumps.enseeiht.<wbr>fr/</a><br>
<br>
</span>Sparse multiple right-hand side, distributed solution; Exploitation of sparsity in the right-hand sidesPETSc interface computes mumps distributed solution as default (this is not new) (ICNTL(21) = 1)<br>
<span class=""> <br>
I will add support for Sparse multiple right-hand side.<br>
<br>
Hong<br>
<br>
</span><span class="">On Thu, May 31, 2018 at 11:25 AM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>[mailto:<a href="mailto:bsmith@mcs.anl.gov">bsm<wbr>ith@mcs.anl.gov</a>]> wrote:<br>
Hong,<br>
<br>
Can you see about adding support for distributed right hand side?<br>
<br>
Thanks<br>
<br>
Barry<br>
<br>
</span><span class="">> On May 31, 2018, at 2:37 AM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>[mailto:<a href="mailto:mbuerkle@web.de">mbuerk<wbr>le@web.de</a>]> wrote:<br>
><br>
> The fix for MAT_NEW_NONZERO_LOCATIONS, thanks again.<br>
><br>
> I have yet another question, sorry. The recent version of MUMPS supports distributed and sparse RHS is there any chance that this will be supported in PETSc in the near future?<br>
><br>
> <br>
> <br>
><br>
</span><span class="">>> On May 30, 2018, at 6:55 PM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>[mailto:<a href="mailto:mbuerkle@web.de">mbuerk<wbr>le@web.de</a>]> wrote:<br>
>><br>
>> Thanks for the quick fix, I will test it and report back.<br>
>> I have another maybe related question, if MAT_NEW_NONZERO_LOCATIONS is true and let's say 1 new nonzero position is created it does not allocated 1 but several new nonzeros but only use 1.<br>
><br>
> Correct<br>
><br>
>> I think that is normal, right?<br>
><br>
> Yes<br>
><br>
>> But, at least as far as I understand the manual, a subsequent call of mat assemble with<br>
>> MAT_FINAL_ASSEMBLY should compress out the unused allocations and release the memory, is this correct?<br>
><br>
> It "compresses it out" (by shifting all the nonzero entries to the beginning of the internal i, j, and a arrays), but does NOT release any memory. Since the values are stored in one big contiguous array (obtained with a single malloc) it cannot just free part of the array, so the extra locations just sit harmlessly at the end if the array unused.<br>
><br>
>> If so, this did not work for me, even after doing<br>
>> MAT_FINAL_ASSEMBLY the unused nonzero allocations remain. Is this normal?<br>
><br>
> Yes,<br>
><br>
> Barry<br>
><br>
>><br>
>>><br>
>>> Fixed in the branch barry/fix-mat-new-nonzero-<wbr>locations/maint<br>
>>><br>
>>> Once this passes testing it will go into the maint branch and then the next patch release but you can use it now in the branch barry/fix-mat-new-nonzero-<wbr>locations/maint<br>
>>><br>
>>> Thanks for the report and reproducible example<br>
>>><br>
>>> Barry<br>
>>><br>
>>><br>
</span><div><div class="h5">>>>> On May 29, 2018, at 7:51 PM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>[mailto:<a href="mailto:mbuerkle@web.de">mbuerk<wbr>le@web.de</a>]> wrote:<br>
>>>><br>
>>>> Sure, I made a small reproducer, it is Fortran though I hope that is ok. If MAT_NEW_NONZERO_LOCATIONS is set to false I get an error, if it is set to true the new nonzero element is inserted, if MAT_NEW_NONZERO_LOCATIONS is false and either MAT_NEW_NONZERO_LOCATION_ERR or MAT_NEW_NONZERO_ALLOCATION_ERR is set to false afterwards then the new nonzero is also created without an error, but if MAT_NEW_NONZERO_LOCATIONS is set to false after MAT_NEW_NONZERO_LOCATION_ERR/<wbr>MAT_NEW_NONZERO_ALLOCATION_ERR have been set to false I get an error again.<br>
>>>><br>
>>>><br>
>>>> program newnonzero<br>
>>>> #include <petsc/finclude/petscmat.h><br>
>>>> use petscmat<br>
>>>> implicit none<br>
>>>><br>
>>>> Mat :: A<br>
>>>> PetscInt :: dnnz,onnz,n,m,idxm(1),idxn(1),<wbr>nl1,nl2<br>
>>>> PetscScalar :: v(1)<br>
>>>> PetscReal :: info(MAT_INFO_SIZE)<br>
>>>> PetscErrorCode :: ierr<br>
>>>><br>
>>>> integer :: nproc,iproc,i<br>
>>>><br>
>>>> call PetscInitialize(PETSC_NULL_<wbr>CHARACTER,ierr)<br>
>>>><br>
>>>> call MPI_COMM_SIZE(PETSC_COMM_<wbr>WORLD, nproc,ierr)<br>
>>>><br>
>>>> call MPI_Comm_rank( PETSC_COMM_WORLD, iproc, ierr )<br>
>>>><br>
>>>> n=3<br>
>>>> m=n<br>
>>>> call MatCreateAIJ(PETSC_COMM_WORLD,<wbr>PETSC_DECIDE,PETSC_DECIDE,n,m,<wbr>1,PETSC_NULL_INTEGER,0,PETSC_<wbr>NULL_INTEGER,A,ierr)<br>
>>>><br>
>>>><br>
>>>> call MatGetOwnershipRange(A,nl1,<wbr>nl2,ierr)<br>
>>>> do i=nl1,nl2-1<br>
>>>> idxn(1)=i<br>
>>>> idxm(1)=i<br>
>>>> v(1)=1d0<br>
>>>> call MatSetValues(A,1,idxn,1,idxm, v,INSERT_VALUES,ierr)<br>
>>>> end do<br>
>>>> call MatAssemblyBegin(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> call MatAssemblyEnd(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>><br>
>>>> call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATIONS,PETSC_FALSE,<wbr>ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATION_ERR,PETSC_<wbr>FALSE,ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_ALLOCATION_ERR ,PETSC_FALSE,ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATIONS,PETSC_FALSE,<wbr>ierr)<br>
>>>><br>
>>>><br>
>>>> idxn(1)=0<br>
>>>> idxm(1)=n-1<br>
>>>> if ((idxn(1).ge.nl1).and.(idxn(1)<wbr>.le.nl2-1)) then<br>
>>>> v(1)=2d0<br>
>>>> call MatSetValues(A,1,idxn,1,idxm, v,INSERT_VALUES,ierr)<br>
>>>> end if<br>
>>>> call MatAssemblyBegin(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> call MatAssemblyEnd(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>><br>
>>>> if ((idxn(1).ge.nl1).and.(idxn(1)<wbr>.le.nl2-1)) then<br>
>>>> v(1)=2d0<br>
>>>> call MatGetValues(A,1,idxn,1,idxm, v,ierr)<br>
>>>> write(6,*) v<br>
>>>> end if<br>
>>>><br>
>>>> call PetscFinalize(ierr)<br>
>>>><br>
>>>> end program newnonzero<br>
>>>><br>
>>>><br>
>>>><br>
>>>> $ mpiexec.hydra -n 3 ./a.out<br>
>>>> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
>>>> [0]PETSC ERROR: Argument out of range<br>
>>>> [0]PETSC ERROR: Inserting a new nonzero at global row/column (0, 2) into matrix<br>
</div></div>>>>> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html[http://www.mcs.anl.gov/petsc/documentation/faq.html]" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html[http://<wbr>www.mcs.anl.gov/petsc/<wbr>documentation/faq.html]</a> for trouble shooting.<br>
<span class="im HOEnZb">>>>> [0]PETSC ERROR: Petsc Release Version 3.9.2, May, 20, 2018<br>
>>>> [0]PETSC ERROR: ./a.out on a named tono-hpc1 by marius Wed May 30 09:42:40 2018<br>
>>>> [0]PETSC ERROR: Configure options --prefix=/home/marius/prog/<wbr>petsc/3.9.2 --download-elemental=yes --download-metis=yes --download-parmetis=yes --download-mumps=yes --with-scalapack-lib="/home/<wbr>marius/intel/compilers_and_<wbr>libraries_2018.2.199/linux/<wbr>mkl/lib/intel64/libmkl_<wbr>scalapack_lp64.a -Wl,--start-group /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>intel_lp64.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>sequential.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>core.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm -ldl" --FC=mpiifort --CC=mpicc --CXX=mpicxx --with-scalar-type=complex --with-mpi-dir= --with-blaslapack-lib="/home/<wbr>marius/intel/compilers_and_<wbr>libraries_2018.2.199/linux/<wbr>mkl/lib/intel64/libmkl_<wbr>scalapack_lp64.a -Wl,--start-group /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>intel_lp64.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>sequential.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>core.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm -ldl" --with-cxx-dialect=C++11 --download-superlu_dist=yes --download-ptscotch=yes --with-x --with-debugging=1 --download-superlu=yes --with-mkl_cpardiso=1 --with-mkl_pardiso=1 --with-scalapack=1<br>
>>>> [0]PETSC ERROR: #1 MatSetValues_MPIAIJ() line 607 in /home/marius/prog/petsc/petsc-<wbr>3.9.2/src/mat/impls/aij/mpi/<wbr>mpiaij.c<br>
>>>> [0]PETSC ERROR: #2 MatSetValues() line 1312 in /home/marius/prog/petsc/petsc-<wbr>3.9.2/src/mat/interface/<wbr>matrix.c<br>
>>>> (0.000000000000000E+000,0.<wbr>000000000000000E+000)<br>
>>>><br>
>>>><br>
>>>><br>
>>>> Please send complete error message; type of matrix used etc. Ideally code that demonstrates the problem.<br>
>>>><br>
>>>> Barry<br>
>>>><br>
>>>><br>
</span><div class="HOEnZb"><div class="h5">>>>>> On May 29, 2018, at 3:31 AM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>[mailto:<a href="mailto:mbuerkle@web.de">mbuerk<wbr>le@web.de</a>]> wrote:<br>
>>>>><br>
>>>>><br>
>>>>> Hi,<br>
>>>>><br>
>>>>> I tried to set MAT_NEW_NONZERO_LOCATIONS to false, as far as I understood MatSetValues should simply ignore entries which would give rise to new nonzero values not creating a new entry and not cause an error, but I get "[1]PETSC ERROR: Inserting a new nonzero at global row/column". Is this option supposed to work or not?<br>
>>>><br>
>>><br>
>>><br>
> <br>
<br>
</div></div></blockquote></div><br></div></div>