some fixes for AIJ and BAIJ matrices

Lisandro Dalcin dalcinl at gmail.com
Wed Jun 11 14:25:39 CDT 2008


On 6/10/08, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   Beats the heck out of me, do whatever fixes you feel are needed.

Well, I've finally decided not push the fixes directly in petsc-dev.
Core AIJ preallocation routines are not good place for making fixes
for release, I'm really worried any change there could cause problems
to users.

I did not do anything about supporting MAT_SKIP_ALLOCATION for MPIAIJ
matrices. After looking at the use cases, it seems that this is not
intended for end users, but for implementing MPI matrices containing
Seq matrices. If this is the case, then nothing remains to be done for
this.

Note that I've not managed the Fortran interfaces for
Mat{Seq|MPI}BAIJSetPreallocationCSR. I'm not completelly sure if the
automatic generation of Fortran wrappers is safe in this case (though
it seems it is). Feel free to add it if any of you consider that
appropriate.

I've tested the fixes from petsc4py with many variants of
sequential/parallel (2,3,4 procs), AIJ/BAIJ, grid sizes (including
zero) and block sizes (1 to 5) (suming up, about 200 test cases in a
Python unittest script) to believe that all is working OK.


Anyway, I ran 'make testexamples' and got the following two diffs:

testexamples_C in: /u/dalcinl/Devel/PETSc/petsc-dev/src/mat/examples/tests

(1) The one below should perhaps need a bit more of attention. Looking
at the actual code, I would say this does not have nothing to do with
my fixes.

42c42
<      nonzeros = 48, allocated nonzeros = 120
---
>      nonzeros = 48, allocated nonzeros = 84
44c44
<      nonzeros = 25, allocated nonzeros = 60
---
>      nonzeros = 25, allocated nonzeros = 42
Possible problem with ex9_1, diffs above


(2) The one below is surelly outdated. BDIAG matrices are gone.

26,80c26,48
<   type=seqbdiag, rows=20, cols=20
... <more ouput> ...
---
>   type=seqaij, rows=20, cols=20
... <more ouput> ...
Possible problem with ex20_1, diffs above



Regards,





> > Some fixes are needed for BAIJ matrices are:
> >
> > (1) MatMPIBAIJSetPreallocationCSR_MPIBAIJ   ->  BROKEN
> > (2) MatSeqBAIJSetPreallocationCSR_SeqBAIJ  ->  MISSING
> >
> > Regarding (1), the fix needs to call PetscMapSetUp() for setting-up
> > the row and column maps (rmap&cmap fields) at the very begining,
> > before anything else. If this is not done, the stuff is the row/column
> > maps are not properly initialized at the point (1) is called. But
> > then, PetscMapSetUp() will be called again as (1) calls
> > MatMPIBAIJSetPreallocation_MPIBAIJ with nnz information.
> However, I
> > believe this is not an issue, as the second call will be a no-op (at
> > least for optimized builds). Additionally, there is a bug at the point
> > MatSetValuesBlocked_MPIBAIJ() is being called, as the block-size is
> > not being taking into accout for the 'values' array (when it is
> > provided).
> >
> > Regarding (2), the issues in (1) for rmap/cmap are the same.
> >
> > It is fine to push the fixes in release-2.3.3, particularly regarding
> > that (2) could be seen a 'new functionality'? I would prefer to add it
> > to release-2.3.3.
> >
> > -------------------------
> >
> > Finally, for MPIAIJ, something I'm not sure what to do is the following:
> >
> > - for MatSeq[B]AIJ one can pass nz=MAT_SKIP_PREALLOCATION
> > - for MatMPI[B]AIJ, passing
> d_nz/o_nz=MAT_SKIP_PREALLOCATION generates
> > an error.
> >
> > Should MatMPI[B]AIJ support MAT_SKIP_PREALLOCATION for d_nz/o_nz
> arguments?
> >
> > Again, it is fine to push this to release-2.3.3 ?
> >
> >
> >
> > --
> > Lisandro Dalcín
> > ---------------
> > Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> > Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> > Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> > PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> > Tel/Fax: +54-(0)342-451.1594
> >
> >
> >
>
>


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594




More information about the petsc-dev mailing list