[petsc-dev] MATSBAIJ MatChop MAT_GETROW_UPPERTRIANGULAR
Matthew Knepley
knepley at gmail.com
Tue Apr 14 17:54:39 CDT 2020
On Tue, Apr 14, 2020 at 6:28 PM Stefano Zampini <stefano.zampini at gmail.com>
wrote:
> Other basic operations (i.e. MatAXPY_Basic) handles this programmatically.
> You should open an MR fixing it.
>
It looks like all you have to do is bracket the MatChop code with
ierr = MatGetRowUpperTriangular(X);CHKERRQ(ierr);
ierr = MatRestoreRowUpperTriangular(X);CHKERRQ(ierr);
Since you already have a test, should go quickly.
Thanks,
Matt
> On Apr 15, 2020, at 1:22 AM, Jed Brown <jed at jedbrown.org> wrote:
>
> Jacob Faibussowitsch <jacob.fai at gmail.com> writes:
>
> Hello All,
>
> When using MATSBAIJ and MatChop you get the following error:
>
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: MatGetRow is not supported for SBAIJ matrix format.
> Getting the upper triangular part of row, run with
> -mat_getrow_uppertriangular, call
> MatSetOption(mat,MAT_GETROW_UPPERTRIANGULAR,PETSC_TRUE) or
> MatGetRowUpperTriangular()
> [0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision: v3.13-108-ga86b3fd671 GIT
> Date: 2020-04-10 15:27:46 -0500
> [0]PETSC ERROR: ./tightbinding on a arch-slepc-lammps named
> Jacobs-MacBook-Pro.local by jacobfaibussowitsch Tue Apr 14 16:57:07 2020
> [0]PETSC ERROR: Configure options --download-slepc --with-blaslapack
> --with-debugging=yes
> --with-mpi-dir=/Users/jacobfaibussowitsch/NoSync/petscpackages
> PETSC_ARCH=arch-slepc-lammps
> [0]PETSC ERROR: #1 MatGetRow_SeqSBAIJ() line 294 in
> /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/impls/sbaij/seq/sbaij.c
> [0]PETSC ERROR: #2 MatGetRow() line 563 in
> /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/interface/matrix.c
> [0]PETSC ERROR: #3 MatChop() line 488 in
> /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/utils/axpy.c
> [0]PETSC ERROR: #4 CreateHamiltonian() line 425 in
> /Users/jacobfaibussowitsch/NoSync/TB/tightbinding.c
> [0]PETSC ERROR: #5 main() line 458 in
> /Users/jacobfaibussowitsch/NoSync/TB/tightbinding.c
>
> But if you follow the instructions above, i.e. running with
> -mat_getrow_uppertriangular true then this works without a hitch.
>
> Since MATSBAIJ is always symmetric and upper triangular by design, then
> shouldn’t this MatOption be enabled by default? Or maybe MatChop should
> check MatType and use the correct MatGetRow impls.
>
>
> MatChop should handle it, but MatGetRow() needs to get the whole row (or
> fail, as in this case), otherwise many algorithms will break in confusing
> ways when someone lobs in -dm_mat_type sbaij.
>
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200414/b5e89ebd/attachment-0001.html>
More information about the petsc-dev
mailing list