Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Toon Moene <toon@moene.indiv.nluug.nl>
Subject: Re: fortran error?
Date: 1998/03/18	[thread overview]
Message-ID: <6eopju$pfi$2@news.utrecht.NL.net> (raw)
In-Reply-To: 350EDA13.2781@still3.chem.columbia.edu


[ 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.  In this scenario, the
> program writer knowingly and explicitly chooses to trade speed
> for reliablility.  Yes, this requires a runtime test, but the
> Cray isn't exactly a slouch when it comes to execution speed, and
> it is Cray who implements this feature.

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.

> 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.  

Note that:

> VMS has always been known to run Fortran codes "fast", and Steve
> Lionel mentioned that VMS has had a dynamically growable stack
> since 1980.  Certainly, some of the precedents I cited would be
> be more efficient than that.

and most Unices do it that way too:  Have a "guard page" (with no access 
rights) at the end of the stack area to get the OS in charge when you overrun 
the stack and let it decide whether to enlarge stack or give you an "access 
violation".  Note how this hints that such an error should be given a more 
descriptive name, as the OS itself knows what's wrong.

> 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.

-- 
Toon Moene (mailto:toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam



  reply	other threads:[~1998-03-18  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 [this message]
1998-03-18  5:00           ` Jeff Drummond
1998-03-19  5:00           ` Peter Shenkin
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               ` 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                       ` 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-23  5:00                       ` Summary (I hope) failure of automatic allocation; was, " Peter Shenkin
1998-03-24  5:00                         ` Craig Burley
1998-03-20  5:00               ` Nick Maclaren
1998-03-20  5:00             ` Dick Hendrickson
1998-03-20  5:00               ` Craig Burley
1998-03-20  5:00                 ` Peter Shenkin
1998-03-23  5:00                   ` Craig Burley
1998-03-20  5:00               ` Peter Shenkin
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