我有以下输入文件
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)
我使用intel编译器对此进行了编译。但是,这会产生以下“其他重定位溢出”错误:
....
/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编译器的安装设置。
如何摆脱这个问题?
从intel fortran论坛中,我了解到可以通过以下方式进行编译来逃避此问题:
ifort abc.f -mcmodel medium -o abc
也建议阅读有关此问题的内容: