[petsc-dev] Bug in MatShift_MPIAIJ ?

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Wed Oct 21 14:09:25 CDT 2015


On 21/10/15 03:02 PM, Barry Smith wrote:
>
>> On Oct 21, 2015, at 1:54 PM, Eric Chamberland <Eric.Chamberland at giref.ulaval.ca> wrote:
>>
>> On 21/10/15 02:21 PM, Barry Smith wrote:
>>>    Thanks. I don't think I need the Icount but. I think I can just generate an error if the FILE and LINE don't match exactly?
>>
>> Barry, I highly recommend you to use the static counter too otherwise you won't catch the following bug:
>>
>> if all processes should call "n" times the same line of code (then the same __LINE__ and __FILE__) but one process do not make the right number of call...
>
>     I don't understand.
>
>     Say one process called it one less time then the rest. Then during the next call to MPI_Allreduce by the rogue process it will have a different LINE and FILE from the others (since they will still be at the previous call site)  and hence the macro will generate an error message since line and file won't match.  What is wrong with my reasoning?

ok, imagine that the rogue process continue... but then the next 
collective call encountered is at the very same line of code... which is 
possible in 2 situations:

#1: the rogue process continue and don't encounter *any* other 
collective call before re-entering the very same function...

#2: the collective call is in a loop!!! (which is in fact a trivial 
situation included in #1)

Eric




More information about the petsc-dev mailing list