double precision vs. single precision
Author Message
double precision vs. single precision

Hi

Recently I met a problem in programming. I am programming a double
precision fortran program and find it is rather slow than the counterpart
in single precision. As I am using 64bit machine(I am using alpha station
now), the guy in my group told me there should not be affect so much. He
told me the computation time should be almost same. Does anyone know
something about that? Is that they both should consume the same CPU time
or they should be different a lot? Any input is welcomed.

Thanks

Have a nice day

Bin Hu

Fri, 03 Dec 1999 03:00:00 GMT
double precision vs. single precision

Quote:

> Recently I met a problem in programming. I am programming a double
> precision fortran program and find it is rather slow than the counterpart
> in single precision. As I am using 64bit machine(I am using alpha station
> now), the guy in my group told me there should not be affect so much. He
> told me the computation time should be almost same. Does anyone know
> something about that? Is that they both should consume the same CPU time
> or they should be different a lot? Any input is welcomed.

This really isn't enough data to say much useful (but that doesn't
prevent me from trying :-)).  Many different factors can affect
speed of a program.

To make some very simplistic generalizations, the following factors
can make double precision run slower than single, even on machines
where the individual double precision operations are just as fast.

1. Memory access.  Double precision takes twice as much storage as
single.  Thus memory access wil likely take longer.  Depends on
lots of things how significant this effect is on the program.
If it makes the difference between staying in cache or not, the
effect can be major.

2. I/O.  Simillarly, I/O bandwidth is larger for double.  Might be
a major factor or might be irrelevant, depending on the code.

3. Algorithmic changes.  If you are using an iterative algorithm,
you might end up doing more iterations for double precision,
depending on how the number of iterations is determined.  Or
you might end up doing fewer iterations.  Either can happen.

--
Richard Maine

Fri, 03 Dec 1999 03:00:00 GMT
double precision vs. single precision

If there is a large difference in speed for the same number of operations,
it could indicate that the single precision version fits in cache while
the double doesn't.  In that case, there might be an improvement to be
obtained from changing the memory access pattern (cache blocking).
Tim

Sat, 04 Dec 1999 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages