fortran - fortran coarray 图像访问无法正常工作?
问题描述
使用一个简单的 gfortran coarray 程序。
由于某种原因,从根进程(例如 a[2])访问变量的图像不起作用。
我是否正确访问这些图像?是否有可能我错误地编译了 coarray 库?
coarray.f90
program coarraytest
implicit none
integer, codimension[*]:: a
integer:: tot
if(this_image()==1) then
a=10
endif
if(this_image()==2) then
a=20
endif
sync all ! synchronize
if(this_image()==1) then
tot=a+a[2]
print *, a, a[2], tot
end if
sync all
print *, this_image(), ': ', a
end program
输出
10 0 682453724
1 : 10
2 : 20
笔记
系统:
Ubuntu Linux 20.04
gfortran
OpenMPI (OpenRTE) 4.0.3
汇编:
caf coarray.f90 -o coarray.o
执行:
cafrun -n 2 coarraytest.o
解决方案
好的,看起来这是一个乐队安装。我首先点击了这个链接: https ://askubuntu.com/questions/1277932/cannot-install-open-coarrays-bin-for-gfortran-on-ubuntu-20-04
这是过时的。必须卸载所有垃圾并点击以下链接:
https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md#linux
推荐阅读
- c# - 如何导入CSV,它可以在某列的某些行中有换行符?
- ansible - 为什么打开 SSH 管道时 Ansible 有时不同步文件?
- .net - 项目找不到 DynamicComponent:Blazor
- java - 从 QueryResult Couchbase 响应中获取二进制文档
- java - 从 JFrog 存储库下载 yaml
- lua - Lua:用多个点对数字表进行排序
- typescript - 从 Typescript 中动态生成的数组创建联合类型注释
- python - 读取带有标题的 csv 文件并从 .json 文件读取 json 转换的模式,然后使用 python/pandas 生成 json 文件
- hive - fixed_size_binary ... 不支持从 ORC 数据格式转换
- python-3.x - 基于数据框列的点大小和颜色的散点图