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

maximum array size

Neil_S_
Beginner
3,539 Views
Is there a maximum array size that is allocatable using the intel compiler ?
0 Kudos
14 Replies
Steven_L_Intel1
Employee
3,539 Views
No - you're limited by what the operating system allows. The compiler does not impose its own limit.
0 Kudos
edouardoudet
Beginner
3,539 Views
Hi,

How is it possible to evaluate this maximum size : I work on an 64b opteron and installed successfully Intel's fortran compiler 8.* for 64b processors. I have no problem for compiling or linking but I was surprised to observe that the maximum array size didn't change from my 32b installation ... !? Is it normal ??

Thanks for your answer(s), Edouard.
0 Kudos
Steven_L_Intel1
Employee
3,539 Views
There is no easy way to determine it. If you are declaring a static array, there are limits of the linker and the image activator. Have you tried an allocatable array? What was the maximum size you managed to see?
0 Kudos
TimP
Honored Contributor III
3,539 Views
Does the -mcmodel= switch influence the maximum size of static arrays? I don't find documentation readily accessible.
0 Kudos
Steven_L_Intel1
Employee
3,539 Views
Hmm - yes, it might. Try -mcmodel=medium and see if it helps.
0 Kudos
Neil_S_
Beginner
3,539 Views
/opt/fc-8.1.023/bin/ifort -mcmodel=medium -c frxx5.f
ifort: Command line warning: ignoring unknown option '-mcmodel=medium'
I have seen this option on other compilers, not yours.
0 Kudos
Neil_S_
Beginner
3,539 Views
Try -fpic on your 64b machine, i think thismight help.
0 Kudos
edouardoudet
Beginner
3,539 Views
Actually the limit of size on my computer (the 64b Opteron AND on my 32b PC) is between 1E8 and 1E9 for the maximum size of an allocatable array for a DOUBLE PRECISION. I checked also that the stack size and the data seg size are unlimited.

The /proc/meminfo file gives me :

total: used: free: shared: buffers: cached:
Mem: 4088872960 97042432 3991830528 0 11104256 59793408
Swap: 4293910528 270786560 4023123968
MemTotal: 3993040 kB
MemFree: 3898272 kB

which seems to be sufficient !?

On the other hand, the greatest integer of kind=8 (obtained with the huge command) is the same as on a 32b : 2147483647. Again, I do not know if it is normal.

Thanks for your comments, Edouard.
0 Kudos
Steven_L_Intel1
Employee
3,539 Views
If you are seeing the same result for HUGE of an INTEGER(8) as an INTEGER(4), there's an error in your program. Perhaps you are also misinterpreting the size numbers.
0 Kudos
edouardoudet
Beginner
3,539 Views
As you suggest, there was a problem in my program : I used a "Integer :: variable=kind(8)" statement instead of the declaration "Integer(8):: variable". I thought it was equivalent !

Yet I still do not understand why it is not possible to allocate a bigger array on my 64b processor than on my 32b PC. Do you have any idea considering the datas in a previous message ?

Thanks a lot for your answers.
0 Kudos
Steven_L_Intel1
Employee
3,539 Views
Let's see an example program, the commands you used to build it, and the results of running it. I know this works - I have seen it myself.
0 Kudos
edouardoudet
Beginner
3,539 Views
I used the followig test program :

**********************************************************
PROGRAM test64

IMPLICIT NONE

INTEGER(8) :: dimarray
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: testalloc

dimarray = 260000000
PRINT*,HUGE(dimarray)

PRINT*,"BEGIN ALLOCATION"
ALLOCATE(testalloc(dimarray))
PRINT*,"ALLOCATION SUCCESFULL",dimarray
DEALLOCATE(testalloc)

END PROGRAM test64
**********************************************************

+ I compiled and executed it on my PC (32b) with the standard

ifort test64.f90 -o test64
./test64

instructions. It is successfull. If ichange the value dimarray to 270000000. Iget the message :

Allocate error 494: Allocation of Array with extent of 270000000 failed



+ On the 64b processor compiled with the instruction :

/opt/intel_fce_80/bin/ifort test64.f90

the limit (computed manually changing the value of dimarray) is close from 1000000000. That is less than 5 times larger than the previous one.

With a greater integer I got the following message :

forrtl: severe (41): insufficient virtual memory
Image PC Routine Line Source
a.out 000000000043A2BE Unknown Unknown Unknown
a.out 0000000000439CE2 Unknown Unknown Unknown
...

Thanks.
0 Kudos
Steven_L_Intel1
Employee
3,539 Views
You're hitting an OS limit determined by your configuration. I don't know enough about Linux to advise you on this, except to say that it's not straightforward to configure a system that will allow more than 2GB allocations.
0 Kudos
hanswb
Beginner
3,539 Views
Hi,
I am able to compile and run the test program up to the size of the physical memory limit of 32 GB:
c5i5n13 .../development/x86_64 $ ifort test64.f90
c5i5n13 .../development/x86_64 $ a.out
9223372036854775807
BEGIN ALLOCATION
ALLOCATIONSUCCESFULL 4000000000
It's a SuSE 9.1 x86_64 with Kernel 2.6.5-7.97-smpand Intel l_fce_pc_8.1.025
Hans
0 Kudos
Reply