Re: [petsc-users] PetscScatterCreate type mismatch after update.
Manuel Valera writes: > Ok i'll try that and let you know, for the time being i reverted to 3.9 to > finish a paper, will update after that :) 3.10 will also work.
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Ok i'll try that and let you know, for the time being i reverted to 3.9 to finish a paper, will update after that :) On Tue, Mar 12, 2019 at 6:42 PM Zhang, Junchao wrote: > Maybe you should delete your PETSC_ARCH directory and recompile it? I > tested my branch. It should not that easily fail :) > > --Junchao Zhang > > > On Tue, Mar 12, 2019 at 8:20 PM Manuel Valera wrote: > >> Hi Mr Zhang, thanks for your reply, >> >> I just checked your branch out, reconfigured and recompiled and i am >> still getting the same error from my last email (null argument, when >> expected a valid pointer), do you have any idea why this can be happening? >> >> Thanks so much, >> >> Manuel >> >> On Tue, Mar 12, 2019 at 6:09 PM Zhang, Junchao >> wrote: >> >>> Manuel, >>> I was working on a branch to revert the VecScatterCreate to >>> VecScatterCreateWithData change. The change broke PETSc API and I think we >>> do not need it. I had planed to do a pull request after my another PR is >>> merged. >>> But since it already affects you, you can try this branch now, which is >>> jczhang/fix-vecscattercreate-api >>> >>> Thanks. >>> --Junchao Zhang >>> >>> >>> On Tue, Mar 12, 2019 at 5:58 PM Jed Brown via petsc-users < >>> petsc-users@mcs.anl.gov> wrote: >>> Did you just update to 'master'? See VecScatter changes: https://www.mcs.anl.gov/petsc/documentation/changes/dev.html Manuel Valera via petsc-users writes: > 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 >> #include >> #include >> #include >> #include >> 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, >>>
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Maybe you should delete your PETSC_ARCH directory and recompile it? I tested my branch. It should not that easily fail :) --Junchao Zhang On Tue, Mar 12, 2019 at 8:20 PM Manuel Valera mailto:mvaler...@sdsu.edu>> wrote: Hi Mr Zhang, thanks for your reply, I just checked your branch out, reconfigured and recompiled and i am still getting the same error from my last email (null argument, when expected a valid pointer), do you have any idea why this can be happening? Thanks so much, Manuel On Tue, Mar 12, 2019 at 6:09 PM Zhang, Junchao mailto:jczh...@mcs.anl.gov>> wrote: Manuel, I was working on a branch to revert the VecScatterCreate to VecScatterCreateWithData change. The change broke PETSc API and I think we do not need it. I had planed to do a pull request after my another PR is merged. But since it already affects you, you can try this branch now, which is jczhang/fix-vecscattercreate-api Thanks. --Junchao Zhang On Tue, Mar 12, 2019 at 5:58 PM Jed Brown via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Did you just update to 'master'? See VecScatter changes: https://www.mcs.anl.gov/petsc/documentation/changes/dev.html Manuel Valera via petsc-users mailto:petsc-users@mcs.anl.gov>> writes: > 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 >> #include >> #include >> #include >> #include >> 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,
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Hi Mr Zhang, thanks for your reply, I just checked your branch out, reconfigured and recompiled and i am still getting the same error from my last email (null argument, when expected a valid pointer), do you have any idea why this can be happening? Thanks so much, Manuel On Tue, Mar 12, 2019 at 6:09 PM Zhang, Junchao wrote: > Manuel, > I was working on a branch to revert the VecScatterCreate to > VecScatterCreateWithData change. The change broke PETSc API and I think we > do not need it. I had planed to do a pull request after my another PR is > merged. > But since it already affects you, you can try this branch now, which is > jczhang/fix-vecscattercreate-api > > Thanks. > --Junchao Zhang > > > On Tue, Mar 12, 2019 at 5:58 PM Jed Brown via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> Did you just update to 'master'? See VecScatter changes: >> >> https://www.mcs.anl.gov/petsc/documentation/changes/dev.html >> >> Manuel Valera via petsc-users writes: >> >> > 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 >> >> #include >> >> #include >> >> #include >> >> #include >> >> 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, >> >
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Manuel, I was working on a branch to revert the VecScatterCreate to VecScatterCreateWithData change. The change broke PETSc API and I think we do not need it. I had planed to do a pull request after my another PR is merged. But since it already affects you, you can try this branch now, which is jczhang/fix-vecscattercreate-api Thanks. --Junchao Zhang On Tue, Mar 12, 2019 at 5:58 PM Jed Brown via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Did you just update to 'master'? See VecScatter changes: https://www.mcs.anl.gov/petsc/documentation/changes/dev.html Manuel Valera via petsc-users mailto:petsc-users@mcs.anl.gov>> writes: > 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 >> #include >> #include >> #include >> #include >> 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,
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Hi, So i just solved that problem but now it looks my code broke somewhere else, i have a script in place to scatter/gather the information to root in order to write it to a file (i know, we need to make this parallel I/O but that's future work). Such script looks like this: > SUBROUTINE WriteToFile_grid() > > PetscErrorCode:: ierrp > PetscMPIInt :: rank > PetscInt :: iter > Vec :: > CenterX,CenterY,CenterZ,Nat1,Nat2,seqvec > PetscScalar, pointer :: tmp3d(:,:,:),tmp4d(:,:,:,:),arr(:) > VecScatter:: LargerToSmaller, scatterctx > INTEGER :: i,j,k, ierr > > call MPI_Comm_rank(PETSC_COMM_WORLD, rank, ierrp) > > !#! > ! Grid Cell Centers: x-component > ! > > !#! > ! Extract x-component > call DMDAVecGetArrayF90(daGrid,GridCenters,tmp4d,ierrp) > call DMCreateGlobalVector(daSingle,CenterX,ierrp) > call DMDAVecGetArrayF90(daSingle,CenterX,tmp3d,ierrp) > tmp3d(:,:,:) = tmp4d(0,:,:,:) > call DMDAVecRestoreArrayF90(daSingle,CenterX,tmp3d,ierrp) > call DMDAVecRestoreArrayF90(daGrid,GridCenters,tmp4d,ierrp) > ! Scatter to daWriteCenters > call DMDACreateNaturalVector(daSingle,Nat1,ierrp) > call > DMDAGlobalToNaturalBegin(daSingle,CenterX,INSERT_VALUES,Nat1,ierrp) > call > DMDAGlobalToNaturalEnd(daSingle,CenterX,INSERT_VALUES,Nat1,ierrp) > call VecDestroy(CenterX,ierrp) > call DMDACreateNaturalVector(daWriteCenters,Nat2,ierrp) > call > VecScatterCreate(Nat1,SingleIS,Nat2,WriteIS,LargerToSmaller,ierrp) > call > VecScatterBegin(LargerToSmaller,Nat1,Nat2,INSERT_VALUES,SCATTER_FORWARD,ierrp) > call > VecScatterEnd(LargerToSmaller,Nat1,Nat2,INSERT_VALUES,SCATTER_FORWARD,ierrp) > call VecScatterDestroy(LargerToSmaller,ierrp) > call VecDestroy(Nat1,ierrp) > ! Send to root > call VecScatterCreateToZero(Nat2,scatterctx,seqvec,ierrp) > call > VecScatterBegin(scatterctx,Nat2,seqvec,INSERT_VALUES,SCATTER_FORWARD,ierrp) > call > VecScatterEnd(scatterctx,Nat2,seqvec,INSERT_VALUES,SCATTER_FORWARD,ierrp) > call VecScatterDestroy(scatterctx,ierrp) >call VecDestroy(Nat2,ierrp) > ! Let root write to netCDF file > if (rank == 0) then > allocate(buffer(1:IMax-1,1:JMax-1,1:KMax-1),STAT=ierr) > call VecGetArrayReadF90(seqvec,arr,ierrp) > iter = 1 > do k=1,KMax-1 > do j=1,JMax-1 > do i=1,IMax-1 > buffer(i,j,k) = arr(iter) > iter = iter + 1 > enddo > enddo > enddo > call VecRestoreArrayReadF90(seqvec,arr,ierrp) > call > nc_check(nf90_put_var(ncid,xID,buffer,start=(/1,1,1/),count=(/IMax-1,JMax-1,KMax-1/)), > & > 'WriteNetCDF', context='put_var GridCenterX > in '//trim(output_filename)) > deallocate(buffer,STAT=ierr) > endif > call VecDestroy(seqvec,ierrp) And then the process is repeated for each variable to output. Notice the vector seqvec is being destroyed at the end. Using petsc v3.10.0 this script worked without problems. After updating to v3.10.4 it no longer works. Gives the following error: [0]PETSC ERROR: - Error Message > -- > [0]PETSC ERROR: Null argument, when expecting valid pointer > [0]PETSC ERROR: Null Object: Parameter # 3 > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.10.4, unknown > [0]PETSC ERROR: ./gcmSeamount on a petsc-debug named ocean by valera Tue > Mar 12 17:59:43 2019 > [0]PETSC ERROR: Configure options --known-level1-dcache-size=32768 > --known-level1-dcache-linesize=64 --known-level1-dcache-assoc=8 > --known-sizeof-char=1 --known-sizeof-void-p=8 --known-sizeof-short=2 > --known-sizeof-int=4 --known-sizeof-long=8 --known-sizeof-long-long=8 > --known-sizeof-float=4 --known-sizeof-double=8 --known-sizeof-size_t=8 > --known-bits-per-byte=8 --known-memcmp-ok=1 --known-sizeof-MPI_Comm=8 > --known-sizeof-MPI_Fint=4 --known-mpi-long-double=1 --known-mpi-int64_t=1 > --known-mpi-c-double-complex=1 --known-has-attribute-aligned=1 > PETSC_ARCH=petsc-debug --COPTFLAGS=-O2 --CXXOPTFLAGS=-O2 --FOPTFLAGS=-O2 > --with-cc=mpicc --with
Re: [petsc-users] PetscScatterCreate type mismatch after update.
Did you just update to 'master'? See VecScatter changes: https://www.mcs.anl.gov/petsc/documentation/changes/dev.html Manuel Valera via petsc-users writes: > 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 >> #include >> #include >> #include >> #include >> 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,
[petsc-users] PetscScatterCreate type mismatch after update.
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 > #include > #include > #include > #include > 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,