[petsc-users] MatSeqBAIJSetPreallocation

Satish Balay balay at mcs.anl.gov
Thu Jun 4 17:16:12 CDT 2020


On Thu, 4 Jun 2020, Sanjay Govindjee wrote:

> I'm moving from 3.10 to 3.13 and ran into a compilation problem with 
> MatSeqBAIJSetPreallocation( ).
> The manual page shows:
> 
> PetscErrorCode
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode>
> MatSeqBAIJSetPreallocation
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSeqBAIJSetPreallocation.html#MatSeqBAIJSetPreallocation>(Mat
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/Mat.html#Mat>
> B,PetscInt
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt>
> bs,PetscInt
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt>
> nz,const PetscInt
> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt>
> nnz[])
> 
> 
> Which I think is the way it was before but my code is now tossing a compile
> error
> 
> 
>    65 |      & PETSC_NULL_INTEGER,mr(np(246)),
>       |                                     1
> Error: Rank mismatch in argument 'c' at (1) (scalar and rank-1)
> 
> 
> The full line looks like:
>         call MatSeqBAIJSetPreallocation(Mmat,nsbk,
>     & PETSC_NULL_INTEGER,mr(np(246)),

I think this should be PETSC_DEFAULT_INTEGER.

Previously there were no Interface definitions - so no error checks by the compiler.

Satish

>     & ierr)
> 
> Any suggestions on what I've messed up?
> -sanjay
> 
> 


More information about the petsc-users mailing list