Fortran Coder

标题: linux mpi程序运行错,double free or corruption,怀疑内存问题 [打印本页]

作者: oceanqd    时间: 2020-2-11 15:28
标题: linux mpi程序运行错,double free or corruption,怀疑内存问题
新人求助,谢谢大家了!!!!!!!!!1在linux系统,编译器为mpi_mpich-3.2-gnu-485,运行fortran程序,出现如下错误:
Error in `./a.out': double free or corruption (!prev): 0x0000000002508e40 ***   百度查了可能是内存问题,但是自己尝试改了一下没有作用。

程序较长,现把主要程序流程书写如下:
[Fortran] 纯文本查看 复制代码
module 
type con_s
     real :: divz(0:maxnz1)#####这里maxnz1=257
type(con_s), target :: c_s
     real, pointer ::  divz(:)

##############################
divz    => c_s%divz
##############################
主程序中use module
call mpi_sum_z(divz(1),i_root,myid,nnz,1)####这里nnz=256

##############################
子程序
subroutine mpi_sum_z(f,i_root,myid,nsend,iall)

#--------- get sums on root or all processors
#          for all z for vector f(i)
#
include 'mpif.h'
integer istatus(mpi_status_size)
real      recv_b(nsend)
real      f(nsend)


call mpi_reduce(f,recv_b,nsend,mpi_real8,mpi_sum,i_root,
  &                  mpi_comm_world,ierr)
do i=1,nsend
         f(i) = recv_b(i)
  enddo

end
#######################################

希望大家帮忙看一下哪里程序出了问题,谢谢大家!!




欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2