[petsc-users] PetscScatterCreate type mismatch after update.

Manuel Valera mvalera-w at sdsu.edu
Tue Mar 12 20:44:23 CDT 2019


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 <jczhang at mcs.anl.gov> 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 <mvalera-w at 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 <jczhang at 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 <
>>> petsc-users at 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 <petsc-users at 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 <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/c1cfeec0/attachment.html>


More information about the petsc-users mailing list