Closed
Description
As I mensioned in title, here is my code, it works when nx_g<=10000, but can't works over it. Error info: [42194] signal (11.1): Segmentation fault. My compute mem morethan 700G
function get_Axy_MPI(nx_g, nx0, rank, nprocs, k)
u_local = zeros(nx0, nx_g)
if rank == 0
A = zeros(nx_g, nx_g)#calculate_Axy(k) #get_A()#zeros(nx_g, nx_g)
for sendrank in 0:nprocs-1
# 计算每个进程的起始行和结束行
if sendrank == 0
ilo = 1
ihi = rows_per_process[1]
# @show sendrank, ilo,ihi
else
ilo = sum(rows_per_process[1:sendrank]) + 1
ihi = ilo + rows_per_process[sendrank+1] - 1
@show sendrank, ilo,ihi
end
#data_on_root = A[ilo:ihi, :]
sendtag = sendrank + 1000
MPI.Isend(A[ilo:ihi, :], sendrank, sendtag, comm)
@show ilo, ihi
end
end
recievetag = rank + 1000
MPI.Irecv!(u_local, root, recievetag, comm)
if rank ==0 println("Done!!!")end
MPI.Barrier(comm)
return u_local
end