[petsc-users] PetscScatterCreate type mismatch after update.

Manuel Valera mvalera-w at sdsu.edu
Tue Mar 12 17:48:45 CDT 2019


Hello,

I just updated petsc from the repo to the latest master branch version, and
a compilation problem popped up, it seems like the variable types are not
being acknowledged properly, what i have in a minimum working example
fashion is:

#include <petsc/finclude/petscvec.h>
> #include <petsc/finclude/petscdmda.h>
> #include <petsc/finclude/petscdm.h>
> #include <petsc/finclude/petscis.h>
> #include <petsc/finclude/petscksp.h>
> USE petscvec
> USE petscdmda
> USE petscdm
> USE petscis
> USE petscksp
> IS                     :: ScalarIS
> IS                     :: DummyIS
> VecScatter             :: LargerToSmaller,to0,from0
> VecScatter             :: SmallerToLarger
> PetscInt, ALLOCATABLE  :: pScalarDA(:), pDummyDA(:)
> PetscScalar            :: rtol
> Vec                    :: Vec1
> Vec                    :: Vec2
> ! Create index sets
>             allocate( pScalarDA(0:(gridx-1)*(gridy-1)*(gridz-1)-1) ,
> pDummyDA(0:(gridx-1)*(gridy-1)*(gridz-1)-1) )
>             iter=0
>             do k=0,gridz-2
>                 kplane = k*gridx*gridy
>                 do j=0,gridy-2
>                     do i=0,gridx-2
>                         pScalarDA(iter) = kplane + j*(gridx) + i
>                         iter = iter+1
>                     enddo
>                 enddo
>             enddo
>             pDummyDA = (/ (ind, ind=0,((gridx-1)*(gridy-1)*(gridz-1))-1) /)
>             call
> ISCreateGeneral(PETSC_COMM_WORLD,(gridx-1)*(gridy-1)*(gridz-1), &
>
>  pScalarDA,PETSC_COPY_VALUES,ScalarIS,ierr)
>             call
> ISCreateGeneral(PETSC_COMM_WORLD,(gridx-1)*(gridy-1)*(gridz-1), &
>
>  pDummyDA,PETSC_COPY_VALUES,DummyIS,ierr)
>             deallocate(pScalarDA,pDummyDA, STAT=ierr)
>             ! Create VecScatter contexts: LargerToSmaller & SmallerToLarger
>             call DMDACreateNaturalVector(daScalars,Vec1,ierr)
>             call DMDACreateNaturalVector(daDummy,Vec2,ierr)
>             call
> VecScatterCreate(Vec1,ScalarIS,Vec2,DummyIS,LargerToSmaller,ierr)
>             call
> VecScatterCreate(Vec2,DummyIS,Vec1,ScalarIS,SmallerToLarger,ierr)
>             call VecDestroy(Vec1,ierr)
>             call VecDestroy(Vec2,ierr)


And the error i get is the part i cannot really understand:

matrixobjs.f90:99.34:
>             call
> VecScatterCreate(Vec1,ScalarIS,Vec2,DummyIS,LargerToSmaller,ie
>                                                  1
> Error: Type mismatch in argument 'a' at (1); passed TYPE(tvec) to
> INTEGER(4)
> matrixobjs.f90:100.34:
>             call
> VecScatterCreate(Vec2,DummyIS,Vec1,ScalarIS,SmallerToLarger,ie
>                                                  1
> Error: Type mismatch in argument 'a' at (1); passed TYPE(tvec) to
> INTEGER(4)
> make[1]: *** [matrixobjs.o] Error 1
> make[1]: Leaving directory `/usr/scratch/valera/ParGCCOM-Master/Src'
> make: *** [gcmSeamount] Error 2


What i find hard to understand is why/where my code is finding an integer
type? as you can see from the MWE header the variables types look correct,

Any help is appreaciated,

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190312/625eb9db/attachment.html>


More information about the petsc-users mailing list