Xref: utzoo comp.lang.fortran:4210 comp.lang.c:34358 Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!hsdndev!cmcl2!lanl!ttw From: ttw@lanl.gov (Tony Warnock) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: Fortran vs. C for numerical work (SUMMARY) Message-ID: <7339@lanl.gov> Date: 29 Nov 90 20:44:15 GMT References: <9458:Nov2721:51:5590@kramden.acf.nyu.edu> <2392:Nov2902:59:0590@kramden.acf.nyu.edu> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 39 Dan Bernstein asks: RE: >In article <7200@lanl.gov> ttw@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.