fortran - Breakpoint on MPI_ALLREDUCE in fortran function
问题描述
I'm working on code that calls a function which returns real(8). I wish to parallelize this program with MPI, so funcion is calling by all processes, thats why I'm using MPI_ALLREDUCE. The problem is when I launch the program, it calls breakpoint on MPI_ALLREDUCE with no additional info. Can anyone suggest the reason of this? Function code:
real(8) function distanse(X,Y,ArrX,ArrY,pointsCount,procSize,rank)
real(8),intent(in) :: X,Y,ArrX(:),ArrY(:)
integer,intent(in) :: pointsCount
integer,intent(in out) :: procSize, rank
real(8) d,local_dmin,global_dmin
integer i,start_i,end_i,count_i,ierror
interface
real(8) function distOtr(X,Y,X1,Y1,X2,Y2)
real(8),intent(in) :: X,Y,X1,Y1,X2,Y2
end function distOtr
end interface
local_dmin = 10000
start_i = 1+rank*procSize;
count_i = pointsCount/procSize
end_i = start_i+count_i-1
if (end_i.LT.pointsCount+1) then
if (pointsCount-end_i.LT.count_i) end_i = pointsCount
do i=start_i,end_i-1,1
d = distOtr(X,Y,ArrX(i),ArrY(i),ArrX(i+1),ArrY(i+1))
if (d.LT.local_dmin) local_dmin = d
end do
endif
call MPI_ALLREDUCE(local_dmin, global_dmin, 1, MPI_REAL8, MPI_MIN, MPI_COMM_WORLD, ierror)
distanse = global_dmin
end function distanse
解决方案
推荐阅读
- python - 有序 = True 不被尊重。蟒蛇+棉花糖+烧瓶
- charts - Overlapp Google area图表
- swift - SwiftUI managedObjectContext 在 appExtension 中加载
- python - Python 正则表达式从字符串中获取浮点数对(如果存在)
- azure-web-app-service - .net core 3.1 Azure 多实例扩展应用服务中不尊重 web.config 设置?
- html - Outlook 和其他表格行和行内的电子邮件 HTML 间距不一致
- android - 我如何获得某些特定对象的改造响应并对它们进行排序?
- c# - 将解决方案文件夹移动到新计算机后,SQlite 异常无法连接到数据库
- html - 图表不使用 Flex 的可用空间
- python - ImportError:无法从“skimage.draw”导入名称“disk”