Go to the first, previous, next, last section, table of contents.


GranSim Profiles

This chapter describes the contents of a GranSim profile (a `.gr' file). In most cases the profiles generated by the visualisation tools should provide sufficient information for tuning the performance of the program. However, it is possible to extract more information out of the generated GranSim profile. This chapter provides information how to do that.

Types of GranSim Profiles

Depending on some runtime-system options different kind of profiles are generated:

Contents of a GranSim Profile

This section describes the syntactic structure of a GranSim profile.

Header

The header contains general information about the execution. It is split into several sections separated by lines only consisting of - symbols. The end of the header is indicated by a line only consisting of + symbols.

The sections of the header are:

Body

.

The body of the GranSim profile contains events that are generated during the execution of the program. The following subsections first describe the general structure of the events and then go into details of several classes of events.

General Structure of an Event

. . .

Each line in the body of a GranSim profile represents one event during the execution of the program. The general structure of one such line is:

The fields are separated by whitespace. A : symbol must follow the time stamp (which must be in sqare brackets).

END Events

.

END events are an exception to this general structure. The reason for their special structure is that they summarise the most important information about the thread. Therefore, information about e.g. the granularity of the threads can be extracted out of END events alone without having to generate a full GranSim profile.

The structure of an END event is:

Basic Thread Events

. . . . . . .

The main events directly related to threads are:

Communication Events

. .

Events that are issued when sending data between processors are:

Thread Migration Events

. . .

These events are only produced when thread migration is enabled (-bM):

Spark Events

. . . . .

When enabling spark profiling, events related to sparks will appear in the profile:

Debugging Events

. .

Certain debug options generate additional events that allow to monitor the internal behaviour of the simulator. This information shouldn't be of interest for the friendly user but might come in handy for those who dare hacking at the runtime-system:

The Emacs GranSim Profile Mode

. . .

Looking up information directly in a GranSim profile is very tedious (believe me, I have done it quite often). To make this task easier the GranSim Toolbox contains a GNU Emacs mode for GranSim profiles: the GranSim Profile Mode.

The most useful features (IMNSHO) are highlighting of parts of a GranSim profile and narrowing of the profile to specific PEs, threads, events etc.

Installation

To use this mode just put the file `GrAnSim.el' somewhere on your Emacs load-path and load the file. I don't have autoload support at the moment, but the file is very short anyway, so directly loading it is quite fast. Currently, the mode requires the hilit19 package for highlighting parts of the profile. It also requires the `tf' script in the bin dir of your GranSim installation.

I use Emacs 19.31 with the default `hilit19.el' package, but the GranSim profile mode has been successfully tested with Emacs 19.27. However, if you have problems with the mode please report it to the address shown at the end of this document (see section Bug Reports).

Customisation

A few Emacs variables control the behaviour of the GranSim Profile mode:

Variable: gransim-auto-hilit
. This variable indicates whether highlighting is turned on by default. Note that you can customise `hilit19' such that it does not automatically highlight buffers that are bigger than a given size. Since GranSim profiles tend to be extremely large you might want to reduce the default value.

Variable: grandir
. The root of the GranSim installation. The mode searches for scripts of the GranSim Toolbox in the directory grandir/bin. By default this variable is set to the contents of the environment variable GRANDIR.

Variable: hwl-hi-node-face
. Face to be used for specific highlighting of a node.

Variable: hwl-hi-thread-face
. Face to be used for specific highlighting of a thread.

Here are the hilit19 variables that are of some interest for the GranSim Profile Mode:

Variable: hilit-auto-highlight
. T if we should highlight all buffers as we find 'em, nil to disable automatic highlighting by the find-file hook. Default value: t.

Variable: hilit-auto-highlight-maxout
. Auto-highlight is disabled in buffers larger than this. Default value: 60000.

Features

. . . .

The main features of the GranSim profile mode are:

Default key bindings in GranSim profile mode:

: C-c t, M-x hwl-truncate
. Truncate event lines such that exactly one line is shown for one event in the body of a profile.

: C-c w, M-x hwl-wrap
. Wrap lines to show them in full length.

: C-c , M-x hwl-toggle-truncate-wrap
. Toggle between the above two modes.

: C-c h, M-x hilit-rehighlight-buffer
. Rehighlight the whole buffer.

: C-c p, M-x hwl-narrow-to-pe
. Narrow the profile to a PE.

: C-c t, M-x hwl-narrow-to-thread
. Narrow the profile to a thread.

: C-c e, M-x hwl-narrow-to-event
. Narrow the profile to an event.

: C-c C-e, (lambda () (hwl-narrow-to-event "END"))
. Narrow the profile to an END event.

: C-c , M-x hwl-toggle-truncate-wrap
. Toggle between the above two modes.

: C-c N, M-x hwl-hi-node
. Highlight a node in the profile.

: C-c T, M-x hwl-hi-thread
. Highlight a thread in the profile.

: C-c C-c, M-x hwl-hi-clear
. Remove highlightings of nodes and threads.


Go to the first, previous, next, last section, table of contents.