This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g77 & RAM access
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Anuchit Aromsawa <g4136819 at student dot mahidol dot ac dot th>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 22 Jan 2003 18:53:43 +0100
- Subject: Re: g77 & RAM access
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <1043234776.3e2e7fd89be7a@webmail.mahidol>
Anuchit Aromsawa wrote:
What is the maximum physical memory (RAM) on PC
that g77 (or other fortran) can adrress?
Please correct me if I am wrong. For 32-bit fortran
compiler (g77 or others), there are 2^31 - 1 =
2,147,483,647 pointers or 2,147,483,647*8 =
17,179,869,176 byte of double precision.So 16 GB is
the answer,isn't it? However, the Linux 2.4.X provides
only 2.3GB - 3GB, the maximun of memory per single
process
(http://www.spack.org/index.cgi/LinuxRamLimits). It
means that g77 (or others) is reliable for less than 3GB
on PC-Linux system, doesn't it?
Well, obviously, on an architecture that uses 32 bit pointers and byte
addresses, you cannot address more than 4 Gbyte. Linux goes out of its
way to give you 3 usable Gbytes, but that's about it.
g77 can address an array that has a maximum size of 2 Gbyte, because the
compiler must allow for code with negative subscripts (so it can only
address 2**31-1 bytes).
On a 64 bit target, using normal integers (which by default will be 32
bit quantities, you can address an array with 2**31-1 double precision
values, or about 2**34 = 16 GByte of memory.
If you really need this, you want to wait for the AMD Hammer series of
CPUs to appear on the market.
--
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
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)