[petsc-dev] Bug in MatShift_MPIAIJ ?

Barry Smith bsmith at mcs.anl.gov
Thu Oct 22 16:33:15 CDT 2015


Done

> On Oct 21, 2015, at 8:06 AM, Eric Chamberland <Eric.Chamberland at giref.ulaval.ca> wrote:
> 
> Hi Barry,
> 
> 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...???
> 
> Thanks!
> 
> Eric
> 
> On 20/10/15 10:47 PM, Barry Smith wrote:
>> 
>>   Eric,
>> 
>>    Thanks for the test case. I have determined the problem, it is a nasty bug caused by overly convoluted code.
>> 
>> The MatSeqAIJSetPreallocation() is there because if the matrix had been assembled but had no values in it the MatShift_Basic() took forever since
>> 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().
>> 
>> 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.
>> 
>>   Barry
>> 
> 




More information about the petsc-dev mailing list