Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* max. array size GNU C compiler...
@ 1999-08-19  4:00 EKK
  1999-08-19  4:00 ` Dann Corbit
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: EKK @ 1999-08-19  4:00 UTC (permalink / raw)


What is the maximum array size, using GNU C compiler?

It looks like g77 complains after about 12000000.

I'm considering getting an Alpha system with 2GB RAM, but
don't know if I'll be able to compile software to handle
it.
Would a 64-bit system make a difference?  I would guess the
compilers would have to be re-written.

Is there a commercial compiler which could handle this
size?

Anybody got any idea?  I had never considered a 64-bit
system such as Alpha before, but now might be the time...

Anybody using g77 on Alpha, do you know if there is a
limitation?



thanks,

AG
-- 


Alessandro Giachino,  Software Engineer

EKK Inc.
2065 West Maple C309        tel. 248-624-9957
Walled Lake MI 48390        fax. 248-624-7158
_____________________________________________
                        http://www.ekkinc.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00 max. array size GNU C compiler EKK
  1999-08-19  4:00 ` Dann Corbit
@ 1999-08-19  4:00 ` Ben Pfaff
  1999-08-19  4:00   ` EKK
  1999-08-20  4:00 ` Volker Hetzer
  2 siblings, 1 reply; 12+ messages in thread
From: Ben Pfaff @ 1999-08-19  4:00 UTC (permalink / raw)


EKK <ekk@ekkinc.com> writes:

   What is the maximum array size, using GNU C compiler?

   It looks like g77 complains after about 12000000.

Ask somewhere appropriate, like gnu.gcc.help.

And WTF do you have to declare this array statically?
-- 
"In My Egotistical Opinion, most people's C programs should be indented six
 feet downward and covered with dirt." -- Blair P. Houghton



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00 ` Ben Pfaff
@ 1999-08-19  4:00   ` EKK
  1999-08-19  4:00     ` Ben Pfaff
  1999-08-19  4:00     ` Thomas_Matthews
  0 siblings, 2 replies; 12+ messages in thread
From: EKK @ 1999-08-19  4:00 UTC (permalink / raw)


> And WTF do you have to declare this array statically?

would it make a difference if I didn't declare statically AND
needed that much room?

BTW WTF don't you spell out your cute TLA's?


AG



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00   ` EKK
  1999-08-19  4:00     ` Ben Pfaff
@ 1999-08-19  4:00     ` Thomas_Matthews
  1999-08-20  4:00       ` EKK
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas_Matthews @ 1999-08-19  4:00 UTC (permalink / raw)


In article <37BC4A9E.D3CC7FEC@ekkinc.com>,
  EKK <ekk@ekkinc.com> wrote:
> > And WTF do you have to declare this array statically?
>
> would it make a difference if I didn't declare statically AND
> needed that much room?
>
> BTW WTF don't you spell out your cute TLA's?
>
> AG

Some compilers put static and dynamic memory in different areas.  Some
compilers have limitations on static memory size, but the limit on
dynamic memory is based on the amount of memory in the machine.

An N-bit machine does not guarantee that it contains a lot of memory.
If I have an 8-bit machine with 32M of memory and a 64-bit machine with
16 megs of memory, what does this tell you?  The N-bit machine can
ACCESS a wider range of memory than an M-bit machine, provided that M <
N.

Another question is:  Do you really need all those values in memory at
the same time?  Can you store the values in a file and only haul in
small pieces that you are working on? {Works with matrices, and tables}.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00   ` EKK
@ 1999-08-19  4:00     ` Ben Pfaff
  1999-08-19  4:00       ` EKK
  1999-08-19  4:00     ` Thomas_Matthews
  1 sibling, 1 reply; 12+ messages in thread
From: Ben Pfaff @ 1999-08-19  4:00 UTC (permalink / raw)


EKK <ekk@ekkinc.com> writes:

   > And WTF do you have to declare this array statically?

   would it make a difference if I didn't declare statically AND
   needed that much room?

It might.  Have you *tried* it?

   BTW WTF don't you spell out your cute TLA's?

Usenet has several common acronyms.  Figure out or look up what they
mean FCOL.
-- 
"You call this a *C* question? What the hell are you smoking?" --Kaz



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00     ` Ben Pfaff
@ 1999-08-19  4:00       ` EKK
  0 siblings, 0 replies; 12+ messages in thread
From: EKK @ 1999-08-19  4:00 UTC (permalink / raw)


> "You call this a *C* question? What the hell are you smoking?" --Kaz

when you compile using g77 it actually uses gcc...


AG
-- 


Alessandro Giachino,  Software Engineer

EKK Inc.
2065 West Maple C309        tel. 248-624-9957
Walled Lake MI 48390        fax. 248-624-7158
_____________________________________________
                        http://www.ekkinc.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00 max. array size GNU C compiler EKK
@ 1999-08-19  4:00 ` Dann Corbit
  1999-08-19  4:00   ` EKK
  1999-08-19  4:00 ` Ben Pfaff
  1999-08-20  4:00 ` Volker Hetzer
  2 siblings, 1 reply; 12+ messages in thread
From: Dann Corbit @ 1999-08-19  4:00 UTC (permalink / raw)


EKK <ekk@ekkinc.com> wrote in message news:37BC4252.F83CD3E@ekkinc.com...
> What is the maximum array size, using GNU C compiler?
>
> It looks like g77 complains after about 12000000.
Assuming doubles, that's about 100 megabytes.  Do you have:
0.  100 megs of memory?
1.  User rights to a block that large?

g77 is a Fortran compiler.  Why are you asking in news:comp.lang.c?

> I'm considering getting an Alpha system with 2GB RAM, but
> don't know if I'll be able to compile software to handle
> it.
> Would a 64-bit system make a difference?  I would guess the
> compilers would have to be re-written.
There are definitely compilers that will allocate huge amounts of memory.
For a problem that large, you should seriously consider looking into
commercial optimizing compilers.  KAP has a preprocessor for Fortran.  It
could make a considerable difference in performance.

> Is there a commercial compiler which could handle this
> size?
Probably.  But we have no idea what architecture you are using.  I think
you'de be hard pressed to find one for (for instance) CP/M.

> Anybody got any idea?  I had never considered a 64-bit
> system such as Alpha before, but now might be the time...
We use them here, and I love them.  But we Run OpenVMS and commercial
compilers.  I have no idea how G77 would fare on such a beast.

> Anybody using g77 on Alpha, do you know if there is a
> limitation?
Try one of the Fortran groups after reading their FAQ first.
--
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
 "The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. Newsgroup   http://www.dejanews.com/~c_a_p
C.A.P. FAQ: ftp://38.168.214.175/pub/Chess%20Analysis%20Project%20FAQ.htm





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00 ` Dann Corbit
@ 1999-08-19  4:00   ` EKK
  0 siblings, 0 replies; 12+ messages in thread
From: EKK @ 1999-08-19  4:00 UTC (permalink / raw)


Dann Corbit wrote:
> 
> EKK <ekk@ekkinc.com> wrote in message news:37BC4252.F83CD3E@ekkinc.com...
> > What is the maximum array size, using GNU C compiler?
> >
> > It looks like g77 complains after about 12000000.
> Assuming doubles, that's about 100 megabytes.  Do you have:
> 0.  100 megs of memory?
> 1.  User rights to a block that large?

that's right!  sorry, 120000000 (not 12million, 120million.)


thanks,

AG
-- 


Alessandro Giachino,  Software Engineer

EKK Inc.
2065 West Maple C309        tel. 248-624-9957
Walled Lake MI 48390        fax. 248-624-7158
_____________________________________________
                        http://www.ekkinc.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00     ` Thomas_Matthews
