Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!csrdh From: csrdh@marlin.jcu.edu.au (Rowan Hughes) Newsgroups: comp.benchmarks Subject: Re: A benchmark Keywords: snake performance Message-ID: <1991May3.124937.17144@marlin.jcu.edu.au> Date: 3 May 91 12:49:37 GMT References: <1991May3.023705.5616@marlin.jcu.edu.au> <1991May3.053053.29174@rice.edu> Organization: James Cook University Lines: 52 In <1991May3.053053.29174@rice.edu> preston@ariel.rice.edu (Preston Briggs) writes: >It's important to remember that code that is ideal for a vector machine >is not necessarily ideal for a scalar (or super-scalar) machine. >Yes, the IBM and HP machines can cook on vector code, >but often it can be rearranged for even better performance. ... >This is ok for vector machines > DO j = 1, n > DO i = 1, n > A(i) = A(i) + B(j) > ENDDO > ENDDO >but this is better for scalar machines >(and terrible for vector machines, because of the recurrence on A(i)) > DO i = 1, n > DO j = 1, n > A(i) = A(i) + B(j) > ENDDO > ENDDO I do see your point about scalar machines. A quick scan through the hot spots in the code showed that potential chaining couldn't be had. Any sensible vector compiler would do a loop inversion for the second example, or possibly a chain with A(I) treated as a scalar. The GFDL code is essentially dot and vector products, and triads, which should be OK for both types of machines. Scalar chaining in the cache should be regarded as a bonus, not a necessity, and benchmarks which exclusively use it (eg linpack300x300 on HP9000-750) should be treated with contempt. Chaining is also quite useful for vector machines too, and necessary in a case like SUM=SUM+A(I). You should be aware that the backwards recurrence problem has been solved for vector compilers, and Fujitsu's latest vector compiler permitts 1st order forward recurrence. Philosophical note: I really hate the idea of butchering code to suite some particular machine; computer scientists were invented to write compilers that took care of that! The UNIX curly bracket bozos can't even write a bug-free f77 compiler !! -- Rowan Hughes James Cook University Marine Modelling Unit Townsville, Australia. Dept. Civil and Systems Engineering csrdh@marlin.jcu.edu.au