Looking at the Top500

I wanted to see how Itanium was placing in the Top500 against one of the main competitors, IBM Power, so I drew up a little table. In terms of Gflops/Processor Itanium stacks up very well against the competition. I believe I've identified the IBM power offerings for comparison (in blue).

Rmax Sum (Gflops)

Processors

Rmax/Processor

Power4+

97098

25194

3.85

PowerPC 440

364691

169984

2.15

Power4

31092

11552

2.69

PowerPC

64377

11636

5.53

Power5

35581

6216

5.72

Power

23574

26920

0.88

All Power

616413

251502

2.45

IBM Power

187345

69882

2.68

Itanium 2

237385

50668

4.69

Pentium 4 Xeon

398724

135348

2.95

Xeon EM64T

146050

35214

4.15

Intel

782159

221230

3.54

Note there are several minor generations of Itanium's lumped together, whilst the Power line gets a bit more granularity thanks to different versions. Of course the great thing about the Top500 results is you can get a different result depending on what sort of press release you want to write today, so the whole thing should be taken with a grain of salt.

On Genius

Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

From SIGPLAN Notices Vol. 17, No. 9, September 1982, pages 7-13. Unfortunately The ACM digital library seems to have omitted these pages from their archive, however the full text is available online.

Control Key Intercepted when using Gimp

Today I was trying to use the 'clone' tool in Gimp and couldn't for the life of me get it to accept the source position with the normal 'control-click'. It seemed like it was being intercepted by something, as it turned into a little cross.

Turns out under Gnome you should go Applications -> Desktop Preferences -> Windows -> Movement Key and modify it to be something else other than the control key; then log out and back in.

Using LD_PRELOAD to override a function

For some reason, people seem to get this quite wrong a lot of the time. Certainly one should not be playing with symbols that start with __ unless you really know what you're doing with them.

ianw@lime:~/tmp/override$ cat override.c
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <dlfcn.h>

pid_t getpid(void)
{
        pid_t (*orig_getpid)(void) = dlsym(RTLD_NEXT, "getpid");
        printf("Calling GETPID\n");

        return orig_getpid();
}

ianw@lime:~/tmp/override$ cat test.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(void)
{
        printf("%d\n", getpid());
}

ianw@lime:~/tmp/override$ gcc -shared -fPIC -o liboverride.so override.c -ldl
ianw@lime:~/tmp/override$ gcc -o test test.c
ianw@lime:~/tmp/override$ LD_PRELOAD=./liboverride.so ./test
Calling GETPID
15187

x86 Architecture manuals from Intel

Someone once gave gave me a tip that thanks to some sort of anti-trust agreement, if you go to this site and do a search on "IA-32" by title, you can fill your shopping cart with manuals and Intel ship it out to you free.

moo

ianw@lime:~$ apt-get moo
         (__)
         (oo)
   /------\/
  / |    ||
 *  /\---/\
    ~~   ~~
...."Have you mooed today?"...

huh?

Zeller's Congruence

Here's one for your junkcode if you haven't already come across it (maybe I'm the only one). Zeller's Congruence (or rule, or algorithm, or ...) allows you to find the day of the week for any given date. Most people would probably use mktime(), but it recently came up on a glibc list where a guy was doing millions of calls; it can get pretty slow.

If you're keen, there is an explanation of how to derive (one version of) it. The most trouble free version I could find looks like

/* Zeller's Congruence to determine day of week */
int get_dayofweek(int date)
{

 int d = date % 100;
 int m = (date % 10000) / 100;
 int y = date / 10000;

 if (m < 3)
 {
     m = m + 12 ;
     y = y - 1;
 }

 return ((2 + d + (13*m-2)/5 + y + y/4 - y/100 + y/400) % 7);

}

int main(void)
{

    /* my birthday */
    int bday = get_dayofweek(19800110);
    char *d;

    switch(bday)
    {
    case 0:
        d = "Sunday";
        break;
    case 1:
        d = "Monday";
        break;
    case 2:
        d = "Tuesday";
        break;
    case 3:
        d = "Wednesday";
        break;
    case 4:
        d = "Thursday";
        break;
    case 5:
        d = "Friday";
        break;
    case 6:
        d = "Saturday";
        break;
    }

    printf("%s\n", d);
}

So it looks like I was born on a Thursday. Cool!

Jonathan Schwartz really is a funny guy

We can only hope he was joking suggesting Apple should move to Solaris on x86-64. I'm not sure how SPARC counts as a "volume platform" (whatever that means); maybe his spell checker accidently replaced a mis-spelling of "vacuum" platform, since everything I've read suggests their market is shrinking.

All will be revealed at the keynote, and no one cares what I think. But here's an alternative.

Dear Steve,

Your experiments with Darwin have hopefully started to show you how innovative systems architectures can provide better performance, security and stability.

We've recently shown that Itanium is an excellent architecture for implementing these systems. Why not have a look at some of the latest generation systems and we'll build something that is ready to push us forward for another twenty years or so.

If people think Xen is cool, wait till they see what you'll be able to do. And how much faster and cleaner you'll do it. Oh, and just like SPARC we can switch between big and little endian mode. Better still, the technology exists to run those PowerPC binaries directly. Not only that; we're a first class target for Linux development which means you've got an ecosystem to grow in. As you might say yourself ... "think about it"!