<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> MAT[SEQ/MPI]AIJXXXX <div class=""><br class=""></div><div class=""> PetscObjectBaseTypeCompare() strips off the XXXX and compares</div><div class=""><br class=""></div><div class=""> PetscObjectTypeCompare() compares the entire string</div><div class=""><br class=""></div><div class=""> As discussed with Richard recently for likely a similar need we also need a </div><div class=""><br class=""></div><div class=""> PetscObjectRootTypeCompare() that strips out the Seq/MPI for the comparison, see MatRegisterRootname()</div><div class=""><br class=""></div><div class=""> If you want a check for either SeqAIJ or MPIAIJ you can use PetscObjectBaseTypeCompareAny() with MATSeqAIJ and MatMPIAIJ</div><div class=""><br class=""></div><div class=""> <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 16, 2022, at 4:26 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" class="">mfadams@lbl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I have a test failing: ksp_ksp_tutorials-ex7_gamg_cuda_nsize-2 (<a href="https://gitlab.com/petsc/petsc/-/jobs/2601658676" class="">https://gitlab.com/petsc/petsc/-/jobs/2601658676</a>)<div class=""><br class=""></div><div class="">I have this code that I want to be true here (2 processors):</div><div class=""><br class=""><div class=""> PetscCall(PetscObjectTypeCompare((PetscObject)Gmat, MATMPIAIJ, &isMPI));<br class=""></div></div><div class=""><br class=""></div><div class="">But it is returning false. Should I have a CompareAny here or something else?</div><div class=""><br class=""></div><div class="">ksp_ksp_tutorials-ex7_gamg_cuda_nsize-1 does seem to work and passes this test:</div><div class=""><br class=""></div><div class=""> PetscCall(PetscObjectBaseTypeCompare((PetscObject)cMat,MATSEQAIJ,&isAIJ));<br class=""> PetscCheck(isAIJ,PETSC_COMM_SELF,PETSC_ERR_USER,"Require AIJ matrix.");</div><div class=""><br class=""></div><div class="">Seems inconsistent.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Mark </div></div>
</div></blockquote></div><br class=""></div></body></html>