Mismatch in explicit fortran interface for MatGetInfo

Stephan Kramer s.kramer at imperial.ac.uk
Sat May 30 07:44:09 CDT 2009

Thanks a lot for looking into this. The explicit fortran interfaces are 
in general very useful. The problem occurred for me with petsc-3.0.0-p1. 
I'm happy to try it out with a more recent patch-level or with petsc-dev.

My current workaround is to simply wrap the call the MatGetInfo inside 
an external subroutine that doesn't use the fortran interfaces, so we 
can still apply the interfaces in the rest of the code. This is part of 
our CFD code that has to build on a number of different platforms, so I 
will probably have to maintain this workaround, so it will build with 
whatever petsc 3 version is available on a given platform.

The attached files were for current petsc-dev?


Satish Balay wrote:
> I have the following fixed files [untested yet]. But could you tell me
> how you've configured PETSc? - and what patchlevel?
> [It appears that there are quiet a few breakages with
> --with-fortran-interfaces=1 - I might fix this in petsc-dev - not
> 3.0.0 - as it depends upon some f90 interface changes that are only in
> petsc-dev]
> Attaching the modified files that go with my untested fix.
> include/finclude/ftn-auto/petscmat.h90
> include/finclude/ftn-custom/petscmat.h90
> src/mat/interface/ftn-auto/matrixf.c
> src/mat/interface/ftn-custom/zmatrixf.c
> src/mat/interface/matrix.c
> Satish
> On Wed, 27 May 2009, Barry Smith wrote:
>>  Stephan,
>>   Satish is working on the patch for this and will get it to you shortly.
>>   Sorry for the delay, we were debating how to handle it.
>>    Barry
>> On May 23, 2009, at 9:00 AM, Stephan Kramer wrote:
>>> Hi all,
>>> First of all thanks of a lot for providing explicit fortran interfaces for
>>> most functions in Petsc 3. This is of great help. I do however run into a
>>> problem using MatGetInfo. The calling sequence for fortran (according to the
>>> manual) is:
>>> double precision info(MAT_INFO_SIZE)
>>> Mat <cid:part1.02040105.02020103 at imperial.ac.uk> A
>>> integer ierr
>>> call MatGetInfo
>>> <cid:part2.00070305.02060306 at imperial.ac.uk>(A,MAT_LOCAL,info,ierr)
>>> The interface however seems to indicate the info argument has to be a single
>>> double precision (i.e. a scalar not an array). I guess with implicit
>>> interfaces this sort of thing would work, but with the provided explicit
>>> interface, at least gfortran won't let me have it.
>>> Cheers
>>> Stephan

More information about the petsc-users mailing list