Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!rice!hsdndev!spdcc!ima!dirtydog!suitti From: suitti@ima.isc.com (Stephen Uitti) Newsgroups: comp.benchmarks Subject: Re: Ole Swang's benchmark: Sum of Harmonic Series Message-ID: <1990Dec19.004003.20667@dirtydog.ima.isc.com> Date: 19 Dec 90 00:40:03 GMT References: <44125@mips.mips.COM> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Reply-To: suitti@ima.isc.com (Stephen Uitti) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 96 In article <44125@mips.mips.COM> mark@mips.COM (Mark G. Johnson) writes: >Because the Suns that I have access to, don't have Fortran compilers, >I translated (without f2c :-), giving > #include > main() { > double r ; > int i ; > r = 0.0; > for(i=1; i<=10000000; i++) > { r += (1.0/( (double) i ) ) ; } > printf(" r = %16.7le, i = %d\n", r, i); > } I translated it as: #include main() { register double r; register long int i; r = 0.0; i = 10000000; do { r += 1.0 / (double) i; } while (--i); printf("%f, %ld\n", r, i); } I'm not sure why Mark used such an odd float format. I prefer the output "16.695311, 0" to " r = 1.6695311e+01, i = 0". Does this match the FORTRAN output? I used a do-while because of my PDP-11 days. The Ritchie compiler would produce an "sob" (subtract one & branch) instruction for the do-while, rather than an increment, compare, and branch. On the 80386, the code for the "for" loop is: incl %eax cmpl $10000000,%eax jle .L5 and the code for the "do-while" is: decl %eax jne .L2 The do-while is faster. On the 386/25 with 387, the "for" loop took 101.6 seconds, and the "do-while" loop took 99.8 seconds. Now, most people will not notice the 2% speed up, but often the loop overhead is more significant. It is interesting that you want to add up the small stuff first. That coding happens to be quicker on most machines, too. Adding to Ole's list (user CPU seconds from /bin/time), Cray X/MP 216 0.29 MIPS RC6280 3.3 MIPS RC3230 Magnum 8.1 Convex C 120 8.7 Sun SPARCstation II 10.0 DECstation 5000/200 10.5 DECsystem 5400 13.1 Sun SPARCstation 1+ 33.0 VAX 6330/VMS5.3 FPA 41.9 Compaq 486/25 44.4 (new) VAX 8650/VMS5.3 FPA 55.3 Compaq 386/33 71.7 (new) VAX 8600/VMS5.2 FPA 77.1 Compaq 386/25 99.8 (new) Sun 3/60 (m68881) 105.6 VAX 11/780 614.1 (new) Does anyone remember running 20+ people on a VAX 11/780? Here's the "uptime" output on our VAX 11/780: 5:16pm up 34 days, 22 hrs, 21 users, load average: 3.31, 3.10, 2.71 Reliabiliy is another item that benchmarks generally miss out on. In 34 days, even a VAX 11/780 has a significant number of cycles. By this benchmark, it will give you 1,400 seconds of Cray X/MP 216 time for this sort of thing. Ok, so 24 minutes of Cray time probably costs less than the maintainance on a VAX 11/780 for a month (one would hope you've depreciated the VAX to zero by now). Cost effectiveness is something that hasn't been discussed much. A 386/25 system will be obsolete in 3 years, and costs about $4,500 dollars for that time for a system capably of running this sort of application. That's $1,500 per year. It performs 6.15 times better than the VAX 780. This gives us a rough cost effectiveness of $240/VAX MIP. $1500 / (614.1 / 99.8) Is anyone brave enough to figure this out for a Cray? ... a PC/XT? Stephen. suitti@ima.isc.com