NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 
PackagePlatformVersionModule Docs
(*) Denotes limited support

VAMPIR

VAMPIR is a graphical tool for viewing trace files generated by performance analysis tools such as VAMPIRtrace. VAMPIRtrace is available on the IBM SP to analyze the performance and message passing characteristics of parallel programs written in Fortran, C or C++ that use the MPI library.

The default version of vampir and vampirtrace are suitable for AIX 5.1, and 32 bit or 64 bit MPI. Full documentation for these new versions is not available yet, but the majority of the functionality is the same as in the older versions. Rather terse man pages are installed on the IBM SP.

VAMPIR converts the tracefile results into a variety of useful graphical displays, including timelines showing state changes and communication between processors, charts and tables displaying execution times of routines, and plots indicating message sizes and transmission rates.

In order to use VAMPIR, you must first generate a trace file. Then you use VAMPIR to view the contents of that trace file in various formats. Finally, you can instrument your code by inserting special calls to obtain the more detailed information required for an advanced profiling session.

Generating a trace file

A trace file can be generated using VAMPIRtrace.

VAMPIR and VAMPIRtrace must be explicitly accessed via the module command. To load the modules use:

% module load vampir vampirtrace

This command can be added to your .login.ext file to load these packages for every session.

To use VAMPIRtrace, you can make use of the environment variables set by the module command: VTLIB is the path to the libraries, VTINC is the path to the include files (required if you wish to use the VAMPIRtrace API). On the SP, compile using:

% mpxlf_r $VTINC $VTLIB source.f 
% mpcc_r  $VTINC $VTLIB source.c

(Note: you need the "_r" compilers) and run using poe:

% poe ./a.out -nodes 2 -procs 4

A trace file will be created that has the extension ".bvt". This trace file can be examined using VAMPIR.

Note that if you are using the IBM Parallel Engineering and Scientific Subroutine Library (PESSL) with the BLACS, the MPI calls are hidden withing the BLACS and PESSL routines, and thus VAMPIRtrace cannot find them; your entire trace results will be a solid block of "user code." In order to make the MPI calls visibile to VAMPIRtrace, you may use the NERSC/ScaLAPACK and BLACS libraries. You would then compile using:

% module load scalapack
% mpxlf_r $PBLAS $BLACS $SCALAPACK -lessl $VTINC $VTLIB source.f

Analyzing the trace file using VAMPIR

To run VAMPIR on a tracefile named a.out.bpv type

% vampir a.out.bpv

This will bring up a main menu window and a global timeline display window. The timeline display has every message that was sent and received throughout the entire program. Time increases from left to right. Each horizontal green bar represents a processor. The thin lines extending between the bars represent the individual messages. Time spent in an MPI call is shown in red, and application work is green.

For example, the following screen is the default display for an MPI test code run on two tasks that sends a single message from task 0 to task 1 using a non-blocking send.

vampir screen shot vampir screen shot

You can zoom in on a segment of the display by drawing a rectangle (using the left mouse button) over a small section. This will allow individual message to be visually resolved.

You can also find information about a given message by pressing the right mouse button and selecting "Identify message" from the menu. The cursor will change upon making the selection. By clicking on any red section, a small window will appear with the details of the message. For example, this procedure will produce the following window for the solitary message in the test code.

VAMPIR image

Other displays are available in addition to the timeline display, such as a pie chart or bar graph. This can be done by clicking on activity chart or summary chart, respectively.

Instrumenting your code with VAMPIRtrace calls

Simply linking your code with the VAMPIRtrace libraries will provide overall statistics and timeline information, but this is often of little use in determining how to actually improve the performance of your code. The only way to get information about specific routines is to instrument your code with VAMPIRtrace calls.

Header files with the necessary parameter, macro and function declarations are provided in the include file VT.inc for Fortran and VT.h for C. VAMPIRtrace starts generating profiling data immediately after MPI_Init has been executed. This data collection can be arbitrarily started and stopped using the following two functions.

Fortran C
SUBROUTINE VTTRACEOFF() void VT_traceoff(void)
SUBROUTINE VTTRACEON() void VT_traceon(void)

Note: These functions affect the calling process only. They must be called by all processes to record profiling globally.

This is much more useful than having every message traced, but still can produce output that is difficult to sort through. The best way to get practical information about time-intensive portions of your code is collecting data on a user-defined activity. An activity is a process state that has a defined start and stop time. It is identified by assigning a class name and symbolic name. The symbolic name is a subset of the class name, meaning that the same class can contain an arbitrary number of symbols.

The function calls to define, begin and end activities are in the following table.

Fortran C
SUBROUTINE VTSYMDEF(ICODE, SYMBOL, CLASS, IERR) void VT_symdef(int code, char, *symbol, char, *class)
SUBROUTINE VTBEGIN(ICODE, IERR) void VT_begin(int code)
SUBROUTINE VTEND(ICODE, IERR) void VT_end(int code)

Additional Information


LBNL Home
Page last modified: Mon, 16 Aug 2004 18:20:07 GMT
Page URL: http://www.nersc.gov/nusers/resources/software/tools/vampir.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science