This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Large Arrays/Commons
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: plischke at isam dot de
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 10 Dec 2002 00:40:27 +0100
- Subject: Re: Large Arrays/Commons
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200212091846.TAA05875@hp3.isam.de>
plischke@isam.de wrote:
eventually somebody can help (or tell me that there is no solution):
- I have a rather complex finite element code (to be compiled with g77)
and would like to run
a bigger model than previously. I have however problems in using
sufficiently large arrays.
I split the large arrays into three COMMON BLOCKS, e.g.
COMMON /A(50000000)
COMMON /SOL1/ B(28000000)
COMMON /SOL2/ C(56000000)
with IMPLICIT REAL*8 (A-H,O-Z)
I can compile and link without problems,
but get a segment violation at excution (immediately, and also if
a use just a main program for storage allocation (i.e. don't call
any subroutines)
I suppose that the maximum storage to be allocated is limited by the
physical memory of my PC (1 GB), because there are no problems as long
as the sum of all allocated storage is araound 900 MB.
Is there any solution?
Do you need more information?
Well, actually, we do (for instance, what operating system are you using
on this PC? Windows, DOS, Linux, {Free|Net|Open}BSD, etc. ;-)
However, I'll cut you a deal: The problem you see is most probably
caused by the fact that on Linux, shared libraries are assigned memory
addresses from 2**30 onwards, i.e., at about 1 Gbyte.
If you compile and link your program statically, i.e., using the option
-static, you should be OK.
The maximum amount of memory you can use is the sum of RAM and SWAP sizes.
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)