Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Static array more then 2Gb

Alexey_B_1
Beginner
482 Views

I have a small code for initializing the static array and writing it to file. The size of array is 5000000 of reals. I have the  Visual Fortran Compiler XE 13.1.0 and my Win 10 x64 show “This app can’t run on this PC”. If I made the size array of 490000000 the program runs fine and file for001 have a 1861 Mb size on HDD. If I make the static array allocatable the size my be more large then 490000000. Unfortunately I can make array only static.

   program MemoryTest
!    allocatable f(:)
    dimension f(490000000) 
    real f
    ! Body of MemoryTest
    i=490000000
!    allocate (f(i))
    open (1,file='for001',status='unknown',form='unformatted')
    do j = 1, i
     f(j)=j*1.0d0
    end do 
    write (1) f
    end program MemoryTest

 

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
482 Views

There is a limitation on Windows where the Linker cannot construct a segment (code or data section) that exceeds the 2GB limit (or 3GB in a special setup).

Why is it that you have to keep the array static?

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
482 Views

2GB is the limit. See https://software.intel.com/en-us/articles/memory-limits-applications-windows

0 Kudos
Alexey_B_1
Beginner
482 Views

Thank you very much for the advice. You are working wary fast like Intel Compilers! 

0 Kudos
Reply