ifort 記憶體使用超過2GB的解決方法
編譯器版本是
Intel(R) Fortran Intel(R) 64 Compiler XE for applications
running on Intel(R) 64, Version 12.1.4.319 Build 20120410
系統是 64位元 Linux fedora core 14
kernel版本 2.6.35.14-106.fc14.x86_64 #1 SMP
4 GB 的記憶體
以下是程式碼:
如果將最後一行註解 write(*,*) v5(100)
就可以編譯,且成功正確執行。
真的很奇怪!
program hmwf
implicit none
integer(4),parameter :: lmax=45000000
real(8),dimension(lmax) :: v1,v2,v3,v4,v5,v6
integer(4) :: max,i,j
real(8) :: su1,su2,su3
max=45000000
do j=1,100
su1=0.d0
su2=0.d0
su3=0.d0
do i=1,max
v1(i)=1.d10
v2(i)=v1(i)
v3(i)=v1(i)
v4(i)=v3(i)
v5(i)=v3(i)
v6(i)=v3(i)
su1=su1+v1(i)**2
su2=su2+v2(i)**2
su3=su3+v3(i)**2
enddo
write(*,*) 'j=',j,v6(max),v4(1)
enddo
write(*,*) v5(100)
end program hmwf
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.81.104
→
05/23 12:16, , 1F
05/23 12:16, 1F
※ 編輯: YCTzeng 來自: 118.168.81.104 (05/23 12:19)
→
05/23 12:18, , 2F
05/23 12:18, 2F
→
05/23 12:22, , 3F
05/23 12:22, 3F
→
05/23 12:35, , 4F
05/23 12:35, 4F
→
05/23 12:36, , 5F
05/23 12:36, 5F
→
05/23 12:40, , 6F
05/23 12:40, 6F
→
05/23 12:41, , 7F
05/23 12:41, 7F
→
05/23 12:51, , 8F
05/23 12:51, 8F
→
05/23 12:52, , 9F
05/23 12:52, 9F
推
05/23 15:16, , 10F
05/23 15:16, 10F
→
05/23 22:04, , 11F
05/23 22:04, 11F
推
05/24 00:02, , 12F
05/24 00:02, 12F
→
05/24 00:04, , 13F
05/24 00:04, 13F
→
05/24 00:05, , 14F
05/24 00:05, 14F
→
05/24 00:28, , 15F
05/24 00:28, 15F
→
05/24 04:08, , 16F
05/24 04:08, 16F
推
05/24 18:42, , 17F
05/24 18:42, 17F
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章