Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-sdd!apollo!apollo.hp.com!geiser From: geiser@apollo.HP.COM (Wayne Geiser) Newsgroups: comp.sys.apollo Subject: Re: PRISM Fortran compiler causes trashing! Message-ID: <47626e79.20b6d@apollo.HP.COM> Date: 12 Dec 89 17:01:00 GMT References: Sender: root@apollo.HP.COM Reply-To: geiser@apollo.HP.COM (Wayne Geiser) Organization: Hewlett-Packard Apollo Division - Chelmsford, MA Lines: 62 In article , hanche@imf.unit.no (Harald Hanche-Olsen) writes: > This is a short tale about a long FORTRAN compilation on the DN10000. > I was to compile a FORTRAN program with a total of 120K lines split up > into 37 files. Since our machine has only 8MB of memory and compiling > is known to load it down severely, I set it up to start compiling at > 1am. Next morning I got in to the office sort of late and found that > the compilation was still running, and students were complaining > loudly about the sluggishness of the machine. . . . > To test my hypothesis, I took a representative FORTRAN file of 2850 > lines and split it up into little files using `fsplit'. I got 19 files > with sizes ranging from 22 lines to 280 lines. Compiling them all and > timing with the `time' command, I got the answer > > 289.3u 20.4s 14:51 34% 0+0k 1014+0io 30083pf+0w > > For those who don't know `time' output format, this means 289 seconds > user time, 20 seconds system time (i.e., spent in the kernel), almost > 15 minutes elapsed time, and 30000 page faults. Compare this with the > result of trying to compile the whole file in one shot. After tying > up the machine for over two hours, I decided the most merciful thing > to do was to kill it, yielding this result: > > 267.2u 271.5s 2:17:10 6% 0+0k 7043+0io 441500pf+0w > > That is, 9 times as much elapsed time, 14 times as many page faults! . . . > Conclusion: Split your files before compiling! > Rhetoric question: What do those compiler writers at HP/apollo think > they're doing? Writing for machines with a minimum of 128M of memory? > > - Harald Hanche-Olsen Division of Mathematical Sciences > hanche@imf.unit.no The Norwegian Institute of Technology > hanche@norunit.bitnet N-7034 Trondheim-NTH NORWAY The new (i.e. SR10 and later) compilers do, indeed, compile the entire source at once. This was done to make our FORTRAN behave more like the Unix f77 compiler. Your conclusion is the best solution if splitting files is acceptable. Obviously, you'll get the fastest compilation speed using this method. Another method is to turn the optimizer down (or off) for all but the final build of your system. I think you will find that it is the optimizer which is taking up the majority of the time. As an asside, the form of your program may also have somthing to do with how much time the compiler takes. It is much more difficult (read time consuming) to work with control flows that consist of large numbers of GOTOs and such. Calculating register lives in that instance is definitly a non-trivial problem. I hope this sheds a little light on what is going on in the compilers and "What ... those compiler writers at HP/apollo think they're doing." Wayne Geiser Apollo Computer, Inc. - A subsidiary of Hewlett Packard {mit-erl, yale, uw-beaver, decvax}!apollo!geiser