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: nmm1@cus.cam.ac.uk (Nick Maclaren) Subject: Re: fortran error? Date: 1998/03/20 Message-ID: <6euvli$m47$1@lyra.csx.cam.ac.uk>#1/1 X-Deja-AN: 336105407 References: <3507A4A5.F8A7DDC2@matd.tu-graz.ac.at> <351296BC.167E@still3.chem.columbia.edu> Organization: University of Cambridge, England Newsgroups: comp.lang.fortran,comp.unix.osf.osf1 In article , Craig Burley wrote: > >It's quite easy to compute a call tree and thus flatten the estimate >of the maximum, though. > >What I'm trying to say is probably not what I'm saying, I'm afraid, >but I'll try again: in FORTRAN 77, it is fairly easy and straightforward >to determine that a given program will not only *fit* into a given >amount of memory, but will never ask for any *more* memory while >running. While this is true, it is a bit deceptive. You are quite correct as far as most constructions are concerned, and we used to do precisely that when overlaying large programs into small regions (remember that fun and games?) However, one rare construction in Fortran 77 (character concatenation) can theoretically lead to a program with O(N) total allocated space needing O(2^N) to run. Which is, of course, why almost all compilers have an ad-hoc kludge or two for the space to use for that horrible construction :-( >> But the even simpler analysis of determining the stack resources >> required for each subroutine, and refusing to start if the stack was >> too small, was never, as far as I know, done. > >Oh, sure it was, in *effect* if not explicitly. > >On some now-ancient machines, you compiled your Fortran modules, >you linked them together, and you got an executable. If it was >too big, you couldn't run it in a given amount of memory -- heck, >in some cases, that meant you couldn't *link* it in the first >place! Yes, quite. And not so ancient machines, either. VS Fortran under IBM MVS and CMS used that technique right up until its first CEL (Common Execution Library) version - sometime in the late 1980s. On the matter of systems that allow specification in advance, quite a lot of mainframes did that - indeed, I would say almost all. And even today, products like NQS do, but it typically done only for supercomputers. Memory may be cheap - but not if you want it both extremely fast, and by the terabyte! [ And, yes, I agree with most of the rest of your points! ] Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QG, England. Email: nmm1@cam.ac.uk Tel.: +44 1223 334761 Fax: +44 1223 334679