[petsc-users] Error in VecGetArrayF90 and MatGetArrayF90

Alexander Grayver agrayver at gfz-potsdam.de
Fri Jun 17 06:18:04 CDT 2011


I find it strange that in the documentation of MatGetArrayF90 you write:

Synopsis
/MatGetArrayF90(Mat x,{Scalar, pointer :: xx_v(:)},integer ierr)/

Which doesn't compile:
/Error    1     Error: The shape matching rules of actual arguments and 
dummy arguments have been violated.   [xx_v]/

What really works is
/MatGetArrayF90(Mat x,{Scalar, pointer :: xx_v(:,:)},integer ierr)/

On 17.06.2011 12:50, Alexander Grayver wrote:
> Sorry Jed, t was my fault.
> I had to include:
> #include "finclude/petscvec.h90"
> #include "finclude/petscmat.h90"
>
> I read about that in documentation 3 months ago and forgot to do that 
> in new module.
>
> On 17.06.2011 12:23, Jed Brown wrote:
>> On Fri, Jun 17, 2011 at 12:05, Alexander Grayver 
>> <agrayver at gfz-potsdam.de <mailto:agrayver at gfz-potsdam.de>> wrote:
>>
>>     What is ABI?
>>
>>
>>
>> Application Binary Interface, basically the assembly-level calling 
>> semantics. If the tests run successfully, then this is not the problem.
>>
>>     Both examples work without crashing. Pretty weird...
>>
>>
>> One more to try: mat/examples/tests/ex16f90.F
>>
>>     I can tell more. I found place in my code, just different fortran
>>     module, where VecGetArrayF90 works both on seq and mpi vectors.
>>
>>
>> This call works from one Fortran module, but not from another? I 
>> suspect stack corruption, perhaps from something as simple as the 
>> wrong number of arguments to an earlier call. (Fortran having nearly 
>> worthless type checking.)
>>
>>     What API do you mean exactly?
>>
>>
>> The non-F90 VecGetArray() and MatGetArray(). But if MatGetArrayF90() 
>> is working when called in a different context, then this shouldn't be 
>> necessary.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110617/661c505d/attachment.htm>


More information about the petsc-users mailing list