[petsc-dev] Problems with VecScatterRemap() Fortran interface in PETSc 3.10

Balay, Satish balay at mcs.anl.gov
Fri Oct 5 16:59:06 CDT 2018


There were 2 changes that appear to affect pflotran

https://bitbucket.org/petsc/petsc/commits/3d1df95b16 Change Fortran null pointer to match C null pointer
https://bitbucket.org/petsc/petsc/commits/487a658c8b Remove CHKFORTRANNULLOBJECTDEREFERENCE since it is no longer needed with Fortran null equal to C null

The second one causes compile errors with pflotran. I have fixes in branch balay/revert_vecscatterremap_/maint

However - the first one is causing regression failure in pflotran. I
assumed pflotran requires fixes (patch attached) - but this is not working.

>>>>>
$ make check
make[1]: Entering directory '/home/balay/git-repo/pflotran/src/pflotran'
gmake[2]: Entering directory '/home/balay/git-repo/pflotran/regression_tests'
/usr/bin/python regression_tests.py -e /home/balay/git-repo/pflotran/src/pflotran/pflotran  --mpiexec mpiexec \
	--suite standard standard_parallel \
	--config-files ascem/1d/1d-calcite/1d-calcite.cfg
  Test log file : pflotran-tests-2018-10-05_16-56-18.testlog
Running pflotran regression tests :
FF
----------------------------------------------------------------------
Regression test summary:
    Total run time: 0.204805 [s]
    Total tests : 2
    Tests run : 2
    Failed : 2


gmake[2]: [Makefile:207: check] Error 2 (ignored)
gmake[2]: Leaving directory '/home/balay/git-repo/pflotran/regression_tests'
make[1]: Leaving directory '/home/balay/git-repo/pflotran/src/pflotran'
<<<<<

Richard, Would you be able to debug this?

I noticed the current code has the following - so that overloading the new null def?

$ git grep tVec\(0\)
src/pflotran/convergence.F90:  residual_vec = tVec(0)
src/pflotran/convergence.F90:  solution_vec = tVec(0)
src/pflotran/convergence.F90:  update_vec = tVec(0)
src/pflotran/pm_wipp_flow.F90:  residual_vec = tVec(0)
src/pflotran/timestepper_BE.F90:  residual_vec = tVec(0) 

Satish

-------------


On Fri, 5 Oct 2018, Mills, Richard Tran wrote:

> Fellow PETSc developers (cc: PFLOTRAN developers),
> 
> I am trying to get PFLOTRAN (which currently uses PETSc 3.9) working with the recent PETSc 3.10 release. One problem I am hitting is that VecScatterRemap() calls that were fine with PETSc 3.9 cause compile time errors due to mismatched ranks in some arguments. Digging around in the 3.10 source code, I see that in my auto-generated interfaces in $PETSC_DIR/src/vec/f90-mod/ftn-auto-interfaces/petscvec.h90 there is
> 
>       subroutine VecScatterRemap(a,b,c,z)
>       use petscvecdef
>        VecScatter a ! VecScatter
>        PetscInt b ! PetscInt
>        PetscInt c ! PetscInt
>        integer z
>        end subroutine
> 
> but I think arguments b and c need to be defined something like
> 
>        PetscInt, dimension(:), pointer :: b
>        PetscInt, dimension(:), pointer :: c
> 
> (Though my modern Fortran skills are rusty and I'm not sure if this is quite how these should be declared.) Note that this interface doesn't appear to be generated at all in PETSc 3.9. It's been a very long time since I've done any hacking on the Fortran interface stuff in PETSc. How do I go about fixing this?
> 
> Related Fortran usage question: At one point in PFLOTRAN, there is the call
> 
>   call VecScatterRemap(ugdm%scatter_ltol,int_ptr,PETSC_NULL_INTEGER, &
>                        ierr);CHKERRQ(ierr)
> 
> If I manually change the Fortran interface code to be as above, then I get
> 
>   Error: Actual argument for 'c' must be a pointer at (1)
> 
> If argument 'c' should indeed be defined as a pointer to a one-dimensional array, what variant of PETSC_NULL are we to pass?
> 
> --Richard
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pflotran.patch
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20181005/c293d0f5/attachment.ksh>


More information about the petsc-dev mailing list