@ 1999-08-20  4:00       ` EKK
  1999-08-20  4:00         ` Andrew P. Mullhaupt
  1999-08-24  4:00         ` Toon Moene
  0 siblings, 2 replies; 12+ messages in thread
From: EKK @ 1999-08-20  4:00 UTC (permalink / raw)


> Some compilers put static and dynamic memory in different areas.  Some
> compilers have limitations on static memory size, but the limit on
> dynamic memory is based on the amount of memory in the machine.
>

it seems under IRIX, the limit is the system's stacksize, which you
can only change to the corresponding physical RAM and not beyond.

the stacksize on my Linux box is 'unlimited'...perhaps the limitation
is not in the system, but the compiler????

I've tried with an array that exceeds the physical 512MB of memory on
the Linux box.  The compiler does not seem to complain untill
beyond 1GB, but well before 2GB.  It's pretty hard to tell, I guess
without a machine with 2GB of physical RAM on it, but I am trying
to decide whether to buy one or not, so...

> An N-bit machine does not guarantee that it contains a lot of memory.
> If I have an 8-bit machine with 32M of memory and a 64-bit machine with
> 16 megs of memory, what does this tell you?  The N-bit machine can
> ACCESS a wider range of memory than an M-bit machine, provided that M <
> N.
> 
> Another question is:  Do you really need all those values in memory at
> the same time?  Can you store the values in a file and only haul in
> small pieces that you are working on? {Works with matrices, and tables}.
> 

this would be a good thing, however, this is a finite element analysis
code which would need a massive overhaul to achieve what you describe
above, which would induce considerable loss of performance.



thank you,

AG
-- 


Alessandro Giachino,  Software Engineer

EKK Inc.
2065 West Maple C309        tel. 248-624-9957
Walled Lake MI 48390        fax. 248-624-7158
_____________________________________________
                        http://www.ekkinc.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-20  4:00       ` EKK
