[petsc-users] Valgrind Errors

Hong hzhang at mcs.anl.gov
Fri Sep 12 17:28:31 CDT 2014


I'll check it.
Hong

On Fri, Sep 12, 2014 at 3:40 PM, Dominic Meiser <dmeiser at txcorp.com> wrote:
> On 09/12/2014 02:11 PM, Barry Smith wrote:
>>
>>     James (and Hong),
>>
>>      Do you ever see this problem in parallel runs?
>>
>>      You are not doing anything wrong.
>>
>>      Here is what is happening.
>>
>> MatGetBrowsOfAoCols_MPIAIJ() which is used by MatMatMult_MPIAIJ_MPIAIJ()
>> assumes that the VecScatters for the matrix-vector products are
>>
>>    gen_to   = (VecScatter_MPI_General*)ctx->todata;
>>    gen_from = (VecScatter_MPI_General*)ctx->from data;
>>
>> but when run on one process the scatters are not of that form; hence the
>> code accesses values in what it thinks is one struct but is actually a
>> different one. Hence the valgrind errors.
>>
>> But since the matrix only lives on one process there is actually nothing
>> to move between processors hence no error happens in the computation. You
>> can avoid the issue completely by using MATAIJ matrix for the type instead
>> of MATMPIAIJ and then on one process it automatically uses MATSEQAIJ.
>>
>> I don’t think the bug has anything in particular to do with the
>> MatTranspose.
>>
>>    Hong,
>>
>>      Can you please fix this code? Essentially you can by pass parts of
>> the code when the Mat is on only one process. (Maybe this also happens for
>> MPIBAIJ matrices?) Send a response letting me know you saw this.
>>
>>     Thanks
>>
>>       Barry
>
> I had to fix a few issues similar to this a while back. The method
> VecScatterGetTypes_Private introduced in pull request 176 might be useful in
> this context.
>
> Cheers,
> Dominic
>


More information about the petsc-users mailing list