读取巨大的输入文件时 Fortran "additional relocation overflows" 错误
Fortran "additional relocation overflows" error while reading huge input file
我有以下输入文件
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)
我使用英特尔编译器编译了这个。但是,这会产生以下 "additional relocation overflows" 错误:
....
/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
还建议阅读有关此问题的文章:
我有以下输入文件
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)
我使用英特尔编译器编译了这个。但是,这会产生以下 "additional relocation overflows" 错误:
....
/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
还建议阅读有关此问题的文章: