For Programmers: Free Programming Magazines  


Home > Archive > Fortran > August 2005 > maximum array size for g77 compiler









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author maximum array size for g77 compiler
stefan

2005-08-23, 7:57 am

Hello!

I seem to be hitting the maximum array size usin the GNU Fortan
compiler (GNU Fortran 0.5.25 20010315 on Windows/Cygwin).

See below some code with which I tested that a 3-dimension array of
258x228x600 works fine; however enlarging it to 258x228x1200 results in
a program that compiles correctly, but does not execute.

- Could anybody tell me what is the exact limit for arrays in Fortran
77?
- Is there a way to work around that?

Thanks for any help,
Stefan


$ cat test1.f; g77 -o test1 test1.f
PROGRAM TEST1
REAL VALUES(258,228,600)
WRITE(*,*) 'The array was declared.'
END
$ ./test
The array was declared.
$ cat test2.f; g77 -o test2 test2.f
PROGRAM TEST2
REAL VALUES(258,228,1200)
WRITE(*,*) 'The array was declared.'
END
$ ./test2
$
$ # No output from the program, not even an error message.

Tim Prince

2005-08-23, 7:57 am

stefan wrote:
> Hello!
>
> I seem to be hitting the maximum array size usin the GNU Fortan
> compiler (GNU Fortran 0.5.25 20010315 on Windows/Cygwin).
>
> See below some code with which I tested that a 3-dimension array of
> 258x228x600 works fine; however enlarging it to 258x228x1200 results in
> a program that compiles correctly, but does not execute.
>
> - Could anybody tell me what is the exact limit for arrays in Fortran
> 77?
> - Is there a way to work around that?
>
> Thanks for any help,
> Stefan
>
>
> $ cat test1.f; g77 -o test1 test1.f
> PROGRAM TEST1
> REAL VALUES(258,228,600)


No, no one could tell you an exact limit for Fortran arrays. There
isn't any. g77, on a 32-bit platform, is limited to about 2GB, and that
limit is likely to apply to the program as a whole. That's one of the
reasons for the increasing popularity of "64-bit" systems. Running
32-bit Cygwin on 64-bit Windows may increase the overall limit somewhat,
but you still have the 32-bit limitation. Until recently, Cygwin put
much tighter limits on Fortran data space. The version number you quote
wouldn't help anyone.
Jan Vorbrüggen

2005-08-23, 7:57 am

Old versions of g77 used a 32-bit (signed?) counter to count the
size of an array in bits, not bytes, thus reducing the maximum
array size by a factor of 256. One fo the regulars did a patch
that rectified this some years ago, but quite likely after 2001...

Jan
Gordon Sande

2005-08-23, 7:00 pm

On 2005-08-23 08:54:22 -0300, Tim Prince <tprince@nospamcomputer.org> said:

> stefan wrote:
>
> No, no one could tell you an exact limit for Fortran arrays. There
> isn't any. g77, on a 32-bit platform, is limited to about 2GB, and that
> limit is likely to apply to the program as a whole. That's one of the
> reasons for the increasing popularity of "64-bit" systems. Running
> 32-bit Cygwin on 64-bit Windows may increase the overall limit
> somewhat, but you still have the 32-bit limitation. Until recently,
> Cygwin put much tighter limits on Fortran data space. The version
> number you quote wouldn't help anyone.


Wasn't there an additional bother that g77 measured the size of the array in
bits internally so the hardware limit on the compilers internal arithmetic
caused trouble much sooner than one would have expected. Operating system
limits ar still the first thing to check.



e p chandler

2005-08-23, 7:00 pm


Jan Vorbr=FCggen wrote:
> Old versions of g77 used a 32-bit (signed?) counter to count the
> size of an array in bits, not bytes, thus reducing the maximum
> array size by a factor of 256. One fo the regulars did a patch
> that rectified this some years ago, but quite likely after 2001...
>
> Jan


I just tested some recent compilers:

approx max size of 2 dimensional array
MinGW, Win32, XP(SP2) =3D ~ 1.8 GB

precision
single double
g77 old 8000 5000 v 2.95
g77 22000 15000 v 4.x
gfortran
g95*

* for g95 add -Wl,--heap=3D0x01000000

Janne Blomqvist

2005-08-24, 7:56 am

e p chandler wrote:
>
> Jan Vorbrüggen wrote:
>
> I just tested some recent compilers:
>
> approx max size of 2 dimensional array
> MinGW, Win32, XP(SP2) = ~ 1.8 GB
>
> precision
> single double
> g77 old 8000 5000 v 2.95
> g77 22000 15000 v 4.x


There exists no such thing as g77 4.x. g77 was replaced with gfortran
in gcc 4.0. Did you mean g77 3.4.x?

> gfortran
> g95*


Did you get any values for these?

--
Janne Blomqvist
e p chandler

2005-08-24, 6:59 pm

Janne Blomqvist wrote:
> e p chandler wrote:
>
> There exists no such thing as g77 4.x. g77 was replaced with gfortran
> in gcc 4.0. Did you mean g77 3.4.x?
>


Yes. It was the g77 included with MinGW 4.1. Sorry about the confusion.
MinGW lags behind gcc and has different version numbers too. :-).

>
> Did you get any values for these?
>
> --
> Janne Blomqvist


Almost the same values.

For g95 without the -Wl,--heap=3D0x01000000
single was about 3400 and double was about 2400.

Dave Thompson

2005-08-27, 6:58 pm

On Tue, 23 Aug 2005 14:29:51 +0200, Jan Vorbrüggen
<jvorbrueggen-not@mediasec.de> wrote:

> Old versions of g77 used a 32-bit (signed?) counter to count the
> size of an array in bits, not bytes, thus reducing the maximum
> array size by a factor of 256. One fo the regulars did a patch
> that rectified this some years ago, but quite likely after 2001...
>

I believe that was a factor of 8, not 256.

- David.Thompson1 at worldnet.att.net
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com