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

Large dynamic memory allocation in IVF

wisperless
Beginner
606 Views

Hey, I am wondering if there is anyway that I could possibly allocate a very large size of array. like test is a 2 dimensinonal array

real, allocateable::test(:,:)

integer index

index=253592

allocate(test(index,index),state=error) ! ====> I can not allocate this way, program exits

allocate(test(23592,23592),state=error) ! ====>but ICAN allocate this way

In order to allocate this kind of big arrays, I am using 64 bits with the windows XP (64bit) OS. My problem is why I can not allocate a large array when the size is large using a variable? any trick here?

Thank you in advance!

0 Kudos
12 Replies
Steven_L_Intel1
Employee
606 Views
I can't think of why this should be. Please report this to Intel Premier Support and attach a test case.
0 Kudos
wisperless
Beginner
606 Views

Steve, thank you.

I am wondering there is any way in theFORTRANthat I can allocate a large size of array because I have to allocate a 60,000x60,000 two dimensional real type array in my application. I am using 64bits machine on windows XP, IVF9.1 and VC++2005. Thank you!

0 Kudos
wisperless
Beginner
606 Views
I forgot to mention that I could allocate two 30,000x60,000 arrays, but I can not allocate a 60,000x60,000 array. Is there any limitation in the IVF array size allocation.
0 Kudos
Steven_L_Intel1
Employee
606 Views

There is no Fortran-related limit. A system call is made to do the allocation, and it either succeeds or fails. You are using the "EM64T" compiler, right?

The behavior you described earlier where constants work but variables don't is strange and I'd ask again that you submit a test case.

0 Kudos
wisperless
Beginner
606 Views

Steve, Thank you for your reply.

Yes, I am using EM64T (IVF FORTRAN 9.1) integrated with VC++ 2005 compiler. Ls it meaning that the windows XP can not allocate that large of array (60,000x60,000) though allow allocating two smaller arrays (30,000x60,000)?

I double checked my code. I found that the problem I mentioned earlier is my own mistake. I had Index=53292, while when I allocated the array using digits, I used 23292. Sorry for the confusion.

0 Kudos
Steven_L_Intel1
Employee
606 Views

There are many possibilities. First, two smaller arrays might work if there is not contiguous address space available for the bigger array. Your total virtual address space is also limited by swapfile space. Physical RAM has some effect on this as well.

Build and run this test program and see what it reports for available virtual address space.

0 Kudos
wisperless
Beginner
606 Views

Steve, Thank you for your reply and the test program, the following is my test result. I do not quite under those numbers. Could you tak a look and tell me that it is possible for me to allocate a real type 60,000x60,000 two dimensional array in the FORTRAN? Thank you very much!

Memory load = 15 %
Total physical memory = 8520585216
Available physical memory = 7203115008
Total page file = 11383652352
Available page file = 10253570048
Total virtual address space = 8796092891136
Available virtual address space = 8796084289536
Available extended virtual address space = 0
0 Kudos
Steven_L_Intel1
Employee
606 Views

That array would be 14GB. It looks to me as if your pagefile is too small to handle that, as you have only about 10GB of available page file space. I'd suggest setting the pagefile size to at least 30GB if not larger.

0 Kudos
wisperless
Beginner
606 Views

Steve, Thank you for your advice. I am wondering it would cause the system crash or unreliable if I set the page file to 30GB?

Thank you again!

0 Kudos
Steven_L_Intel1
Employee
606 Views
It should not cause any problems, as long as there is sufficient disk space on the disk where the pagefile resides. You may want to consider using a disk other than the boot disk for the large pagefile for better performance. It would also help to defragment the drive so that the pagefile is as contiguous as possible.
0 Kudos
wpitts
Beginner
606 Views
I can offer a couple of ideas on Steve's suggestion for the page file. First, if you are not already using one, maybe consider getting one of the 10,000 rpm or 15,000 rpm drives and move the pagefile to this drive. Also, there are several vendors that offer software that will optimize and defragment the pagefile offline (Windows XP doesn't allow this). I have had good success with one product, but this was not for 64 bit windows. Having a fast disk and a defragmented pagefile should be a big help.

Also, Gigabyte offers a RAM drive that should look to the computer just like a SATA drive. Unfortunately, it only has 4 slots for RAM and SATA 1.5 gbs. Other users might find this useful (I haven't tried this, so take it for what it's worth).

0 Kudos
wisperless
Beginner
606 Views

Thank you "war eagle" and Steve. I took Steve's suggestion and create a large pagefile on the unbootable drive, and it works fine. ^_^

0 Kudos
Reply