arrays - 读取巨大输入文件时出现 Fortran“附加重定位溢出”错误
问题描述
我有以下输入文件
4400000
1 4 4 7056 4203 7190 2856 0 0 0 0 0 0 0 0.942 0.93 0.944 0.925 0 0 0 0 0 0 3.846 0.0 1.627
2 3 3 8553 481 7734 0 0 0 0 0 0 0 0 0.63 0.923 0.322 0 0 0 0 0 0 0 1.93 2.0 -0.792
3 3 2 7007 3625 0 0 0 0 0 0 0 0 0 0.359 0.93 0 0 0 0 0 0 0 0 1.889 2.0 -0.728
4 4 4 1611 854 7901 8306 0 0 0 0 0 0 0 0.923 0.944 0.936 0.915 0 0 0 0 0 0 3.867 0.0 1.488
5 3 4 7657 1180 6659 4147 0 0 0 0 0 0 0 0.332 0.69 0.346 0.574 0 0 0 0 0 0 1.969 2.0 -0.634
6 3 2 1978 523 0 0 0 0 0 0 0 0 0 0.931 0.917 0 0 0 0 0 0 0 0 1.849 2.0 -0.805
...
文件共有 27 列。我尝试使用
do l=1,num
read (1,42) atindex(l),atype(l),nbonds(l),(conn(l,j),j=1,10),molnr(l),(bos(l,j),j=1,10),abo(l),nlp(l),charge(l)
enddo
(num = 行数) 和
42 format (i7,13i7,11f7.3,f7.1,f7.3)
我使用英特尔编译器编译了这个。但是,这会产生以下“额外的重定位溢出”错误:
....
/opt/shared/intel/2018u4/compilers_and_libraries_2018.5.274/linux/compiler/lib/intel64_lin/libifcoremt.a(for_init.o): In function `for__signal_handler':
for_init.c:(.text+0x906): additional relocation overflows omitted from the output
由于列太多,它看起来像内存问题。当我只读取格式正确的整数列(第 14 列)时,该错误永远不会发生。但是,当我尝试读取实数时,就会发生错误。
这是研究服务器集群,而不是我的笔记本电脑或台式机,所以我无法修改英特尔编译器的安装设置。
我怎样才能摆脱这个问题?
解决方案
从 intel fortran 论坛我了解到可以通过以下方式编译来逃避这个问题:
ifort abc.f -mcmodel 中等 -o abc
还建议阅读有关此问题的内容:
推荐阅读
- php - Laravel 配置文件的 apache2 域名和目录根位置是什么?
- powershell - 在数组中查找字符串 Powershell V2.0
- c# - WPF C# WebView在win 10上不显示任何页面
- python - 将 matplotlib 条形图打印到 txt 文件
- ionic3 - Ionic 3 和 Identity server 4 示例代码
- firebase - 将 Ionic 视频 fileURI 转换为 dataURL,用于 Firebase 上传
- java - 将 jpa (Hibernate) 中的本机 (join) 查询转换为 json
- ios - 文件存在于 iCloud 中,但 query.resultCount = 0
- docker - Docker 容器的镜像名称问题
- json - 错误:列表
不是 Map 类型的子类型