@ 1999-08-20  4:00         ` Andrew P. Mullhaupt
  1999-08-24  4:00         ` Toon Moene
  1 sibling, 0 replies; 12+ messages in thread
From: Andrew P. Mullhaupt @ 1999-08-20  4:00 UTC (permalink / raw)



EKK <ekk@ekkinc.com> wrote in message news:37BD7803.E59265BE@ekkinc.com...
>
> > Another question is:  Do you really need all those values in memory at
> > the same time?  Can you store the values in a file and only haul in
> > small pieces that you are working on? {Works with matrices, and tables}.
> >
>
> this would be a good thing, however, this is a finite element analysis
> code which would need a massive overhaul to achieve what you describe
> above, which would induce considerable loss of performance.

It very well might not, if you use memory mapped files as the backing store
for the variables. One of the simpler ways to do this would be to replace
the memory allocation used by Fortran, in the case of F77 systems which have
integer/Cray/Digital style pointers provide a way to do this. Then you can
use the VM interface to access the array as if it were all in memory but
with the operating system kernel aware that only a small part of it needs be
in the resident set. On several flavors of Unix, this can provide a
substantial performance benefit, as opposed to a loss. Theoretically, this
would be an even bigger improvement on the Windows platforms, but you have
to get through Microsoft's layer of goo on top of the VM interface, as well
as certain deficiencies in the W95 implementation.

This modification could, depending on hw your code is written, be
accomplished in a very small number of lines of code changed.

In the case of F9x and allocatable arrays, there doesn't seem to be a way to
get around this problem.

Later,
Andrew Mullhaupt





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-19  4:00 max. array size GNU C compiler EKK
  1999-08-19  4:00 ` Dann Corbit
  1999-08-19  4:00 ` Ben Pfaff
@ 1999-08-20  4:00 ` Volker Hetzer
  2 siblings, 0 replies; 12+ messages in thread
From: Volker Hetzer @ 1999-08-20  4:00 UTC (permalink / raw)


EKK wrote:
> 
> What is the maximum array size, using GNU C compiler?
> 
> It looks like g77 complains after about 12000000.
%cat tst.c
char X[120000000];

%gcc -c -o tst.o tst.c
%

no problem here (HP-UX).

Greetings!
Volker
-- 
Hi! I'm a signature virus! Copy me into your signature file to help me spread!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: max. array size GNU C compiler...
  1999-08-20  4:00       ` EKK
  1999-08-20  4:00         ` Andrew P. Mullhaupt
@ 1999-08-24  4:00         ` Toon Moene
  1 sibling, 0 replies; 12+ messages in thread
From: Toon Moene @ 1999-08-24  4:00 UTC (permalink / raw)


EKK wrote:

> I've tried with an array that exceeds the physical 512MB of memory on
> the Linux box.  The compiler does not seem to complain untill
> beyond 1GB, but well before 2GB.  It's pretty hard to tell, I guess
> without a machine with 2GB of physical RAM on it, but I am trying
> to decide whether to buy one or not, so...

Arrays in the main program are limited in size to RAM+swap.  So if your
swap is 2 * RAM, you could go to max 1.5 GByte (in practice always
somewhat less).

This same limitation leads to problems running the test programs of the
new LAPACK 3.0 library on Linux systems that have significantly less
than half a GByte of RAM.

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1999-08-24  4:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-19  4:00 max. array size GNU C compiler EKK
1999-08-19  4:00 ` Dann Corbit
1999-08-19  4:00   ` EKK
1999-08-19  4:00 ` Ben Pfaff
1999-08-19  4:00   ` EKK
1999-08-19  4:00     ` Ben Pfaff
1999-08-19  4:00       ` EKK
1999-08-19  4:00     ` Thomas_Matthews
1999-08-20  4:00       ` EKK
1999-08-20  4:00         ` Andrew P. Mullhaupt
1999-08-24  4:00         ` Toon Moene
1999-08-20  4:00 ` Volker Hetzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox