[petsc-users] using PETSC_NULL_INTEGER in preallocation routines

Smith, Barry F. bsmith at mcs.anl.gov
Mon May 14 10:40:58 CDT 2018


Chris,

   These arguments should never have been PETSC_NULL_INTEGER since they are integers (and not pointers or arrays), you should pass 0 for them.

  Barry


> On May 14, 2018, at 4:45 AM, Klaij, Christiaan <C.Klaij at marin.nl> wrote:
> 
> With petsc-3.7.5, I had F90 code like this:
> 
>  CALL MatSeqAIJSetPreallocation(aa_symmetric,PETSC_NULL_INTEGER,d_nnz,ierr); CHKERRQ(ierr)
>  CALL MatMPIAIJSetPreallocation(aa_symmetric,PETSC_NULL_INTEGER,d_nnz,PETSC_NULL_INTEGER,o_nnz,ierr); CHKERRQ(ierr)
> 
> which worked fine. Now, with petsc-3.8.4, the same code gives this compilation error:
> 
>  error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [PETSC_NULL_INTEGER]
>  CALL MatSeqAIJSetPreallocation(aa_symmetric,PETSC_NULL_INTEGER,d_nnz,ierr); if (ierr .ne. 0) then ; call PetscErrorF(ierr); return; endif
> ----------------------------------------------^
>  error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [PETSC_NULL_INTEGER]
>  CALL MatMPIAIJSetPreallocation(aa_symmetric,PETSC_NULL_INTEGER,d_nnz,PETSC_NULL_INTEGER,o_nnz,ierr); if (ierr .ne. 0) then ; call PetscErrorF(ierr); return; endif
> ----------------------------------------------^
> 
> What's the intended usage now, simply 0 instead of PETSC_NULL_INTEGER?
> 
> Chris
> 
> 
> dr. ir. Christiaan Klaij  | Senior Researcher | Research & Development
> MARIN | T +31 317 49 33 44 | mailto:C.Klaij at marin.nl | http://www.marin.nl
> 
> MARIN news: http://www.marin.nl/web/News/News-items/120-papers-presented-at-NAV2018.htm
> 



More information about the petsc-users mailing list