gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1516 Posts in 502 Topics by 733 Members - Latest Member: tbickel3 October 29, 2020, 12:06:38 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Maximum F77 Executable Size Under W-7 Using 64bit working window.
gfx
gfxgfx
 

Author Topic: Maximum F77 Executable Size Under W-7 Using 64bit working window.  (Read 1954 times)

jmmckel

  • Newbie
  • *
  • Posts: 2
I am trying to create an executable for a code with large scratch arrays and for target sizes the linker balks at creating an executable greater than 80MBytes (assuming the limiting value is in MBYTES, 80000000.)

At any case the code array requirements have to be reduced significantly for the linker to produce an executable.

Is the limiting factor related to F77?

Many thanks!

John McKelvey
jmmckel@gmail.com

cag

  • Newbie
  • *
  • Posts: 16
Re: Maximum F77 Executable Size Under W-7 Using 64bit working window.
« Reply #1 on: December 08, 2016, 02:19:19 PM »
The maximum size for all  static data  (any combination of COMMON , SAVE, MODULE data or static storage option) in a Windows 64 bit program is 2 gigabytes. Exceeding this amount results in an error from the Microsoft linker:

LINK : fatal error LNK1248: image size (XXXXXXXXX) exceeds maximum allowable size (80000000), where XXXXXXX is the amount the current program is declaring. Both numbers are displayed as hexadecimal numbers,  so 80000000 is equal to 2,147,483,648 bytes or 2 gigabytes.

This is not a limitation of Absoft Pro Fortran. It is due to  the format of the Microsoft Windows Portable Executable (PE) file type, which is used to describe EXEs and DLLs . It has 32-bit fields for image section offsets and lengths and was not extended for 64-bit variants of Windows.  Here are the size limitations for both 32 and  64 bit Windows programs:

32-bit

   Static data - 2GB
   Stack data - 1GB
   Dynamic data - 2GB

64-bit

   Static data - 2GB
   Stack data - 1GB
   Dynamic data - 8TB

The  way to use more that 2GB of data is to declare  large arrays as allocatable.

jmmckel

  • Newbie
  • *
  • Posts: 2
Re: Maximum F77 Executable Size Under W-7 Using 64bit working window.
« Reply #2 on: December 08, 2016, 04:29:20 PM »
CAG,

Thanks.  When I compiled using fixed array sizes the sizes were set to be just over the size required for the case under investigation.  So, do your comments mean that I can get around this problem by "allocating size" (to be the same as was used before) ?

John

cag

  • Newbie
  • *
  • Posts: 16
Re: Maximum F77 Executable Size Under W-7 Using 64bit working window.
« Reply #3 on: December 09, 2016, 10:50:36 AM »
What I meant was you can work around the static data size restriction by changing the type
of your arrays. Here is an example program that declares a pair of three gigabyte static arrays:

   PROGRAM MAIN
   IMPLICIT NONE
   REAL(KIND=8) :: first(50331648,8)
   REAL(KIND=8) :: second(50331648,8)
   SAVE first,second
   first(1,8) = 1.0D0
   second(8,1) = 2.0D0
   END

Compiling this code in 64 bit project produces the expected linker error:

LINK : fatal error LNK1248: image size (8002E000) exceeds maximum allowable size (80000000)

Modifying the code to use allocatable arrays allows the code to link successfully:

   PROGRAM MAIN
   IMPLICIT NONE
   REAL(KIND=8),ALLOCATABLE :: first(:,:)
   REAL(KIND=8),ALLOCATABLE :: second(:,:)
   INTEGER alloc_err
   
   ALLOCATE(first(50331648,8),STAT=alloc_err)
   ALLOCATE(second(50331648,8),STAT=alloc_err)
   
   IF (alloc_err .NE. 0) THEN
     WRITE(*,*) "Array allocation failed, error ",alloc_err
   ELSE   
     first(1,8) = 1.0D0
     second(8,1) = 2.0D0
   END IF
 
   END

The maximum size of allocatable data is 8 terabytes but in reality, it is  limited to the
amount of virtual memory configured for a particular system.  Exceeding  the amount
of installed  physical memory by a large amount will a have a very noticeable
impact on performance.

Absoft User Forum  |  Support  |  General  |  Maximum F77 Executable Size Under W-7 Using 64bit working window.
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!