<div dir="ltr">Interestingly enough, I just reviewed a paper (that will be presented at an SC15 workshop) that demonstrated one can detect (potentially with false positives) such issues using static analysis (in Clang).<div><div><div><br></div><div>Jeff</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 2:33 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Done<br>
<div class="HOEnZb"><div class="h5"><br>
> On Oct 21, 2015, at 8:06 AM, Eric Chamberland <<a href="mailto:Eric.Chamberland@giref.ulaval.ca">Eric.Chamberland@giref.ulaval.ca</a>> wrote:<br>
><br>
> Hi Barry,<br>
><br>
> if I may suggest, is it possible to have this test case added as a nightly test since, I don't know but... a matrix with no local lines may be something not widely tested...???<br>
><br>
> Thanks!<br>
><br>
> Eric<br>
><br>
> On 20/10/15 10:47 PM, Barry Smith wrote:<br>
>><br>
>>   Eric,<br>
>><br>
>>    Thanks for the test case. I have determined the problem, it is a nasty bug caused by overly convoluted code.<br>
>><br>
>> The MatSeqAIJSetPreallocation() is there because if the matrix had been assembled but had no values in it the MatShift_Basic() took forever since<br>
>> a new malloc needed to be done for each local row. The problem is that MatSeqAIJSetPreallocation changed the value of the aij->nonew flag of that sequential object, BUT MatAssemblyEnd_MPIA() assumed that the value of this flag was identical on all processes. In your case since aij->nz = 0 on your matrix with no local rows the value of nonew was changed on one process but not on others triggering disaster in the MatAssemblyEnd_MPIA().<br>
>><br>
>> This is now fixed in the maint, master and next branches and will be in the next patch release. I have also attached the patch to this email.<br>
>><br>
>>   Barry<br>
>><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div>