[petsc-users] VecGetArrayReadF90 with gfortran

Samuel Lanthaler s.lanthaler at gmail.com
Fri Mar 23 09:10:46 CDT 2018


Hi all,

I am having trouble using the function VecGetArrayReadF90 under gfortran. I
have created a minimal example and put it in the attachment. Basically, it
appears that the input pointer is empty upon return from
VecGetArrayReadF90. The code runs fine, when compiled with ifort, so I
don't know what's going on.

I am attaching the code and makefile that I used, as well as the command
line output that I can see. Though the errors are just to do with the fact
that the output pointer is empty, so the command line output is not all
that helpful...

Thanks in advance for your help!
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180323/5e3d9566/attachment.html>
-------------- next part --------------
 setting values
 assembling vector
 copying vector to array
 N =           10
 m =           10
 getting vecX size
 getting ownership range
 ownership range:            0          10
 copy values to global array
 vecX_pt:
 SIZE =            0
At line 127 of file allreduce.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'copy_buffer' (10/0)

Error termination. Backtrace:
#0  0x402621 in petscvec2array_
	at /home/lanthale/Progs/test_PetscVec2Array/allreduce.f90:127
#1  0x403550 in allreduce
	at /home/lanthale/Progs/test_PetscVec2Array/allreduce.f90:58
#2  0x4035d8 in main
	at /home/lanthale/Progs/test_PetscVec2Array/allreduce.f90:4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makefile
Type: application/octet-stream
Size: 1214 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180323/5e3d9566/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allreduce.f90
Type: text/x-fortran
Size: 3965 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180323/5e3d9566/attachment.bin>


More information about the petsc-users mailing list