Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* exp() function in fortran -- why is it so slow?
@ 1994-04-14 20:13 Gyula Szokoly
  1994-04-18 21:22 ` Gyula Szokoly
  0 siblings, 1 reply; 3+ messages in thread
From: Gyula Szokoly @ 1994-04-14 20:13 UTC (permalink / raw)


Hi,

  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. If I just remove that function call, the OSF
machine runs about twice as fast as the OVMS (which is about right, since
the 600 runs at 175MHz, my 300 ?? runs at 125 MHz).
  What the hell is going on? Even better: what can I do? Is there some
switch that I overlooked? I can image small differences between the
VMS and OSF compiler but nothing can produce a factor of 8 in speed.

Thanks in advance,
  Gyula

-- 
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|


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: exp() function in fortran -- why is it so slow?
  1994-04-14 20:13 exp() function in fortran -- why is it so slow? Gyula Szokoly
@ 1994-04-18 21:22 ` Gyula Szokoly
  1994-04-19 13:18   ` Sebastian Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Gyula Szokoly @ 1994-04-18 21:22 UTC (permalink / raw)


In article <2ok857INN2t4@jhunix.hcf.jhu.edu>,
I <szgyula@tarkus.pha.jhu.edu> 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|


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: exp() function in fortran -- why is it so slow?
  1994-04-18 21:22 ` Gyula Szokoly
@ 1994-04-19 13:18   ` Sebastian Meyer
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Meyer @ 1994-04-19 13:18 UTC (permalink / raw)


szgyula@skysrv.pha.jhu.edu (Gyula Szokoly) writes:
>In article <2ok857INN2t[...]>, <szgyula@tarkus.pha.jhu.edu> 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
> [...]
>  Just for the record. I got my expected speed compiling as:
>f77 -o mycode mycode.for -non_shared -math_library fast

This was definitively right for V1.2. I suspect that -math_library fast 
has any meaning with V1.3. Here is my test:

> f77 -o mcnp_ns -non_shared *.o -lX11 -ldnet_stub
> f77 -o mcnp_nsf -non_shared -math_library fast *.o -lX11 -ldnet_stub
> ll mcnp*
-rwxr-xr-x   1 meyer    mcnp     2972888 Apr 19 14:58 mcnp_ns
-rwxr-xr-x   1 meyer    mcnp     2972888 Apr 19 14:59 mcnp_nsf
> cmp -l mcnp_ns*
     5  76 201

So the output files differ in just ONE byte, what explains the missing
difference in speed. :-(

I'd be grateful for any tricks to speed up my program. It's only
five times faster on a 3000/300M than on our DECstation 2100, what
is not what we expected.

sebastian
--
    __o     Sebastian Meyer  Tel: 030/838-5181| FU Berlin, Physik
  _ \<,_    meyer@sirius.physik.fu-berlin.de  | Arnimallee 14   [Raum 1.3.35]
 (_)/ (_)   meyer@muffin.physik.uni-bremen.de | D-14195 Berlin
~~~~~~~~~~ "To err is human, to really foul things up requires a computer"


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1994-04-19 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-04-14 20:13 exp() function in fortran -- why is it so slow? Gyula Szokoly
1994-04-18 21:22 ` Gyula Szokoly
1994-04-19 13:18   ` Sebastian Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox