Pierre,
MatMatMult_xxx() is removed from MatOps table. MatMatMult() is replaced by
MatProductCreate()
MatProductSetType(,MATPRODUCT_AB)
MatProductSetFromOptions()
MatProductSymbolic()
MatProductNumeric()

Where/when do you need query a single matrix for its product operation?
Hong

________________________________
From: petsc-dev <[email protected]> on behalf of Pierre Jolivet 
<[email protected]>
Sent: Tuesday, April 21, 2020 7:50 AM
To: petsc-dev <[email protected]>
Subject: [petsc-dev] MATOP_MAT_MULT

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/
I also believe Stefano raised a similar point there: 
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
 or 
https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#line2105
Is this being addressed/documented?

Thanks,
Pierre

Reply via email to