Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!zodiac!joyce!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.fortran Subject: Re: Maximum Stack Size for a Subprog.? Message-ID: <262@quintus.UUCP> Date: 9 Aug 88 04:23:04 GMT References: <47900003@uicsrd.csrd.uiuc.edu> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 35 In article <47900003@uicsrd.csrd.uiuc.edu> leein@uicsrd.csrd.uiuc.edu writes: >Hi, Fortran users, >What is the limit of the dynamic storage --- so-called stack? There is more than one kind of dynamic storage, and a stack of activation records is only one kind. For example, when I last used Orions, they had one stack for activation records and scalar variables, and another stack for local arrays. UNIX, VMS, AEGIS, MVS, and CMS --among others-- permit the dynamic allocation of storage off the stack. Under VMS, Fortran can use as much stack space as the operating system will let it. Start with "SHOW PROCESS/QUOTAS" in the DCL manual, and the qualifiers of the RUN command, to find out what the limits are and how to set them. (You really need a native guide.) Considering stack space specifically, System V.2 doesn't provide any way that I know of to discover or change the stack limit (ulimit() can be used to discover the maximum break, but not the stack limit), but in BSD UNIX systems the C shell has a "limit" command. Use % limit stacksize to find out what the limit is, % limit stacksize ${size_in_kilobytes}k to set it. SunOS has this. To find out how to discover/change the stack size limit on Apollos, check the description of the "limit" command in the csh manual. If they don't support it, they'll tell you what to do instead. Be aware that many UNIX Fortran compilers (particularly ones derived from AT&T's "f77" compiler) allocate local variables statically, although in the absence of a SAVE statement or COMMON specification affecting a local variable there is nothing in the Fortran standard to require this. The SunOS 3.x Fortran compiler is one of them, so the 0.5Mbyte stack you normally get on a SUN is ample for Fortran. (Apollo's "ftn" compiler is sometimes called "f77", but it isn't derived from the AT&T compiler as far as I know. I don't know what it does with the stack.)