Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!munnari.oz.au!bruce!monu0.cc.monash.edu.au!dmsmelb.mel.dms.CSIRO.AU!alan From: alan@dmsmelb.mel.dms.CSIRO.AU (Alan Miller) Newsgroups: comp.lang.fortran Subject: Re: why does optimization take so long ? Summary: Edinburgh f77 v. Sun f77 Message-ID: <1991May22.073127.4540@monu0.cc.monash.edu.au> Date: 22 May 91 07:31:27 GMT References: <1236@nikhefh.nikhef.nl> Sender: news@monu0.cc.monash.edu.au (0000-news(0000)) Organization: CSIRO, Division of Mathematics & Statistics Lines: 33 In article <1236@nikhefh.nikhef.nl: t19@nikhefh.nikhef.nl (Geert J v Oldenborgh) writes: : I am curious whether any of you know why compiling certain routines with a -O : flag takes a semi-infinite amount of time on certain computers (Apollo DN1000, : Sun Fortran 1.3.1) (i.e. I killed compilation after a few hours CPU time for a : single routine). The code in question is generated by a computer algebra : program, and looks like this : : qqgg= n1i*n2i*pbqi*ptqi * ( - 2*pnpe*pbpt**2*qk + 2*pnpe* : + qk*mb2*mt2 + 2*pnpb*pepb*pbpt*qk - 2*pnpb*pepb*qk*mt2 + 2* : + pnpb*pept*pbpt*qk + 4*pnpb*pept*pbpt**2 - pnpb*pept*qk*mb2 - : ...400 similar lines... : : As a lot of the time is spent here I'd like to be able to optimize it. : : Geert Jan van Oldenborgh : gj@hep.physik.uni-muenchen.de Geert sent me the piece of code, which was in the form of a Fortran function without a main program. I compiled it with the Sun f77 compiler (v 1.3.1) and with version 2.6.3 of the Edinburgh f77 compiler, with and without the optimization option -O. The times taken were as follows: Compiler + options Time f77 -c 16.1u + 1.8s f77 -O -c Gave up after 37 mins. of CPU time ! epcf77 -c 5.2u + 0.6s epcf77 -O -c 156.0u + 3.1s The Edinburgh compiler certainly struggled with the 485-line function, while the Sun compiler looks as if it was firmly stuck. Alan Miller