Slashdot Mirror


Goto Leads to Faster Code

pdoubleya writes "There's an article over at the NY Times (registration required) about Kazushige Goto, the author of the Goto Basic Linear Algebra Subroutines (BLAS, see the wiki); his BLAS implementation is used by 4 of the current 11 fastest computers in the world. Goto is known for painstaking effort in hand-optimizing his routines; in one case, "when computer scientists at the University at Buffalo added Goto BLAS to their Pentium-based supercomputer, the calculating power of the system jumped from 1.5 trillion to 2 trillion mathematical operations per second out of a theoretical limit of 3 trillion." To quote Jack Dongarra, from the University of Tennessee, "I tell them that if they want the fastest they should still turn to Mr. Goto."" Ever get the feeling someone wrote an article merely for the pun?

8 of 462 comments (clear)

  1. Pah! by BJH · · Score: 3, Informative

    Anybody who criticizes Goto Kazushige's Free Software credentials - he created a Linux/Alpha distribution called Stataboware, which among other things included an early version of his hand-tuned math library back in 1999 (it's now defunct, unfortunately).

  2. Re:I failed a coding test because of this guy by Mr+Z · · Score: 3, Informative

    Yeah, that is BS! Especially when you have Donald Knuth, Brian Kernighan and Ken Thompson on record in defense of goto when it's warranted. References: Knuth's "Structured Programming with GOTO" (link appears dead), Kernighan, and Ken Thompson: "If you want to go somewhere, goto is the best way to get there."

    And then there was the famous "'GOTO Considered Harmful' Considered Harmful" by Frank Rubin, and a a decent section in Steve McConnell's Code Complete that takes an even-handed view.

    Anyway, swinging carefully back on topic, it sounds like Mr. Goto's work is at the instruction level, not the C or Fortran or even really at the algorithmic level (except maybe tricks like tiling). I program in the embedded space, where getting as close to 100% efficiency is a continual challenge. I wonder if any of his techniques scale down...

    --Joe

  3. Re:Duh... by Anonymous Coward · · Score: 3, Informative

    I was involved with the design and the benchmarking effort of #5, #59, #67 and a few others in Top500. The performance of a supercomputer is determined by the number of real FLOPs acheived versus theoretically claimed.

    Theoretical FLOPs per processor = Core(s) * Speed_Per_Core (in Ghz) * 2. So for a Dual 3.6 Ghz Xeon, the theoretrical FLOPS is 2 * 3.6 * 2 = 14.4

    An easy way to find out actual number of FLOPS a computer can acheive is to ask it to solve a number of Linear Algebra problems and then look at the time it takes to finish solving these problems. The faster the time, better FLOPs obviously.

    Now, the reason we chose gotolib was:

    1) It works with GCC
    2) It is optimized to use the processor cache
    3) And therefore fewer cache misses which translates to superior performance
    4) And its free (though the source is not exactly open).

    Because it uses the processor cache so effectively, it results in a better number than a regular BLAS (which does not use processor cache).

    Alternatively, I've also used Intel's MKL which offers comparable performance but then it works best with ICC and its not free. Btw, #59 was benchmarked using gotolib and MKL -- but if I remember correctly, the final result was derived using MKL.

    In essence, if you want to use GCC and work with lots of number crunching ie BLAS, gotolib is your best option.

  4. Re:I failed a coding test because of this guy by Comboman · · Score: 3, Informative
    Sorry but I gotta side with the professor. Don't use goto in C++.

    "Not recommended" and "don't ever use it" are two differenet things. If it was never meant to be used, it wouldn't be in the language. The goal of the test mentioned was to write the shortest possible piece of code, not the most maintainable or most elegant.

    "The goto can also be important in the rare cases in which optimal efficency is essential." - Stroustrap, The C++ Programming Language

    "Code involving a goto can always be written without one, though perhaps at the price of some repeated tests or an extra variable." - Kernighan & Ritchie, The C Programming Language

    If you don't know who Stroustrap and K&R are, you have no right commenting on C/C++ issues. I have to side with the original poster, the prof was a dogmatic asshole (and so are you).

    --
    Support Right To Repair Legislation.
  5. Re:Another punny name by aug24 · · Score: 3, Informative

    Thankfully for my sanity, that one is a typo. It's Van de Geijn (the ij is originally a y with an umlaut - Dutch).

    Justin.

    --
    You're only jealous cos the little penguins are talking to me.
  6. Re:Libgoto is fast but not open-source by ufnoise · · Score: 5, Informative

    From the article: Some programmers have suggested that Mr. Goto has not joined the open-source movement because he wants to protect his secrets and strategies from competitors. That is not so, he said recently, noting that the Goto BLAS software is freely available for noncommercial use. And he said he was preparing an open-source version.

  7. for more technical info, see goto's personal site by Trollll · · Score: 3, Informative

    for more technical info, see his site at the Texas Advanced Computing Center. pretty pictures and software tool downloads even.