Home > hardware > GAP on the Pi

GAP on the Pi

GAP is a system for computational discrete algebra… but I probably should not spend too much time introducing it. Either you know it very well, or you can get all the information from here. I work with it and develop for it every day.  One good thing about it that its kernel is written in standard C, so it is easy to get it working on many different systems.

Raspberry Pi is a little computer that invokes 10% of the feeling of the good old days in the 8-bit era. If you think 10% is a low value, well, today’s computers give 0.1% of the inspiration we experienced back then in 80’s early 90’s, so comparatively Raspberry Pi is doing very well. Again, no need to introduce it. In case you haven’t heard of it, then it is time to catch up. Here or here.

I ordered two of these without knowing what to do with them. One I gave away as a gift, the second one I tried it as a media center. Spectacular success, though my friends were not so excited. The general opinion was that it did not matter on what sort of gadget we watched the movie… Hm, I simply don’t understand people… 🙂

So as a next step I put Arch Linux on it. When I got to the command line (few seconds) I realized that GAP was missing. It takes 106 minutes to compile it form source (mainly because of the GMP library) but then, of course, it works nicely.

Later I got carried away and installed the GUI packages as well.


Here is the Raspberry Pi calculating the holonomy decomposition of the full transformation semigroup on 5 points. As a nontrivial but very simple exercise.

DSC02843Yes, nontrivial calculations require all the processor power, but the chip does not get too hot. Without any cooling…  It is not fast, but requires little power.


Why doing this? Certainly not for the performance gain. Heavy mathematical calculations are really slow on the Pi, but that is exactly the point. When testing new algorithms it is easier to detect performance bottlenecks on a slower machine. We get lazy on big rigs and don’t produce quality code, unlike in the 8-bit era, where lousy programming yielded no result at all. So, if your algorithm works on the Pi then it will not waste kilowatts on the research cluster.

Also, we develop mathematical software and produce mathematical results eventually used in proofs. Computer calculated results have to be checked carefully. Ideally, given an algorithm we would implement it on two different platforms, using different programming languages developed by two independent teams. That is a luxury we simply cannot afford. However, Raspberry Pi provides us the possibility to test the code on a different architecture at least.

Now I’m checking the availability of a C compiler for our washing machine… 😉

UPDATE: I sometimes use this system for software development. Due to its minimality, it is distraction-free.

  1. jenkyfunds
    August 1, 2013 at 10:46 am

    I like it, I’ll have to use the phrase: ‘lousy programming yielded no result at all’ more often!

  2. Sven Reichard
    August 1, 2013 at 10:58 am

    How many GAPStones do you get? 😉

    • August 1, 2013 at 12:09 pm

      GAP4stones 3460, time 1211380ms (~20mins) for testinstall.g with the 4.7 beta.

  3. martin Schönert
    August 2, 2013 at 8:34 am

    Very nice article. I should probably get a Raspberry PI.
    One historical note. GAP 2 and GAP 3 were mostly developed on an Atari ST. And GAPStones were normalized so that the Atari ST would run at 1000 GAPStones. So if GAP4Stones were still normalized the same way (which I know they are not) that would tell us that the Raspberry PI is more than 3 times faster than the Atari ST. 😉

    • August 2, 2013 at 9:07 am

      Thank you Martin, for the very interesting comments on the historical roots! I had an Amiga, but anyway, I was not involved in computer algebra at that time.. 🙂

      I do recommend the Raspberry Pi for the fun of it. As you could see, one can find a meaningful purpose after buying it. And I more than agree with the original purpose of the Cambridge team, to show kids that computing is fun, not just something consumable.

  1. May 4, 2014 at 4:22 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: