Pi Zero vs Cray-2 --- Bambi vs Godzilla who will win?
First we examine the specifications for the awesome Cray-2 super computer, billed by NASA in the mid nineteen eighties as "The most powerful computer on earth! (youtube video link)"
Configuration: 14 vertical columns 336 Pluggable Modules
Overall Dimensions: 45 inches (1.14m) x 53 inches (1.35m)
Total Weight: 5500 lbs (2500kg)
Power Consumption: 195kW
Cooling: Liquid inert fluorocarbon with heat exchange to cold water cooling tower
Cost >30 Million USD (in 1985 dollars not counting additional facilities costs)
Here's the Wikipedia link for the Crey-2 with lots of nice photos.
Compare that to the Pi Zero that weighs a few grams, draws about a Watt, and costs 5 dollars.
I chose the Cray-2 because it is perhaps one of the most recognizable iconic supercomputers of that era, and in January 1986 it was used by a really smart fellow named David H. Bailey, to smash the then world record by calulating Pi to a never before seen 29,360,111 digits in 28 hours.
Later that year a Japanese team used a souped up Hitachi HITAC S-810/20 supercomputer to calculate Pi to 33,554,414 digits in only 8 hours.
These Pi calculations give us an easy way to reach across time and benchmark the litle Raspberry Pi Zero against these mega-monster supercomputers from another era, by attempting to duplicate their feat and compare the result.
It's not too complicated, I promise, just 3 simple steps.
First we'll need a good program to do the calculation. This is very important, because software advances are just as important to overall performance as hardware.
So as step (1), we will grab a cutting edge math library to do the calculations by booting up the Pi Zero, opening a terminal and typing:
sudo apt-get install libgmp-dev
This gets us the development libraries needed to compile C code that uses The GNU Multiple Precision Arithmetic Library.
Then as step (2) grab this short c program from this page on the GMP website
Then for step (3) compile it by opening a terminal in the directory you downloaded the gmp-chudnovsky.c file to and compile it with:
gcc -O2 -Wall -o gmp-chudnovsky gmp-chudnovsky.c -lgmp -lm
THAT'S IT! - we are ready to benchmark the Pi Zero against Super Computers from a bygone era by calculating Pi to MILLIONS OF DIGITS.
Fist let's run a really quick test to check if everything is working, by running the following from the same terminal we just used to compile the code:
./gmp-chudnovsky 60 1
This should print out 60 digits of Pi in an unusual exponential form, with the final 'e1' indicating that it should be multiplied by 10.
Now for the final test:
time ./gmp-chudnovsky 40000000 1
Your Pi Zero will sit printing out progress dots for about 25 minutes, then pause a few minutes, then spit out 40 MILLION DIGITS OF PI.
So, the final result is that the Pi Zero calculates 40,000,000 digits of Pi in only a half hour, compared to 29,360,111 digits of Pi in 28 hours for the Cray-2 and 33,554,414 million in 8 hours for the Hitachi HITAC S-810/20.
The Pi Zero didn't just beat both these iconic supercomputers it DEMOLISHED them.
Bambi CRUSHES Godzilla !