I’m now the proud owner of a Raspberry Pi 4B. Naturally, I wanted to see how it performed using the Whetstone double precision benchmark. In FORTRAN, obviously. Over ten runs it averaged a single core performance of 1,259,871 KIPS. This is 2.4x faster than its predecessor, the 3B+, and 8.3x faster than the original model B, released in 2012.
I’ve not yet decided what to do permanently with the latest addition to my collection. The others are used as a weather station, security cameras and for general tinkering. The graphics performance of the Pi 4B isn’t quite good enough to wean me off my Windows 10 PC for general office work and image editing. It’s not too far off being acceptable however. At £76.50 for the 4GB version (with a case, 3A power supply and Micro HDMI lead) it’s definitely better value.
The Pi 4B does get warm in use. vcgencmd reports a cpu temperature of 60 to 65 degrees Celsius when not under load. By way of contrast, my 3B+ idles at 50 degrees and the Pi Zero at 35 degrees. A heatsink or fan would seem like a good investment.
I’m currently playing with the gfortran OpenMP compiler directives. I’ve already figured out the first two gotchas. The first is that gfortran wants the source file extension to be .f90 rather than .f (otherwise it ignores the OpenMP parallelisation directives in the code). The second is that the GNU implementation of FORTRAN 90 breaks backwards compatibility for traditional FORTRAN comments. Both were simple enough to fix once I’d worked out what was happening.
The compiler optimisation flags (-O1, -O2, and -O3) make a significant difference to performance. For benchmarking purposes I’ve not used them, but for any compute-intensive work they’re worth experimenting with. However, I still have nightmares about compiler optimisation settings breaking my code in the 1980s, hence my caution. Old habits die hard. The remaining challenge is figuring out which loops to parallelise. I have lots of not so lovely segmentation faults happening at the moment. Oh well.
The Raspberry Pi is one of the few things that make me feel proud to be British at the moment. Jo Swinson in her pitch to become the leader of the Liberal Democrats stresses the importance of the UK investing in technological leadership. She’s right, but we’ll need hundreds of similar successes. This is difficult enough to see happening while we’re still in the EU, let alone if we end up outside.