From: Peter Shenkin <shenkin@still3.chem.columbia.edu>
Subject: Re: fortran error?
Date: 1998/03/19 [thread overview]
Message-ID: <35117D83.167E@still3.chem.columbia.edu> (raw)
In-Reply-To: 6eopju$pfi$2@news.utrecht.NL.net
Toon Moene wrote:
>
> [ I hope I can add some bits to this discussion, but might
> raise more questions instead ... ]
>
> Peter Shenkin <shenkin@still3.chem.columbia.edu> wrote:
>
> [ ... about the allocation of automatic arrays ... ]
>
> > One of these was a compile-time flag for a size threshold to force
> > allocation of large automatics on the heap....
> It's not suprising Cray implemented such a feature, because, AFAIK, Cray PVP
> systems do not have a stack as such - the "stack" is also managed as a heap.
> Perhaps Jeff Drummond or one of the other Crayons listening in can elaborate
> on this point.
As I understand it (my interpretation of some email some time ago
from one of the Cray engineers -- if I'm wrong, in other words,
blame me), Cray does have a stack, but the allowed stack allocation
is not easily altered by a user. (An ordinary UNIX user can alter
his own stack allocation (up to the compiled-in kernel value) by
use of the "limit" or "ulimit" command.) So Cray provided an
alternative method by means of which code providers can compile
code containing large automatic variables which is intended to be
run by ordinary users.
>
> > I suspect it's not less efficient, or not much less efficient, or
> > even more efficient, to test whether the unused part of the stack
> > is large enough to hold the automatics that needs to fit there, and
> > abort the program with a descriptive message if there's not.
>
> The point often is not that the stack isn't large enough, but that the system
> (either by default or because the user set a limit) doesn't "allow" the stack
> to grow beyond a certain limit.
Well, the maximum allowable stack size is not large enough. But
on many UNIX systems, the default maximum stacksize provided to a user
is quite low. I suppose this is to provide a means for the system
to kill a program if an infinite recursion should occur.
...
> > The Absoft compiler under LINUX is the only one I know that
> > terminates the program gracefully with a descriptive message
> > when allocation of an automatic fails. In fact, no UNIX system
> > I've ever encountered delivers the message you propose. Can
> > you cite one that does?
>
> That's neat, it means they either allocate on a heap (were they can trace the
> amount of memory allocated), or they translate the "segmentation violation"
> that results from overrunning stack limits in the appropriate message: that
> means they have to have a sure fire means to discriminate between this
> failure and a "generic" segmentation violation.
It did occur to me that they might actually allocate automatics
on the heap, but I don't know whether they do this or not.
-P.
--
************** In memoriam, Grandpa Jones, 1913-1998, R.I.P.
**************
* Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code
3153 *
** NY, NY 10027; shenkin@columbia.edu; (212)854-5143; FAX: 678-9039
***
*MacroModel WWW page:
http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
next prev parent reply other threads:[~1998-03-19 5:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-12 5:00 fortran error? Armin Leuprecht
1998-03-12 5:00 ` robin
1998-03-16 5:00 ` Steve Lionel
1998-03-17 5:00 ` Peter Shenkin
1998-03-17 5:00 ` Craig Burley
1998-03-17 5:00 ` Peter Shenkin
1998-03-18 5:00 ` Toon Moene
1998-03-18 5:00 ` Jeff Drummond
1998-03-19 5:00 ` Peter Shenkin [this message]
1998-03-18 5:00 ` Craig Burley
1998-03-19 5:00 ` Peter Shenkin
1998-03-19 5:00 ` Craig Burley
1998-03-20 5:00 ` Nick Maclaren
1998-03-20 5:00 ` Peter Shenkin
1998-03-20 5:00 ` Richard Maine
1998-03-20 5:00 ` Craig Burley
1998-03-20 5:00 ` Nick Maclaren
1998-03-20 5:00 ` Richard Maine
1998-03-20 5:00 ` Peter Shenkin
1998-03-23 5:00 ` Craig Burley
1998-03-23 5:00 ` Summary (I hope) failure of automatic allocation; was, " Peter Shenkin
1998-03-24 5:00 ` Craig Burley
1998-03-23 5:00 ` Craig Burley
1998-03-23 5:00 ` Peter Shenkin
1998-03-24 5:00 ` Craig Burley
1998-03-24 5:00 ` Nick Maclaren
1998-03-20 5:00 ` Dick Hendrickson
1998-03-20 5:00 ` Peter Shenkin
1998-03-20 5:00 ` Craig Burley
1998-03-20 5:00 ` Peter Shenkin
1998-03-23 5:00 ` Craig Burley
1998-03-18 5:00 ` Steve Lionel
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox