|
[Sponsors] |
October 21, 2008, 00:54 |
largest one-dimensional array in fortran 77
|
#1 |
Guest
Posts: n/a
|
hi there i have a one-dimensional array in fortran 77: A(N), intended to store a very long list of particles. the largest N that i could have currently is around 1.2 millions. larger than that, the compilier wont work. Is there a way to increase N far beyond 1.2 millions, eg. 5 millions? thanks in advance
|
|
October 21, 2008, 04:43 |
Re: largest one-dimensional array in fortran 77
|
#2 |
Guest
Posts: n/a
|
Uh, the *compiler* won't work? What compiler? The compiler shouldn't complain up to 2^32. With a 32-bit OS, your program won't be able to address more than 2^31 total bytes. But these are run-time issues, and you need to be orders of magnitude larger to run into them.
|
|
October 21, 2008, 04:46 |
Re: largest one-dimensional array in fortran 77
|
#3 |
Guest
Posts: n/a
|
hi.. the limit is around 5 millions entry in the array, but still think of getting it even larger. regret for the wrong info of 1.2 millions.
|
|
October 21, 2008, 04:49 |
Re: largest one-dimensional array in fortran 77
|
#4 |
Guest
Posts: n/a
|
i am using compaq visual fortran 2000 currently. the data is double precision. thanks.
|
|
October 21, 2008, 08:40 |
Re: largest one-dimensional array in fortran 77
|
#5 |
Guest
Posts: n/a
|
When you say "the compiler won't work", do you mean that the code will not compile, or the resulting executable will not run?
|
|
October 21, 2008, 23:23 |
Re: largest one-dimensional array in fortran 77
|
#6 |
Guest
Posts: n/a
|
hi.. the compiler does compile, but gives warning message:
for five million entries: warning LNK4084: total image size 1813958656 exceeds max (268435456); image may not run for six million entries: warning LNK4084: total image size -2137006080 exceeds max (268435456); image may not run the generated exe file for 5 million entries is ok, but that with six million entries does not run. any light cast on the matter is deeply appreciated. |
|
October 22, 2008, 05:55 |
Re: largest one-dimensional array in fortran 77
|
#7 |
Guest
Posts: n/a
|
Could you post the code that triggers this? Somehow your program is putting this array in the text segment (the actual executable image) many times. An array of 5M double precision values should be 40MB, but your image is more than 2GB (hence 32-bit signed integer indices overflow, or if you're on a 32-bit architecture the OS simply won't run it). Normally the compiler will allocate large arrays on the heap so they don't effect the image size and you are only limited by available memory.
|
|
October 22, 2008, 09:40 |
Re: largest one-dimensional array in fortran 77
|
#8 |
Guest
Posts: n/a
|
Is your array static (e.g. defined using common or data). Or is it a local variable? If it's a local variable, you'll run into stack size limits quite quickly.
|
|
October 22, 2008, 09:43 |
Re: largest one-dimensional array in fortran 77
|
#9 |
Guest
Posts: n/a
|
hi the code is a bit too long to be posted here. i have a bunch of arrays with 5M entries. maybe it hits the limit of 2G. will check this. thank you.
|
|
October 22, 2008, 09:45 |
Re: largest one-dimensional array in fortran 77
|
#10 |
Guest
Posts: n/a
|
hi.. actually i have a few arrays with 5M entries. all these are defined using COMMON, global variables. thanks.
|
|
October 22, 2008, 14:58 |
Re: largest one-dimensional array in fortran 77---
|
#11 |
Guest
Posts: n/a
|
first you should learn fortran and then use dynamic memory.
|
|
October 23, 2008, 08:25 |
Re: largest one-dimensional array in fortran 77---
|
#12 |
Guest
Posts: n/a
|
The original poster is using F77. It's in the title of the post. Why he/she is choosing to use this vintage is not mentioned. However, it precludes anything dynamic.
|
|
October 23, 2008, 11:45 |
Re: largest one-dimensional array in fortran 77
|
#13 |
Guest
Posts: n/a
|
What kind of machine are you compiling & running on?
|
|
October 23, 2008, 11:52 |
Re: largest one-dimensional array in fortran 77
|
#14 |
Guest
Posts: n/a
|
hi..i am building on top of a flow solver written in fortran 77. the program is running on a machine with intel core 2 processor, 4Gb of memory, window vista. guess the system is sufficient for my purpose. thank you.
|
|
October 23, 2008, 14:48 |
Re: largest one-dimensional array in fortran 77
|
#15 |
Guest
Posts: n/a
|
64-bit OS? Can you compile a 64-bit binary? How large is the binary? Can you write the 4-line program that allocates a huge array and touches it? How large does the single array have to be to fail (link statically to give yourself the most possible room). If it's close to 2GB, then it's a real OS-level issue and you need to need a real 64-bit system to do better. If it's not close to 2GB, then the compiler is doing something weird.
|
|
October 24, 2008, 00:11 |
Re: largest one-dimensional array in fortran 77
|
#16 |
Guest
Posts: n/a
|
hi.. running 32bit os. will try that and will let u know the results. thanks!
|
|
October 24, 2008, 05:36 |
Re: largest one-dimensional array in fortran 77
|
#17 |
Guest
Posts: n/a
|
My question was because some F77 compilers require special switches to control max data size (e.g. xlf on AIX). Similarly, some operating systems have max data size per process hard-coded into the kernel (e.g. HP-UX), requiring a kernel rebuild to change it.
|
|
October 24, 2008, 15:09 |
Re: largest one-dimensional array in fortran 77
|
#18 |
Guest
Posts: n/a
|
Hello,
try to use a different compiler and see if you have the same problem. gfortran for Windows is a decent compiler. Paul |
|
October 27, 2008, 08:48 |
Re: largest one-dimensional array in fortran 77
|
#19 |
Guest
Posts: n/a
|
hi thanks!
|
|
October 29, 2008, 10:31 |
Re: largest one-dimensional array in fortran 77
|
#20 |
Guest
Posts: n/a
|
Here is a very simple f77 code to test the limits. On WinXP/Visual Studio fortran (v6.6) it gave warning at a much lower dimension than expected (I think 2^28 bits ~ 268M real*4) and on slightly larger array - it crashed. On linux/g77 it ran near the theoretical 2^32 bits when the array was in a common block, as explained formerly in this thread. If you play with this code, you may find whether you have a specific fortran/OS limitation.
I hope that helps, Rami __________________________________________________ ___ program zz parameter (m=29) c parameter (i=2**m) parameter (i=536770912) c real*4 a(i) integer a(i) common a print *, 'm, i = ', m, i sum = 0. do k=1,i a(k) = k sum = sum + a(k) enddo print *, 'a(1), a(i), sum = ', a(1), a(i), sum end |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
An unknown array definition in fortran | morteza08 | Main CFD Forum | 0 | June 20, 2011 05:32 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
Array Comparison in Fortran 90/95 | M Malik | Main CFD Forum | 4 | September 11, 2008 15:14 |
Compaq Visual Fortran - array, debug | CFD Student | Main CFD Forum | 0 | May 10, 2008 08:59 |
Array Visualizer in Visual Fortran | Krishna | Main CFD Forum | 0 | December 6, 2004 04:23 |