What is active messaging? or “the master thief”

What is active messaging? or “the master thief”

Welcome to my first blogpost about my project in Edinburgh! I have to admit, the heading is quite dramatic, and I’m not sure if I can live up to your expectations while talking about some obscure computing topic, for which the Wikipedia article mostly consist of a big warning box about content issues. But I’ll try my best!

Maybe I should first describe my project in a few sentences: EPCC (the super-computing institute in Edinburgh) have created a library for writing parallel code. Its idea is that the programmer does not care about the actual transfer of data between the processes, they just define tasks which are automatically executed if certain conditions are fulfilled. My task in this remaining six weeks is to replace the messaging-backend of the library from MPI to an API called GASNet.

GASNet and active messaging

GASNet (Global Adress Space Networking) and MPI (Message Passing Interface) are both standardized APIs for communication between processes. But that is about everything they have in common. One finds out the first big difference very quickly: For GASNet you can’t find help on the internet. No code snippets in stackoverflow, no threads in obscure IT-forums. Apparently, nobody uses this API or at least nobody has questions about it. This was surprising to me, since I had many questions and it has a very different approach than MPI.

Picture of the "thief-analogy" for active messages.
A typical day for a process in a supercomputing environment. All used images are license free content.

This approach is called “active messaging” (AM). To illustrate that, imagine your supercomputer is a small town. You are the local process, and in your house you have your local memory in a chest. With MPI, another friendly process asks for some data, and you call a postman, who delivers your parcel to the right adress. In contrast to that, the active message is like a thief. He goes right into your local memory, picks up what he needs, and disappears. You can only detect him by checking, if he has modified your data, and you also cannot stop him from doing this. He is truly a master thief! Maybe he also leaves things at your chest, but that’s the point where the picture becomes slightly unrealistic.

Of course, if you write your code, there are no active messages who steal your data. I just want to point out that there is no kind of recieving function call on the target process like with MPI. The message is called active, because it carries its own executable function with it, not just passive data.

Scheme which describes request- and reply during an active message.
Scheme of AM usage. After the message arrived, the program flow of process 1 is interrupted, and the request-function is executed. The user can decide if he wants to send data. Sometimes the reply is optional.

Why should one do such things? You can understand it better, if you take a look at the hardware-level and how communication is implemented there, as it’s in nearly the same way! The process sends its message through the wires, and then in the target process there is a hardware-interrupt, so the execution of the normal program stops, and commands necessary for receiving the message are executed. Then the execution of the main program continues. Our hope is if you emulate this also on software-level, you can get better performance. But more about that in later posts…

Some thoughts about Edinburgh

Now, after you survived the dry part about technical stuff, I want to finish the post with some impressions of Edinburgh, a quite interesting city (but which city is not interesting?). But not everything is fast and simple there. For example, some streets change their name every 200m, if you waited for the green light on each crossroad, you would need twice the time Google maps suggests. In particular, Google maps isn’t very helpful, especially if you’re searching for concurrency-exchange offices (which seems to be a very volatile business here).

Roof-top bar in Edinburgh with view to the castle.
Conclusion of a working day in a roof-top bar below the castle of Edinburgh.

But apart from that, I really like it! All people we met, especially at EPCC, where very nice and friendly. In about three weeks “the Fringe” (a huge art festival) begins, so the whole city is preparing for it, with stages assembled in every corner. My site-coordinator told us, that the population of Edinburgh will increase from about 400,000 to 1.5 Million people during this time. I’m sure August will be a totally different experience!

Tagged with: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.