[petsc-dev] AIJ type question

Barry Smith bsmith at petsc.dev
Thu Jun 16 15:41:23 CDT 2022


     PetscObjectBaseTypeCompare() strips off the XXXX and compares

     PetscObjectTypeCompare() compares the entire string

     As discussed with Richard recently for likely a similar need we also need a 

     PetscObjectRootTypeCompare() that strips out the Seq/MPI for the comparison, see MatRegisterRootname()

     If you want a check for either SeqAIJ or MPIAIJ you can use PetscObjectBaseTypeCompareAny() with MATSeqAIJ and MatMPIAIJ


> On Jun 16, 2022, at 4:26 PM, Mark Adams <mfadams at lbl.gov> wrote:
> I have a test failing: ksp_ksp_tutorials-ex7_gamg_cuda_nsize-2 (https://gitlab.com/petsc/petsc/-/jobs/2601658676 <https://gitlab.com/petsc/petsc/-/jobs/2601658676>)
> I have this code that I want to be true here (2 processors):
>  PetscCall(PetscObjectTypeCompare((PetscObject)Gmat, MATMPIAIJ, &isMPI));
> But it is returning false.  Should I have a CompareAny here or something else?
> ksp_ksp_tutorials-ex7_gamg_cuda_nsize-1 does seem to work and passes this test:
>       PetscCall(PetscObjectBaseTypeCompare((PetscObject)cMat,MATSEQAIJ,&isAIJ));
>       PetscCheck(isAIJ,PETSC_COMM_SELF,PETSC_ERR_USER,"Require AIJ matrix.");
> Seems inconsistent.
> Thanks
> Mark 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20220616/0edc9d84/attachment.html>

More information about the petsc-dev mailing list