[petsc-users] MatMatMult

hzhang at mcs.anl.gov hzhang at mcs.anl.gov
Thu Feb 27 09:33:29 CST 2020


Emmanuel:
You can create a dense C with the required parallel layout without
calling MatAssemblyBegin() and MatAssemblyEnd().
Did you get error without calling these routines?
We only updated the help manu, not internal implementation. In the next
release, we'll introduce new set of API to consolidate the API of
mat-mat-operations.
Hong

Hi everyone,
>
> Recently I installed the PETSc version 3.12.4 in optimized mode:
>
> ./configure --with-debugging=0 COPTFLAGS='-O2 -march=native -mtune=native'
> CXXOPTFLAGS='-O2 -march=native -mtune=native' FOPTFLAGS='-O2 -march=native
> -mtune=native' --download-mpich=1 --download-fblaslapack=1
> --with-cxx-dialect=C++11
>
> When I perform MatMatMult(A,B,MAT_REUSE_MATRIX,PETSC_DEFAULT,&C), for
> sparse A and dense B matrices, then:
>
> In the special case where matrix B (and hence C) are dense you can create
> the correctly sized matrix C yourself and then call this routine with
> MAT_REUSE_MATRIX
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatReuse.html#MatReuse>,
> rather than first having MatMatMult
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMatMult.html#MatMatMult>()
> create it for you. You can NEVER do this if the matrix C is sparse.
>
> So, for these new release 3.12.4, if you create C as a dense matrix it is
> necessary to apply a MatAssemblyBegin() and MatAssemblyEnd() after the
> matrix multiplication, other wise it's not possible to perform further
> operations.
>
> It does not happen in the 3.11.3 version, where MatAssembly after
> multiplication it's not necessary.
>
> Kind regards.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200227/f1785c16/attachment.html>


More information about the petsc-users mailing list