From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4656f7b2dbe75a7 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-04-18 14:22:55 PST Path: gmd.de!nntp.gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!blaze.cs.jhu.edu!jhunix.hcf.jhu.edu!skysrv!szgyula From: szgyula@skysrv.pha.jhu.edu (Gyula Szokoly) Newsgroups: comp.unix.osf.osf1 Subject: Re: exp() function in fortran -- why is it so slow? Date: 18 Apr 1994 21:22:55 GMT Organization: Johns Hopkins University Message-ID: <2outnfINN8vu@jhunix.hcf.jhu.edu> References: <2ok857INN2t4@jhunix.hcf.jhu.edu> NNTP-Posting-Host: skysrv.pha.jhu.edu In article <2ok857INN2t4@jhunix.hcf.jhu.edu>, I wrote: > I hit the following problem: I'm trying to run a code on a 3000/600AXP >machine running OSF 1.3. Accidentaly I've tried to run the same code on >a 3000/300 ?? running OpenVMS 1.5. I was really surprised. The code >run about 3-4 times FASTER on the OpenVMS machine. I've tried to track >down the problem and I figured out that I'm calling the exp() function >(in FORTRAN) a lot. Thanks To Bill G. from Dec, the solution is easy. I overlooked some linker flags. My (well, my user's) fortran code calls exp() with large negative numbers. I used by a misstake the single precision library on the OpenVMS machine, which returns 0 for x<-85, on the OSF machine the double precision library call returns zero for x<-700. Many of my numbers fell between these two limits so the OSF machine did calculate a lot, the OpenVMS machine just returned zero. Just for the record. I got my expected speed compiling as: f77 -o mycode mycode.for -non_shared -math_library fast Thanks again, and sorry for the confusion. Gyula Szokoly P.S.: I'm a C person so this was a big mental challange to me. -- Gyula P. Szokoly (szgyula@skysrv.pha.jhu.edu) -------------------------------\ | When I am weaker than you, I ask you for freedom because that is according| |to your principles; when I am stronger than you, I take away your freedom| |because that is according to my principles. -- Frank Herbert|