Fortran vs. C for numerical work (SUMMARY)

Tony Warnock ttw at lanl.gov
Fri Nov 30 07:44:15 AEST 1990



Dan Bernstein asks:
 
RE: >In article <7200 at lanl.gov> ttw at lanl.gov (Tony Warnock) writes:
    >>     With respect to speed, almost all machines that I have
    >>     used during the last 25 or so years have had faster
    >>     multiplications than memory accesses.
 
>Hmmm. What machines do you use? In my experience (mostly mainframes and
>supers, some micros, and only recently a bit with minis) local memory
>access is up to several times as fast as integer multiplication. (I
>don't like this situation; converting to floating point just to multiply
>quickly on a Cray seems rather silly.)
 
 
      Model        Multiplication Time     Memory Latency
 
      YMP          5  clock periods         18 clock periods
      XMP          4  clock periods         14 clock periods
      CRAY-1       6  clock periods         11 clock periods
 
      Compaq       25 clock periods         4  clock periods
      Zenith      120 clock periods        30  clock periods
 
    The times on the PC-clones are approximate depending on the type
    of variables being accessed and the sizes of the indices.
 
    Most of my work has been on CRAY type computers. It is always a
    win to avoid memory accesses. On the PC-type machines, memory
    access is faster, but in the particular cases that I have been
    programming, one does many more constant-stride access than random
    accesses, usually in a ratio of many thousand to one. For an LU
    decompositon with partial pivoting, one does rougly N/3 constant
    stride memory accesses for each "random" access. For small N, say
    100 by 100 size matrices or so, one would do about 30
    strength-reduced operations for each memory access. For medium
    (1000 by 1000) problems, the ratio is about 300 and for large
    (10000 by 10000) it is about 30000.



More information about the Comp.lang.c mailing list