Re: [petsc-dev] AIJ type question

2022-06-16 Thread Barry Smith

 MAT[SEQ/MPI]AIJ 

 PetscObjectBaseTypeCompare() strips off the  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  wrote:
> 
> I have a test failing: ksp_ksp_tutorials-ex7_gamg_cuda_nsize-2 
> (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, ));
> 
> 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,));
>   PetscCheck(isAIJ,PETSC_COMM_SELF,PETSC_ERR_USER,"Require AIJ matrix.");
> 
> Seems inconsistent.
> 
> Thanks
> Mark 



[petsc-dev] AIJ type question

2022-06-16 Thread Mark Adams
I have a test failing: ksp_ksp_tutorials-ex7_gamg_cuda_nsize-2 (
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, ));

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,));
  PetscCheck(isAIJ,PETSC_COMM_SELF,PETSC_ERR_USER,"Require AIJ
matrix.");

Seems inconsistent.

Thanks
Mark