<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Other basic operations (i.e. MatAXPY_Basic) handles this programmatically. You should open an MR fixing it.<div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 15, 2020, at 1:22 AM, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Jacob Faibussowitsch <</span><a href="mailto:jacob.fai@gmail.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">jacob.fai@gmail.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">> writes:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Hello All,<br class=""><br class="">When using MATSBAIJ and MatChop you get the following error:<br class=""><br class="">[0]PETSC ERROR: No support for this operation for this object type<br class="">[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()<br class="">[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Development GIT revision: v3.13-108-ga86b3fd671  GIT Date: 2020-04-10 15:27:46 -0500<br class="">[0]PETSC ERROR: ./tightbinding on a arch-slepc-lammps named Jacobs-MacBook-Pro.local by jacobfaibussowitsch Tue Apr 14 16:57:07 2020<br class="">[0]PETSC ERROR: Configure options --download-slepc --with-blaslapack --with-debugging=yes --with-mpi-dir=/Users/jacobfaibussowitsch/NoSync/petscpackages PETSC_ARCH=arch-slepc-lammps<br class="">[0]PETSC ERROR: #1 MatGetRow_SeqSBAIJ() line 294 in /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/impls/sbaij/seq/sbaij.c<br class="">[0]PETSC ERROR: #2 MatGetRow() line 563 in /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/interface/matrix.c<br class="">[0]PETSC ERROR: #3 MatChop() line 488 in /Users/jacobfaibussowitsch/NoSync/petsc/src/mat/utils/axpy.c<br class="">[0]PETSC ERROR: #4 CreateHamiltonian() line 425 in /Users/jacobfaibussowitsch/NoSync/TB/tightbinding.c<br class="">[0]PETSC ERROR: #5 main() line 458 in /Users/jacobfaibussowitsch/NoSync/TB/tightbinding.c<br class=""><br class="">But if you follow the instructions above, i.e. running with -mat_getrow_uppertriangular true then this works without a hitch.<span class="Apple-converted-space"> </span><br class=""><br class="">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.<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">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.</span></div></blockquote></div><br class=""></div></body></html>