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

Insufficient virtual memory

emersonone
Beginner
2,673 Views

I just have xp 64 bit OS installed. I have both IA-32 and Intel-64 compilers. When I try to run the code with big one dimensional array (1024x1024x780), it says I have insufficient virtual memory. I am sure I have enough virtual memory (8G), 4G physical memory. I did swith the compiler from win32 to x64 under Tools->Options->Intel Fortran->General. Is there anything else I need to do in order to use 64 bit compiler. I also tried to install Intel-64 compiler only (without IA-32), then visual studio says cannot find ifort. I guess I have problem to configure x64 compiler. Please advise.

BTW, the code runs seamlesslyunder dos environment.

Thanks.

0 Kudos
10 Replies
Steven_L_Intel1
Employee
2,673 Views
The program with the large array runs from the command line?

If you have simply declared a large array, that won't work, even on x64, as Windows limits static code and data to 2GB. You will need to use an ALLOCATABLE array to get that large.

You should be able to install the 64-bit compiler without the 32-bit. But you need to make sure that the proper compiler is selected under Tools > Options.
0 Kudos
emersonone
Beginner
2,673 Views

Steve,

Here is the sample code

Program Main
ALLOCATABLE :: PNEW(:)
M=1024*1024*780

ALLOCATE (PNEW(0:M))

DO J=1,M
PNEW(J)=J
ENDDO

WRITE(*,*) PNEW(M)

DEALLOCATE (PNEW)

END

As you can see, I did use dynamic allocation. If I compile the code using ifort in command line, it runs ok. But with VS05, I can compile it,will get error "forrt1: severe(41) insufficient virtual memory". I did choose x64 compiler in tools->option.

I installed both win32 and x64 compilers, even I chose x64 compiler under tools->option->intelfortran->x64, the system still used win32 compile the code. I did the following test: first I install both win32 and x64 compilers, I can compile the code, then I uninstall win32 compiler (untouch x64), choose x64 compiler under tools->option. Then the code wouldn't compile at all because error message shows"The fortran compilerifort.exe cannot be find. The same thing happens if I only install x64 compiler. The problem is the system cannot find x64 compiler at all although I did see x64 installed in my computer.

Please help,

Thanks

0 Kudos
Steven_L_Intel1
Employee
2,673 Views
I don't quite follow your last paragraph, but you do need to select the x64 build configuration by selcting Build> Configuration Manager. Then under Active Solution Platforms, select New. For the new platform select x64 and click ok. This is described in the on-disk documentation. The other things you did do NOT select the compiler in use.
0 Kudos
emersonone
Beginner
2,673 Views
Thanks, that works.
0 Kudos
emersonone
Beginner
2,673 Views
Quoting - emersonone

Steve,

Here is the sample code

Program Main
ALLOCATABLE :: PNEW(:)
M=1024*1024*780

ALLOCATE (PNEW(0:M))

DO J=1,M
PNEW(J)=J
ENDDO

WRITE(*,*) PNEW(M)

DEALLOCATE (PNEW)

END

As you can see, I did use dynamic allocation. If I compile the code using ifort in command line, it runs ok. But with VS05, I can compile it,will get error "forrt1: severe(41) insufficient virtual memory". I did choose x64 compiler in tools->option.

I installed both win32 and x64 compilers, even I chose x64 compiler under tools->option->intelfortran->x64, the system still used win32 compile the code. I did the following test: first I install both win32 and x64 compilers, I can compile the code, then I uninstall win32 compiler (untouch x64), choose x64 compiler under tools->option. Then the code wouldn't compile at all because error message shows"The fortran compilerifort.exe cannot be find. The same thing happens if I only install x64 compiler. The problem is the system cannot find x64 compiler at all although I did see x64 installed in my computer.

Please help,

Thanks


Steve,

I use x64 compiler and was able to increase M to 1024x1024x2047. When I change M to 1024x1024x2048, a error message pops out: forrt1: severe (408): fort: (3): subscript #1 of the array PNEW has value -2147483648 which is less than the lower bound of 0. I guess with x64 compiler, I still can only use up to 2G memory, right? How to break the limit?

Thanks,

Emersonone
0 Kudos
Steven_L_Intel1
Employee
2,673 Views
Perhaps add:

INTEGER(8) :: M

?
0 Kudos
emersonone
Beginner
2,673 Views
Perhaps add:

INTEGER(8) :: M

?

I tried, same error. Here is the test source code:

Program Main
!(1) Data definition
Integer(8) :: M
ALLOCATABLE :: PNEW(:)
c REAL PNEW(10240*1024*50)
!(2) Allocate memory

c M=2*EXP(120.0)
! 1024x1024x2047 for 64 bits compiler maximum
! M=1024*1024*426
M=1024*1024*2048
ALLOCATE (PNEW(0:M))

!(3) Use it as before

DO J=1,M

PNEW(J)=J
ENDDO

WRITE(*,*) PNEW(M)

WRITE(*,*) "Done"

!(4) Release the memoy
DEALLOCATE (PNEW)

END
0 Kudos
Steven_L_Intel1
Employee
2,673 Views
M=1024_8*1024_8*2048_8

Your expression is "default integer" and is overflowing.

0 Kudos
emersonone
Beginner
2,673 Views
M=1024_8*1024_8*2048_8

Your expression is "default integer" and is overflowing.


So what is the solution? Swith to 4?

Thanks.
0 Kudos
Steven_L_Intel1
Employee
2,673 Views
The solution is to use the form I gave above with the _8.
0 Kudos
Reply