Welcome to the second issue of the SimGrid Insider News. The goal of this newsletter is to give to anyone interested a good overview of what's going on in the SimGrid community. It's titled it SimGrid Insider News, in the hope that every reader can become an insider.
This issue focuses on the visualization techniques for simulation analysis currently available in SimGrid. As many of us know, understanding the results produced by SimGrid is challenging, and deducing the causes of the observed effects is even more daunting. To see how to solve this in SimGrid, just keep reading ;)
1 News from the Community
1.1 Release 3.5 imminent
The next release of your preferred simulation toolkit is imminent. After months of hard work, the svn trunk is stabilizing again. According to the compilation farm dashboard, only half a dozen of tests are failing on Linux (and we still experience some portability issues of the bindings on Mac). The goal of releasing before the end of the month is still achievable!
1.2 No new publications around SimGrid?
Surprisingly enough, we got no feedback at all about recently published articles using SimGrid. I can't believe that nobody published anything in the last 6 months! Please people, do not forget to drop me an email if you have something.
2 Feature Highlight: Visualizing SimGrid simulations
As announced in the previous SIN, a paper recently submitted to the TPDS journal describes how Triva can be used for this, from the data gathering process to their graphical representation. Acceptance result is not known yet, but a preliminary version of the paper is already available as a research report. Most of this work were done by Lucas Schnorr during his post-doc at Grenoble, financed by the ANR project USS-SimGrid.
2.1 The Big Lines
SimGrid can be instrumented to keep track of how much power is used for each host and how much bandwidth is used for each link of the platform. This type of tracing allows to observe the overall resources utilization in the first place. It is particularly well adapted to the identification of bottlenecks, evaluation of load-balancing among hosts, and so on.
This resource-centric view can also be turned into application-centric visualization by classifying the resource utilization into categories. In a volunteer computing application, categories could be something like "serving application 1", "serving application 2" and so on. In other settings, one could use the categories to separate "control messages" from "data messages". There is no restriction on the categories you can setup and their semantical meaning.
Once the categories are created, you only need to classify each MSG task in one category, and resource usage of this task will automatically get attached to this category. For that, the tracing interface enables the declaration of categories and functions to mark a task with a previously declared category. By default, the tasks that are not classified into any category are not traced (but you can modify this behavior from the command line, as explained below).
2.2 Enabling tracing of simulations in SimGrid
To use these features, you need the SVN version of SimGrid. Then you have to change one compile-time options. If you use cmake, add -Dtracing=on to your usual configuration line:
cmake -Dtracing=on .
If you prefer ccmake, simply change this option in the interface.
By doing so, the compilation of SimGrid will include several instrumentation functions. Once the configuration is done, rebuild SimGrid:
make
2.3 Controlling the tracing from the command line options
There is no need to change your code to get a first view of your simulations, but you need to pass some specific command line arguments to your simulator for that. As other SimGrid command line options (try to pass –help to your simulator for a complete list), they can be changed with –cfg=… arguments.
- tracing: whether tracing should be enabled (boolean option, default 0)
- tracing/platform: trace categorized resource utilization (boolean option, default 0) Useful with tracing/smpi below to get the details of all MPI calls without resource usage.
- tracing/uncategorized: trace uncategorized resource utilization (boolean option, default 0).
- tracing/smpi: trace the SMPI interface (boolean option, default 0).
- tracing/smpi/group: group MPI processes by host (boolean option, default 0).
- tracing/filename: trace filename (string option, default "simgrid.trace").
Even if you didn't declare any category in your code, you can get a first visualization with these options:
--cfg=tracing:1 --cfg=tracing/platform:1 --cfg=tracing/uncategorized:1
Once you changed your code to categorize your tasks (see below), simply use:
--cfg=tracing:1 --cfg=tracing/platform:1
2.4 Modifying your code to improve your Tracing Experience
This step is optional, and you can skip it to get a first visualization of your code, but you need to do it to refine what you see.
-
For all SimGrid programming interfaces:
TRACE_category (const char *category);
=> declares a category (must be called before using the category)
-
For MSG and SIMDAG tasks:
TRACE_msg_set_task_category (m_task_t task, const char *category);
=> MSG task is categorized according to the category
TRACE_sd_set_task_category(SD_task_t task, const char *category);
=> SIMDAG task is categorized according …
-
For MPI applications compiled with SMPI (smpicc):
TRACE_smpi_set_category(const char *category);
=> The MPI process is classified according to the category
Full examples can be found in ./examples/msg/tracing/. In particular, there is a Master Slaves (ms.c) example using two categories to classify the tasks: "compute" and "finalize".
2.5 Analysis of simulation traces with Triva
The tracing-enabled SimGrid creates a trace file following the Pajé file format. This file contains all the information about the resource usage of your simulation. The trace visualization analysis (ie, the graphical rendering and exploration) is carried out by Triva, a visualization tool with special configurations tuned to SimGrid needs.
Triva is available at http://triva.gforge.inria.fr/. Once installed, all you need to do is to launch Triva, passing as parameter the trace file produced by the simulation:
Triva --graph simgrid.trace
=> A graph visualization able to pinpoint network bottlenecks on simulations
Triva --treemap simgrid.trace
=> A squarified treemap to large-scale analysis with many processes
SMPI simulations can be also analyzed through the traditional Gantt-Chart view. To do so, you have to run the MPI application with smpirun and pass the following parameters:
-trace smpi.trace
The visualization is carried out by the Pajé visualization tool.
Paje
and then use the menu to select the trace file generated by the simulation.
For more details on the trace exploration facilities offered, please see the screencasts of the next section.
2.6 ScreenCasts Demonstrating the Simulation Analysis Capabilities
SimGrid was present in New Orleans last week for SuperComputing'10. Three demonstrations took place in the exhibition hall of the conference. Here are the links to the videos on Youtube: