From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1ef3b84ca62fad7b X-Google-Attributes: gidfee84,public X-Google-Thread: 1094ba,1ef3b84ca62fad7b X-Google-Attributes: gid1094ba,public From: Peter Shenkin Subject: Re: fortran error? Date: 1998/03/19 Message-ID: <35117D83.167E@still3.chem.columbia.edu>#1/1 X-Deja-AN: 335695893 Content-Transfer-Encoding: 7bit References: <3507A4A5.F8A7DDC2@matd.tu-graz.ac.at> <6ejfii$kbd@usenet.pa.dec.com> <350E95A7.41C6@still3.chem.columbia.edu> <350EDA13.2781@still3.chem.columbia.edu> <6eopju$pfi$2@news.utrecht.NL.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: MacroModel Development Group, Columbia University Newsgroups: comp.lang.fortran,comp.unix.osf.osf1 Toon Moene wrote: > > [ I hope I can add some bits to this discussion, but might > raise more questions instead ... ] > > Peter Shenkin 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 *