|
在子程序subroutine中,如下代码
subroutine mpi_sum_z(f,i_root,myid,nsend,iall)
include 'mpif.h'
real recv_b(nsend), f(nsend) !nsend=256
因为出现double free or corruption的错误,并显示这里有错误
利用gdb调试,print数组内容,f是256大小的数组,recv_b却好像无限大。步骤如下
(gdb) print f
$1 = (2.83542365e-14, 2.84252873e-14, 2.84072133e-14, 2.85789696e-14, 2.84969666e-14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...)
(gdb) print recv_b
$3 = ()
(gdb) print recv_b(1000)
$3 = 0
|
|