[petsc-dev] MATOP_MAT_MULT

Pierre Jolivet pierre.jolivet at enseeiht.fr
Tue Apr 21 07:50:19 CDT 2020


Hello,
Am I seeing this correctly?
#include <petsc.h>

int main(int argc,char **args)
{
  Mat               A;
  PetscBool         hasMatMult;
  PetscErrorCode    ierr;

  ierr = PetscInitialize(&argc,&args,NULL,NULL);if (ierr) return ierr;
  ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);
  ierr = MatSetType(A,MATMPIAIJ);CHKERRQ(ierr);
  ierr = MatHasOperation(A,MATOP_MAT_MULT,&hasMatMult);CHKERRQ(ierr);
  printf("%s\n", PetscBools[hasMatMult]);
  ierr = PetscFinalize();
  return ierr;
}

=> FALSE

I believe this is a regression (or at least an undocumented change) introduced here: https://gitlab.com/petsc/petsc/-/merge_requests/2524/ <https://gitlab.com/petsc/petsc/-/merge_requests/2524/>
I also believe Stefano raised a similar point there: https://gitlab.com/petsc/petsc/-/issues/608 <https://gitlab.com/petsc/petsc/-/issues/608>
This is a performance killer in my case because I was previously using this check to know whether I could use MatMatMult or had to loop on all columns and call MatMult on all of them.
There is also a bunch of (previously functioning but now) broken code, e.g., https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/transpose/transm.c.html#line105 <https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/transpose/transm.c.html#line105> or https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#line2105 <https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#line2105>
Is this being addressed/documented?

Thanks,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200421/cd8d6dab/attachment.html>


More information about the petsc-dev mailing list