[petsc-users] MatSeqBAIJSetPreallocation

Sanjay Govindjee s_g at berkeley.edu
Thu Jun 4 18:13:04 CDT 2020


Thanks Mark.

Very helpful and explains why my other PETSC_NULL_INTEGER uses are still 
functioning
and why in some places I have PETSC_NULL_INTEGER(1).  I guess I can 
replace the latter with PETSC_DEFAULT_INTEGER for a cleaner look.

On 6/4/20 3:58 PM, Mark Adams wrote:
>
>
> On Thu, Jun 4, 2020 at 6:41 PM Sanjay Govindjee <s_g at berkeley.edu 
> <mailto:s_g at berkeley.edu>> wrote:
>
>     thanks, that did it.  now I am wondering about all the other
>     PETSC_NULL_INTEGER instances in
>     my code.  how should I be thinking about PETSC_NULL_INTEGER 
>
>
> I would think it's an integer array/pointer in C.
>
>     and
>     PETSC_DEFAULT_INTEGER,
>
>
> and an integer in C.
>
>     so that I know that I am using the correct one?
>
>     On 6/4/20 3:16 PM, Satish Balay wrote:
>     > 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
>     >>
>     >>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200604/dc4a4b4f/attachment-0001.html>


More information about the petsc-users mailing list