User Guide
User Guide
Contents iii
List of Tables ix
2 Introduction 5
iii
4.7 XML Section: Callers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.8 XML Section: User functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.9 XML Section: Performance counters . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.9.1 Processor performance counters . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.9.2 Network performance counters . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.9.3 Operating system accounting . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.10 XML Section: Storage management . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.11 XML Section: Buffer management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.12 XML Section: Trace control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.13 XML Section: Bursts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.14 XML Section: Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.15 XML Section: Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.16 XML Section: CUDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.17 XML Section: OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.18 XML Section: Merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.19 Using environment variables within the XML file . . . . . . . . . . . . . . . . . . . . 29
5 Extrae API 31
5.1 Basic API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.2 Extended API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 Special considerations for Cell Broadband Engine tracing package . . . . . . . . . . . 37
5.3.1 PPE side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.2 SPE side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6 Merging process 39
6.1 Paraver merger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.1.1 Sequential Paraver merger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.1.2 Parallel Paraver merger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.2 Dimemas merger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.3 Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.3.1 Environment variables suitable to Paraver merger . . . . . . . . . . . . . . . 44
6.3.2 Environment variables suitable to Dimemas merger . . . . . . . . . . . . . . . 44
7 Examples 45
7.1 DynInst based examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.1.1 Generating intermediate files for serial or OpenMP applications . . . . . . . . 45
7.1.2 Generating intermediate files for MPI applications . . . . . . . . . . . . . . . 46
7.2 LD PRELOAD based examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2.1 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2.2 CUDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.2.3 AIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.3 Statically linked based examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.3.1 Linking the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.3.2 Generating the intermediate files . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.4 Generating the final tracefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
iv
A An example of Extrae XML configuration file 53
B Environment variables 57
D Instrumented routines 67
D.1 Instrumented MPI routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
D.2 Instrumented OpenMP runtimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
D.2.1 Intel compilers - icc, iCC, ifort . . . . . . . . . . . . . . . . . . . . . . . . . . 69
D.2.2 IBM compilers - xlc, xlC, xlf . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
D.2.3 GNU compilers - gcc, g++, gfortran . . . . . . . . . . . . . . . . . . . . . . . 71
D.3 Instrumented pthread runtimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
D.4 Instrumented CUDA routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
D.5 Instrumented OpenCL routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
v
vi
List of Figures
vii
viii
List of Tables
ix
x
Chapter 1
The unpacking process will create different directories on the current directory (see table 1.1).
Directory Contents
bin Contains the binary files of the Extrae tool.
etc Contains some scripts to set up environment variables and the
Extrae internal files.
lib Contains the Extrae tool libraries.
share/man Contains the Extrae manual entries.
share/doc Contains the Extrae manuals (pdf, ps and html versions).
share/example Contains examples to illustrate the Extrae instrumentation.
1
Figure 1.1: An example of the extrae-post-installation-upgrade.sh script execution
some questions about the location of several libraries needed by Extrae . The script shows the
current value for the library directories and gives the user the chance to change them. In case the
libraries were unused at configure time, thet current value will be an empty string.
There are several included examples in the installation package. These examples are in-
stalled in ${EXTRAE HOME}/share/example and cover different application types (including
serial/MPI/OpenMP/CUDA/etc). We suggest the user to look at them to get an idea on how
to instrument their application.
Once the package has been unpacked, set the EXTRAE HOME environment variable to the directory
where the package was installed. Use the export or setenv commands to set it up depending on
the shell you use. If you use sh-based shell (like sh, bash, ksh, zsh, ...), issue this command
export EXTRAE_HOME=dir
however, if you use csh-based shell (like csh, tcsh), execute the following command
where dir refers where the Extrae was installed. Henceforth, all references to the usage of the
environment variables will be used following the sh format unless specified.
Extrae is offered in two different flavors: as a DynInst-based application, or stand-alone appli-
cation. DynInst is a dynamic instrumentation library that allows the injection of code in a running
application without the need to recompile the target application. If the DynInst instrumentation
library is not installed, Extrae also offers different mechanisms to trace applications.
2
1.2.1 Quick running Extrae - based on DynInst
Extrae needs some environment variables to be setup on each session. Issuing the command
source ${EXTRAE_HOME}/etc/extrae.sh
on a sh-based shell, or
source ${EXTRAE_HOME}/etc/extrae.csh
on a csh-based shell will do the work. Then copy the default XML configuration file1 into the
working directory by executing
cp ${EXTRAE_HOME}/share/example/MPI/extrae.xml .
If needed, set the application environment variables as usual (like OMP NUM THREADS, for ex-
ample), and finally launch the application using the ${EXTRAE HOME}/bin/extrae instrumenter
like:
source ${EXTRAE_HOME}/etc/extrae.sh
on a sh-based shell, or
source ${EXTRAE_HOME}/etc/extrae.csh
on a csh-based shell will do the work. Then copy the default XML configuration file1 into the
working directory by executing
cp ${EXTRAE_HOME}/share/example/MPI/extrae.xml .
export EXTRAE_CONFIG_FILE=extrae.xml
If needed, set the application environment variables as usual (like OMP NUM THREADS, for exam-
ple). Just before executing the target application, issue the following command:
export LD_PRELOAD=${EXTRAE_HOME}/lib/<lib>
3
Library Application type
Serial MPI OpenMP pthread SMPss nanos/OMPss CUDA
libseqtrace Yes X
libmpitrace2 Yes X
libomptrace Yes X
libpttrace Yes X
libsmpsstrace Yes X
libnanostrace Yes X
libcudatrace Yes X
libompitrace2 Yes X Yes X
libptmpitrace2 Yes X Yes X
libsmpssmpitrace2 Yes X Yes X
libnanosmpitrace2 Yes X Yes X
libcudampitrace2 Yes X Yes X
Table 1.2: Available libraries in Extrae. Their availability depends upon the configure process.
The result of the merge process is a Paraver tracefile called output.prv. If the -o option is not
given, the resulting tracefile is called EXTRAE Paraver Trace.prv.
4
Chapter 2
Introduction
Extrae is a dynamic instrumentation package to trace programs compiled and run with the shared
memory model (like OpenMP and pthreads), the message passing (MPI) programming model or
both programming models (different MPI processes using OpenMP or pthreads within each MPI
process). Extrae generates trace files that can be visualized with Paraver .
Extrae is currently available on different platforms and operating systems: IBM PowerPC run-
ning Linux or AIX, and x86 and x86-64 running Linux. It also has been ported to OpenSolaris and
FreeBSD.
The combined use of Extrae and Paraver offers an enormous analysis potential, both qualitative
and quantitative. With these tools the actual performance bottlenecks of parallel applications can
be identified. The microscopic view of the program behavior that the tools provide is very useful
to optimize the parallel program performance.
This document tries to give the basic knowledge to use the Extrae tool. Chapter 3 explains how
the package can be configured and installed. Chapter 7 explains how to monitor an application to
obtain its trace file. At the end of this document there are appendices that include: a Frequent
Asked Questions appendix and a list of routines instrumented in the package.
5
• customizable semantics of the visualized information.
One of the main features of Paraver is the flexibility to represent traces coming from different
environments. Traces are composed of state records, events and communications with associated
timestamp. These three elements can be used to build traces that capture the behavior along time
of very different kind of systems. The Paraver distribution includes, either in its own distribution
or as additional packages, the following instrumentation modules:
2. Parallel application tracing: a set of modules are optionally available to capture the activity
of parallel applications using shared-memory, message-passing paradigms, or a combination
of them.
4. Hardware counters tracing: an application to trace the hardware counter values is optionally
available in the Paraver distribution.
6
Chapter 3
• --enable-merge-in-trace
Embed the merging process in the tracing library so the final tracefile can be generated
automatically from the application run.
• --enable-parallel-merge
Build the parallel mergers (mpimpi2prv/mpimpi2dim) based on MPI.
• --enable-posix-clock
Use POSIX clock (clock gettime call) instead of low level timing routines. Use this option
if the system where you install the instrumentation package modifies the frequency of its
processors at runtime.
• --enable-single-mpi-lib
Produces a single instrumentation library for MPI that contains both Fortran and C wrappers.
Applications that call the MPI library from both C and Fortran languages need this flag to
be enabled.
• --enable-spu-write
Enable direct write operations to disk from SPUs in CELL machines avoiding the usage of
DMA transfers. The write mechanism is very slow compared with the original behavior.
• --enable-sampling
Enable PAPI sampling support.
• --enable-pmapi
Enable PMAPI library to gather CPU performance counters. PMAPI is a base package
installed in AIX systems since version 5.2.
7
• --enable-openmp
Enable support for tracing OpenMP on IBM and GNU runtimes. The IBM runtime instru-
mentation is only available for PowerPC systems.
• --enable-smpss
Enable support for tracing SMP-superscalar.
• --enable-nanos
Enable support for tracing Nanos run-time.
• --enable-pthread
Enable support for tracing pthread library calls.
• --enable-upc
Enable support for tracing UPC run-time.
• --enable-xml
Enable support for XML configuration (not available on BG/L, BG/P and BG/Q systems).
• --enable-xmltest
Do not try to compile and run a test LIBXML program.
• --enable-doc
Generates this documentation.
• --prefix=DIR
Location where the installation will be placed. After issuing make install you will find
under DIR the entries lib/, include/, share/ and bin/ containing everything needed to
run the instrumentation package.
• --with-mpi=DIR
Specify the location of an MPI installation to be used for the instrumentation package. This
flag is mandatory.
• --with-binary-type=OPTION
Available options are: 32, 64 and default. Specifies the type of memory address model when
compiling (32bit or 64bit).
• --with-boost=DIR
Specify the location of the BOOST package. This package is required when using the DynInst
instrumentation with versions newer than 7.0.1.
• --with-mpi-name-mangling=OPTION
Available options are: 0u, 1u, 2u, upcase and auto. Choose the Fortran name decoration (0,
1 or 2 underscores) for MPI symbols. Let OPTION be auto to automatically detect the name
mangling.
• --with-pacx=DIR
Specify where PACX communication library can be find.
8
• --with-unwind=DIR
Specify where to find Unwind libraries and includes. This library is used to get callstack
information on several architectures (including IA64 and Intel x86-64). This flag is mandatory.
• --with-papi=DIR
Specify where to find PAPI libraries and includes. PAPI is used to gather performance
counters. This flag is mandatory.
• --with-bfd=DIR
Specify where to find the Binary File Descriptor package. In conjunction with libiberty, it is
used to translate addresses into source code locations.
• --with-liberty=DIR
Specify where to find the libiberty package. In conjunction with Binary File Descriptor, it is
used to translate addresses into source code locations.
• --with-dyninst=DIR
Specify the installation location for the DynInst package. Extrae also requires the DWARF
package --with-dwarf=DIR when using DynInst. Also, newer versions of DynInst (versions
after 7.0.1) require the BOOST package --with-boost. This flag is mandatory. Requires a
working installation of a C++ compiler.
• --with-cuda=DIR
Enable support for tracing CUDA calls on nVidia hardware and needs to point to the CUDA
SDK installation path. This instrumentation is only valid in binaries that use the shared ver-
sion of the CUDA library. Interposition has to be done through the LD PRELOAD mechanism.
It is superseded by --with-cupti=DIR which also supports instrmentation for static binaries.
• --with-cupti=DIR
Specify the location of the CUPTI libraries. CUPTI is used to instrument CUDA calls, and
supersedes the --with-cuda, although it still requires --with-cuda.
3.2 Build
To build the instrumentation package, just issue make after the configuration.
3.3 Installation
To install the instrumentation package in the directory chosen at configure step (through --prefix
option), issue make install.
3.4 Check
The Extrae package contains some consistency checks. The aim of such checks is to determine
whether a functionality is operative in the target (installation) environment and/or check whether
the development of Extrae has introduced any misbehavior. To run the checks, just issue make
check after the installation. Please, notice that checks are meant to be run in the machine that the
9
configure script was run, thus the results of the checks on machines with back-end nodes different
to front-end nodes (like BG/* systems) are not representative at all.
3.5.2 BlueGene/Q
To enable parsing the XML configuration file, the libxml2 must be installed. As of the time of
writing this user guide, we have been only able to install the static version of the library in a
BG/Q machine, so take this into consideration if you install the libxml2 in the system. Simi-
larly, the binutils package (responsible for translating application addresses into source code loca-
tions) that is available in the system may not be properly installed and we suggest installing the
binutils from the source code using the BG/Q cross-compiler. Regarding the cross-compilers, we
have found that using the IBM XL compilers may require using the XL libraries when generat-
ing the final application binary with Extrae, so we would suggest using the GNU cross-compilers
(/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-*).
If you want to add libxml2 and binutils support into Extrae, your configuration command may
resemble to:
./configure --prefix=/homec/jzam11/jzam1128/aplic/juqueen/extrae/2.2.1
--with-mpi=/bgsys/drivers/ppcfloor/comm/gcc --without-unwind
--without-dyninst --disable-openmp --disable-pthread
--with-libz=/bgsys/local/zlib/v1.2.5
--with-papi=/usr/local/UNITE/packages/papi/5.0.1
--with-xml-prefix=/homec/jzam11/jzam1128/aplic/juqueen/libxml2-gcc
--with-binutils=/homec/jzam11/jzam1128/aplic/juqueen/binutils-gcc
--enable-merge-in-trace
10
Otherwise, if you do not want to add support for the libxml2 library, your configuration may
look like this:
./configure --prefix=/homec/jzam11/jzam1128/aplic/juqueen/extrae/2.2.1
--with-mpi=/bgsys/drivers/ppcfloor/comm/gcc --without-unwind
--without-dyninst --disable-openmp --disable-pthread
--with-libz=/bgsys/local/zlib/v1.2.5
--with-papi=/usr/local/UNITE/packages/papi/5.0.1 --disable-xml
In any situation, the build and installation commands are:
make
make install
3.5.3 AIX
Some extensions of Extrae do not work properly (nanos, SMPss and OpenMP) on AIX. In addition,
if using IBM MPI (aka POE) the make will complain when generating the parallel merge if the
main compiler is not xlc/xlC. So, you can either change the compiler or disable the parallel merge
at compile step. Also, command ar can complain if 64bit binaries are generated. It’s a good idea
to run make with OBJECT MODE=64 set to avoid this.
Configuration command:
make
make install
Configuration command:
11
3.5.4 Linux
Compiling using default binary type using MPICH, OpenMP and PAPI
Configuration command:
./configure --prefix=PREFIX --with-mpi=/home/harald/aplic/mpich/1.2.7
--with-papi=/usr/local/papi --enable-openmp --without-dyninst
--without-unwind
Build and installation commands:
make
make install
12
make
make install
Compiling using default binary type, using OpenMPI, DynInst and libunwind
Configuration command:
./configure --prefix=PREFIX --with-mpi=/home/harald/aplic/openmpi/1.3.1
--with-dyninst=/home/harald/dyninst/7.0.1 --with-dwarf=/usr
--with-elf=/usr --with-unwind=/home/harald/aplic/unwind/1.0.1
--without-papi
Build and installation commands:
make
make install
13
To compile it, just issue:
make
make install
Configuration command:
make
make install
If using the GNU toolchain to compile the library, we suggest at least using version 4.6.2 because
of its enhaced in this architecture.
Configuration command:
CC=/gpfs/APPS/BIN/GCC-4.6.2/bin/gcc-4.6.2 ./configure
--prefix=/gpfs/CEPBATOOLS/extrae/2.2.0
--with-unwind=/gpfs/CEPBATOOLS/libunwind/1.0.1-git
--with-papi=/gpfs/CEPBATOOLS/papi/4.2.0 --with-mpi=/usr --enable-posix-clock
--without-dyninst
Build and installation commands:
make
make install
Configuration command:
make
make install
14
Compiling in a environment with IBM compilers and POE
Configuration command:
CC=xlc CXX=xlC ./configure --prefix=PREFIX --with-mpi=/opt/ibmhpc/ppe.poe
--without-dyninst --without--unwind --without-papi
Build and installation commands:
make
make install
this command will show the configure command itself and the location of some dependencies of
the instrumentation package.
15
16
Chapter 4
Extrae is configured through a XML file that is set through the EXTRAE CONFIG FILE environment
variable. The included examples provide several XML files to serve as a basis for the end user.
There are four XML files:
• extrae.xml Exemplifies all the options available to set up in the configuration file. We will
discuss below all the sections and options available. It is also available on this document on
appendix A.
• extrae explained.xml The same as the above with some comments on each section.
• summarized trace basic.xml A small example for gathering information of MPI and OpenMP
information with some performace counters and calling information at each MPI call.
• detailed trace basic.xml A small example for gathering a summarized information of MPI
and OpenMP parallel paradigms.
Please note that most of the nodes present in the XML file have an enabled attribute that
allows turning on and off some parts of the instrumentation mechanism. For example, <mpi
enabled="yes"> means MPI instrumentation is enabled and process all the contained XML subn-
odes, if any; whether <mpi enabled="no"> means to skip gathering MPI information and do not
process XML subnodes.
Each section points which environment variables could be used if the tracing package lacks XML
support. See appendix B for the entire list.
Sometimes the XML tags are used for time selection (duration, for instance). In such tags, the
following postfixes can be used: n or ns for nanoseconds, u or us for microseconds, m or ms for
milliseconds, s for seconds, M for minutes, H for hours and D for days.
<?xml version=’1.0’?>
17
<trace enabled="yes"
home="@sed_MYPREFIXDIR@"
initial-mode="detail"
type="paraver"
xml-parser-id="@sed_XMLID@"
>
</trace>
The <?xml version=’1.0’?> is mandatory for all XML files. Don’t touch this. The available
tunable options are under the <trace> node:
• home Set to where the instrumentation package is installed. Usually it points to the same
location that EXTRAE HOME environment variable.
• xml-parser-id This is used to check whether the XML parsing scheme and the file scheme
match or not.
See EXTRAE ON, EXTRAE HOME, EXTRAE INITIAL MODE and EX-
TRAE TRACE TYPE environment variables in appendix B.
<mpi enabled="yes">
<counters enabled="yes" />
</mpi>
18
MPI calls can gather performance information at the begin and end of MPI calls. To activate
this behavior, just set to yes the attribute of the nested <counters> node.
See EXTRAE DISABLE MPI and EXTRAE MPI COUNTERS ON environment
variables in appendix B.
<pacx enabled="yes">
<counters enabled="yes" />
</pacx>
PACX calls can gather performance information at the begin and end of PACX calls. To activate
this behavior, just set to yes the attribute of the nested <counters> node.
See EXTRAE DISABLE PACX and EXTRAE PACX COUNTERS ON environ-
ment variables in appendix B.
<pthread enabled="yes">
<locks enabled="no" />
<counters enabled="yes" />
</pthread>
The tracing package allows to gather information of some pthread routines. In addition to that,
the user can also enable gathering information of locks and also gathering performance counters
in all of these routines. This is achieved by modifying the enabled attribute of the <locks> and
<counters>, respectively.
See EXTRAE DISABLE PTHREAD, EXTRAE PTHREAD LOCKS and EX-
TRAE PTHREAD COUNTERS ON environment variables in appendix B.
19
<openmp enabled="yes">
<locks enabled="no" />
<counters enabled="yes" />
</openmp>
The tracing package allows to gather information of some OpenMP runtimes and outlined
routines. In addition to that, the user can also enable gathering information of locks and also
gathering performance counters in all of these routines. This is achieved by modifying the enabled
attribute of the <locks> and <counters>, respectively.
See EXTRAE DISABLE OMP, EXTRAE OMP LOCKS and EX-
TRAE OMP COUNTERS ON environment variables in appendix B.
<cell enabled="no">
<spu-file-size enabled="yes">5</spu-file-size>
<spu-buffer-size enabled="yes">64</spu-buffer-size>
<spu-dma-channel enabled="yes">2</spu-dma-channel>
</cell>
• spu-file-size Limits the resulting intermediate trace file for each SPE thread that has been
instrumented.
• spu-buffer-size Specifies the number of events contained in the buffer on the SPE side.
Remember that memory is very scarce on the SPE, so setting a high value can exhaust all
memory.
• spu-dma-channel Chooses which DMA channel will be used to perform the intermediate
trace files transfers to the PPE side.
See EXTRAE SPU FILE SIZE, EXTRAE SPU BUFFER SIZE and EX-
TRAE SPU DMA CHANNEL environment variables in appendix B.
20
Callers are the routine addresses present in the process stack at any given moment during the
application run. Callers can be used to link the tracefile with the source code of the application.
The instrumentation library can collect a partial view of those addresses during the instru-
mentation. Such collected addresses are translated by the merging process if the correspondent
parameter is given and the application has been compiled and linked with debug information.
There are three points where the instrumentation can gather this information:
The user can choose which addresses to save in the trace (starting from 1, which is the closest
point to the MPI call or sampling point) specifying several stack levels by separating them by
commas or using the hyphen symbol.
See EXTRAE MPI CALLER and EXTRAE PACX CALLER environment variables
in appendix B.
There are two different mechanisms to instrument user functions. One is using DynInst support,
the other relies on compiling and linking the application using additional options.
• If you use DynInst support in the instrumentation package, then the pointed list in the list
attribute within the tag is just a name list of the functions to be traced.
• If you use the IBM XL compilers, specify the option -qfunctrace+function1 at compile and
link stages. The list attribute, as in DynInst, points to a name list of functions to be traced.
• If you use the GNU C compiler with the option -finstrument-functions at compile and
link stages, the list attribute must point a file with a list of entries like:
address # function name
You can generate this list by using the nm command applied to the binary. For example,
nm | grep FUNCTION will show you the function name, followed by the type of FUNCTION
(should be T or t) and then followed by the address of the symbol.
The exclude-automatic-functions attribute is used only by the DynInst instrumenter. By
setting this attribute to yes the instrumenter will avoid automatically instrumenting the
routines that either call OpenMP outlined routines (i.e. routines with OpenMP pragmas) or
call CUDA kernels.
1
In earlier versions of the compiler the flag was: -qdebug=function trace
21
Finally, in order to gather performance counters in these functions and also in those instru-
mented using the extrae user function API call, the node counters has to be enabled.
See EXTRAE FUNCTIONS environment variable in appendix B.
<counters enabled="yes">
<cpu enabled="yes" starting-set-distribution="1">
<set enabled="yes" domain="all" changeat-time="5s">
PAPI_TOT_INS,PAPI_TOT_CYC,PAPI_L1_DCM
<sampling enabled="yes" period="100000000">PAPI_TOT_CYC</sampling>
</set>
<set enabled="yes" domain="user" changeat-globalops="5">
PAPI_TOT_INS,PAPI_TOT_CYC,PAPI_FP_INS
</set>
</cpu>
<network enabled="yes" />
<resource-usage enabled="yes" />
</counters>
• number (in range 1..N, where N is the number of configured sets) All tasks will start using
the set specified by number.
2
More information available on their website http://icl.cs.utk.edu/papi. Extrae requires PAPI 3.x at least.
3
PMAPI is only available for AIX operating system, and it is on the base operating system since AIX5.3. Extrae
requires AIX 5.3 at least.
22
• block Each task will start using the given sets distributed in blocks (i.e., if two sets are
defined and there are four running tasks: tasks 1 and 2 will use set 1, and tasks 3 and 4 will
use set 2).
• cyclic Each task will start using the given sets distributed cyclically (i.e., if two sets are
defined and there are four running tasks: tasks 1 and 3 will use, and tasks 2 and 4 will use
set 2).
• random Each task will start using a random set, and also calls either to Extrae next hwc set
or Extrae previous hwc set will change to a random set.
Each set contain a list of performance counters to be gathered at different instrumentation points
(see sections 4.2, 4.5 and 4.8). If the tracing library is compiled to support PAPI, performance
counters must be given using the canonical name (like PAPI TOT CYC and PAPI L1 DCM), or
the PAPI code in hexadecimal format (like 8000003b and 80000000, respectively)4 . If the tracing
library is compiled to support PMAPI, only one group identifier can be given per set5 and can
be either the group name (like pm basic and pm hpmcount1) or the group number (like 6 and 22,
respectively).
In the given example (which refers to PAPI support in the tracing library) two sets are de-
fined. First set will read PAPI TOT INS (total instructions), PAPI TOT CYC (total cycles) and
PAPI L1 DCM (1st level cache misses). Second set is configured to obtain PAPI TOT INS (total
instructions), PAPI TOT CYC (total cycles) and PAPI FP INS (floating point instructions).
Additionally, if the underlying performance library supports sampling mechanisms, each set
can be configured to gather information (see section 4.7) each time the specified counter reaches
a specific value. The counter that is used for sampling must be present in the set. In the given
example, the first set is enabled to gather sampling information every 100M cycles.
Furthermore, performance counters can be configured to report accounting on different basis
depending on the domain attribute specified on each set. Available options are
• kernel Only counts events ocurred when the application is running in kernel mode.
• user Only counts events ocurred when the application is running in user-space mode.
In the given example, first set is configured to count all the events ocurred, while the second
one only counts those events ocurred when the application is running in user-space mode.
Finally, the instrumentation can change the active set in a manual and an automatic fashion. To
change the active set manually see Extrae previous hwc set and Extrae next hwc set API calls
in 5.1. To change automatically the active set two options are allowed: based on time and based on
application code. The former mechanism requires adding the attribute changeat-time and specify
the minimum time to hold the set. The latter requires adding the attribute changeat-globalops
with a value. The tracing library will automatically change the active set when the application has
executed as many MPI global operations as selected in that attribute. When In any case, if either
attribute is set to zero, then the set will not me changed automatically.
4
Some architectures do not allow grouping some performance counters in the same set.
5
Each group contains several performance counters
23
4.9.2 Network performance counters
Network performance counters are only available on systems with Myrinet GM/MX networks and
they are fixed depending on the firmware used. Other systems, like BG/* may provide some network
performance counters, but they are accessed through the PAPI interface (see section 4.9 and PAPI
documentation).
If <network> is enabled the network performance counters appear at the end of the application
run, giving a summary for the whole run.
<storage enabled="no">
<trace-prefix enabled="yes">TRACE</trace-prefix>
<size enabled="no">5</size>
<temporal-directory enabled="yes">/scratch</temporal-directory>
<final-directory enabled="yes">/gpfs/scratch/bsc41/bsc41273</final-directory>
<gather-mpits enabled="no" />
</storage>
• trace-prefix Sets the intermediate trace file prefix. Its default value is TRACE.
• size Let the user restrict the maximum size (in megabytes) of each resulting intermediate
trace file6 .
• temporal-directory Where the intermediate trace files will be stored during the execution
of the application. By default they are stored in the current directory. If the directory does
not exist, the instrumentation will try to make it.
• final-directory Where the intermediate trace files will be stored once the execution has
been finished. By default they are stored in the current directory. If the directory does not
exist, the instrumentation will try to make it.
6
This check is done each time the buffer is flushed, so the resulting size of the intermediate trace file depends also
on the number of elements contained in the tracing buffer (see section 4.11).
24
• gather-mpits If the system does not provide a global filesystem the resulting trace files will
be distributed among the computation nodes. Turning on this option will use the underlying
communication mechanism (MPI) to gather all the intermediate trace files into the root node.
See EXTRAE PROGRAM NAME, EXTRAE FILE SIZE, EXTRAE DIR, EX-
TRAE FINAL DIR and EXTRAE GATHER MPITS environment variables in ap-
pendix B.
<buffer enabled="yes">
<size enabled="yes">150000</size>
<circular enabled="no" />
</buffer>
By, default (even if the enabled attribute is ”no”) the tracing buffer is set to 500k events (see
section 4.6 for further information of buffer in the CELL). If <size> is enabled the tracing buffer
will be set to the number of events indicated by this node. If the circular option is enabled, the
buffer will be created as a circular buffer and the buffer will be dumped only once with the last
events generated by the tracing package.
See EXTRAE BUFFER SIZE environment variable in appendix B.
This section groups together a set of options to limit/reduce the final trace size. There are
three mechanisms which are based on file existance, global operations executed and external remote
control procedures.
Regarding the file, the application starts with the tracing disabled, and it is turned on when
a control file is created. Use the property frequency to choose at which frequency this check must
be done. If not supplied, it will be checked every 100 global operations on MPI COMM WORLD.
25
If the global-ops tag is enabled, the instrumentation package begins disabled and starts the
tracing when the given number of global operations on MPI COMM WORLD has been executed.
The remote-control tag section allows to configure some external mechanisms to automatically
control the tracing. Currently, there is only one option which is built on top of MRNet and it is
based on clustering and spectral analysis to generate a small yet representative trace.
These are the options in the mrnet tag:
• target: the approximate requested size for the final trace (in Mb).
• min seen: minimum times a given type of period has to be seen to trace a sample
• num iters: number of iterations to trace for every representative period found.
• signals: performance signals used to analyze the application. If not specified, DurBurst is
used by default.
A signal can be used to terminate the tracing when using the remote control. Available values
can be only USR1/USR2 Some MPI implementations handle one of those, so check first which is
available to you. Set in tag signal the signal code you want to use.
See EXTRAE CONTROL FILE, EXTRAE CONTROL GLOPS, EX-
TRAE CONTROL TIME environment variables in appendix B.
If the user enables this option, the instrumentation library will just emit information of com-
putation bursts (i.e., not does not trace MPI calls, OpenMP runtime, and so on) when the current
mode (through initial-mode in 4.1) is set to bursts. The library will discard all those computation
bursts that last less than the selected threshold.
26
In addition to that, when the tracing library is running in burst mode, it computes some
statistics of MPI and PACX activity. Such statistics can be dumped in the tracefile by enabling
mpi-statistics and pacx-statistics respectively.
See EXTRAE INITIAL MODE, EXTRAE BURST THRESHOLD, EX-
TRAE MPI STATISTICS and EXTRAE PACX STATISTICS environment variables
in appendix B.
This section contains other configuration details that do not fit in the previous sections. Right
now, there is only one option available and it is devoted to tell the instrumentation package the
minimum instrumentation time. To enable it, set enabled to ”yes” and set the minimum time
within the minimum-time tag.
This sections configures the time-based sampling capabilities. Every sample contains processor
performance counters (if enabled in section 4.9.1 and either PAPI or PMAPI are referred at con-
figure time) and callstack information (if enabled in section 4.7 and proper dependencies are set at
configure time).
This section contains two attributes besides enabled. These are
• type: determines which timer domain is used (see man 2 setitimer or man 3p setitimer
for further information on time domains). Available options are: real (which is also the
default value, virtual and prof (which use the SIGALRM, SIGVTALRM and SIGPROF
respectively). The defaul timing accumulates real time, but only issues samples at master
thread. To let all the threads to collect samples, the type must be virtual or prof.
• period: specifies the sampling periodicity. In the example above, samples are gathered every
50ms.
• variability: specifies the variability to the sampling periodicity. Such variability is calculated
through the random() system call and then is added to the periodicity. In the given example,
the variability is set to 10ms, thus the final sampling period ranges from 45 to 55ms.
27
4.16 XML Section: CUDA
<cuda enabled="yes" />
This section indicates whether the CUDA calls should be instrumented or not. If enabled is
set to yes, CUDA calls will be instrumented, otherwise they will not be instrumented.
This section indicates whether the OpenCL calls should be instrumented or not. If enabled is
set to yes, Opencl calls will be instrumented, otherwise they will not be instrumented.
If this section is enabled and the instrumentation packaged is configured to support this, the
merge process will be automatically invoked after the application run. The merge process will use
all the resources devoted to run the application.
The leaf of this node will be used as the tracefile name (mpi ping.prv in this example). Current
available options for the merge process are given as attribute of the <merge> node and they are:
• synchronization: which can be set to default, node, task, no. This determines how task
clocks will be synchronized (default is node).
• binary: points to the binary that is being executed. It will be used to translate gathered
addresses (MPI callers, sampling points and user functions) into source code references.
• tree-fan-out: only for MPI executions sets the tree-based topology to run the merger in a
parallel fashion.
• max-memory: limits the intermediate merging process to run up to the specified limit (in
MBytes).
28
• joint-states: which can be set to yes, no. Determines if the resulting Paraver tracefile will
split or join equal consecutive states (default is yes).
• keep-mpits: whether to keep the intermediate tracefiles after performing the merge (currently
unimplemented).
• sort-addresses: whether to sort all addresses that refer to the source code (enabled by
default).
• overwrite: set to yes if the new tracefile can overwrite an existing tracefile with the same
name. If set to no, then the tracefile will be given a new name using a consecutive id.
29
30
Chapter 5
Extrae API
There are two levels of the API in the Extrae instrumentation package. Basic API refers to the basic
functionality provided and includes emitting events, source code tracking, changing instrumentation
mode and so. Extended API is an experimental addition to provide several of the basic API within
single and powerful calls using specific data structures.
• void Extrae get version (unsigned *major, unsigned *minor, unsigned *revision)
Returns the version of the underlying Extrae package. Although an application may be com-
piled to a specific Extrae library, by using the appropriate shared library commands, the
application may use a different Extrae library.
– Call to MPI Init when the appropriate instrumentation library is linked or preload with
the application.
– Usage of the DynInst launcher.
– If either the libseqtrace.so, libomptrace.so or libpttrace.so are linked dynami-
cally or preloaded with the application.
No major problems should occur if the library is initialized twice, only a warning appears in
the terminal output noticing the intent of double initialization.
31
• extrae init type t Extrae is initialized (void)
This routine tells whether the instrumentation has been initialized, and if so, also which
mechanism was the first to initialize it (regular API, MPI or PACX initialization).
– Identify loop iterations (or any code block): Given a loop, the user can set a unique type
for the loop and a value related to the iterator value of the loop. For example:
for (i = 1; i <= MAX_ITERS; i++)
{
Extrae_event (1000, i);
[original loop code]
}
Extrae_event (1000, 0);
The last added call to Extrae event marks the end of the loop setting the event value to
0, which facilitates the analysis with Paraver.
– Identify user routines: Choosing a constant type (6000019 in this example) and different
values for different routines (set to 0 to mark a ”leave” event)
void routine1 (void)
{
Extrae_event (6000019, 1);
[routine 1 code]
Extrae_event (6000019, 0);
}
– Identify any point in the application using a unique combination of type and value.
• void Extrae nevent (unsigned count, extrae type t *types, extrae value t *values)
Allows the user to place count events with the same timestamp at the given position.
32
• void Extrae counters (void)
Emits the value of the active hardware counters set. See chapter 4 for further information.
• void Extrae neventandcounters (unsigned count, extrae type t *types, extrae value t
*values)
This routine lets the user add several events and obtain the performance counters with one
call and a single timestamp.
• void Extrae define event type (extrae type t *type, char *description, unsigned
*nvalues, extrae value t *values, char **description values)
This routine adds to the Paraver Configuration File human readable information regarding
type type and its values values. If no values needs to be decribed set nvalues to 0 and also
set values and description values to NULL.
33
– EXTRAE OMP OPTION
Activates tracing of OpenMP runtime or outlined routines.
– EXTRAE OMP HWC OPTION
Activates hardware counter gathering in OpenMP runtime or outlined routines.
– EXTRAE UF HWC OPTION
Activates hardware counter gathering in the user functions.
In order to gather performance counters during the execution of these calls, the user-functions
tag in the XML configuration and its counters have to be both enabled.
34
equivalent event has found. The latter is used to generate events containing multiple kinds of
information at the same time.
struct extrae_UserCommunication
{
extrae_user_communication_types_t type;
extrae_comm_tag_t tag;
unsigned size; /* size_t? */
extrae_comm_partner_t partner;
extrae_comm_id_t id;
};
• type
Available options are:
• tag
The tag information in the communication record.
• size
The size information in the communication record.
• partner
The partner of this communication (receive if this is a send or send if this is a receive).
Partners (ranging from 0 to N-1) are considered across tasks whereas all threads share a
single communication queue.
• id
An identifier that is used to match communications between partners.
struct extrae_CombinedEvents
{
/* These are used as boolean values */
int HardwareCounters;
int Callers;
int UserFunction;
/* These are intended for N events */
unsigned nEvents;
extrae_type_t *Types;
extrae_value_t *Values;
/* These are intended for user communication records */
unsigned nCommunications;
extrae_user_communication_t *Communications;
};
35
The structure extrae CombinedEvents contains the following fields:
• HardwareCounters
Set to non-zero if this event has to gather hardware performance counters.
• Callers
Set to non-zero if this event has to emit callstack information.
• UserFunction
Available options are:
– EXTRAE USER FUNCTION NONE, if this event should not provide information about user
routines.
– EXTRAE USER FUNCTION ENTER, if this event represents the starting point of a user rou-
tine.
– EXTRAE USER FUNCTION LEAVE, if this event represents the ending point of a user routine.
• nEvents
Set the number of events given in the Types and Values fields.
• Types
A pointer containing nEvents type that will be stored in the trace.
• Values
A pointer containing nEvents values that will be stored in the trace.
• nCommunications
Set the number of communications given in the Communications field.
• Communications
A pointer to extrae UserCommunication structures containing nCommunications elements
that represent the involved communications.
The extended API contains the following routines:
• void Extrae init UserCommunication (struct extrae UserCommunication *)
Use this routine to initialize an extrae UserCommunication structure.
36
• void Extrae register codelocation type (extrae type t t1, extrae type t t2, const
char* s1, const char *s2)
Registers type t2 to reference user source code location by using its address. During the
merge phase the mpi2prv command will assign type t1 to the event type that references the
user function and to the event t2 to the event that references the file name and line location.
The strings s1 and s2 refers, respectively, to the description of t1 and t2
• void Extrae register function address (void *ptr, const char *funcname, const char
*modname, unsigned line);
By default, the mpi2prv process uses the binary debugging information to translate program
addresses into information that contains function name, the module name and line. The Ex-
trae register function address allows providing such information by hand during the execution
of the instrumented application. This function must provide the function name (funcname),
module name (modname) and line number for a given address.
37
• int CELLtrace init (int spus, spe context ptr t * spe ids)
Contacts with the SPE thread to initialize once the SPE tracing environment. Such call has
to be synchronized with the invocation of SPUtrace init (see 5.3.2) call on the SPE side
due to the presence of message passing using the mailboxes. The routine receives the total
number of contexts created by the Cell SDK spe context create and a vector pointing to
those contexts. Each of those contexts will reference to a single SPE thread created by a call
to pthread create.
38
Chapter 6
Merging process
Once the application has finished, and if the automatic merge process is not setup, the merge must
be executed manually. Here we detail how to run the merge process manually.
The inserted probes in the instrumented binary are responsible for gathering performance met-
rics of each task/thread and for each of them several files are created where the XML configuration
file specified (see section 4.10). Such files are:
• As many .mpit files as tasks and threads where running the target application. Each file
contains information gathered by the specified task/thread in raw binary format.
• A single .mpits file that contain a list of related .mpit files.
• If the DynInst based instrumentation package was used, an addition .sym file that contains
some symbolic information gathered by the DynInst library.
In order to use Paraver, those intermediate files (i.e., .mpit files) must be merged and translated
into Paraver trace file format. The same applies if the user wants to use the Dimemas simulator.
To proceed with any of these translation all the intermediate trace files must be merged into a
single trace file using one of the available mergers in the bin directory (see table 6.1).
The target trace type is defined in the XML configuration file used at the instrumentation step
(see section 4.1), and it has match with the merger used (mpi2prv and mpimpi2prv for Paraver and
mpi2dim and mpimpi2dim for Dimemas). However, it is possible to force the format nevertheless
the selection done in the XML file using the parameters -paraver or -dimemas1 .
Binary Description
mpi2prv Sequential version of the Paraver merger.
mpi2dim Sequential version of the Dimemas merger.
mpimpi2prv Parallel version of the Paraver merger.
mpimpi2dim Parallel version of the Dimemas merger.
1
The timing mechanism differ in Paraver/Dimemas at the instrumentation level. If the output trace format does
not correspond with that selected in the XML some timing inaccuracies may be present in the final tracefile. Such
inaccuracies are known to be higher due to clock granularity if the XML is set to obtain Dimemas tracefiles but the
resulting tracefile is forced to be in Paraver format.
39
6.1 Paraver merger
As stated before, there are two Paraver mergers: mpi2prv and mpimpi2prv. The former is for use
in a single processor mode while the latter is meant to be used with multiple processors using MPI
(and cannot be run using one MPI task).
Paraver merger receives a set of intermediate trace files and generates three files with the same
name (which is set with the -o option) but differ in the extension. The Paraver trace itself (.prv file)
that contains timestamped records that represent the information gathered during the execution
of the instrumented application. It also generates the Paraver Configuration File (.pcf file), which
is responsible for translating values contained in the Paraver trace into a more human readable
values. Finally, it also generates a file containing the distribution of the application across the
cluster computation resources (.row file).
The following sections describe the available options for the Paraver mergers. Typically, options
available for single processor mode are also available in the parallel version, unless specified.
• -d or -dump
Dumps the information stored in the intermediate trace files.
• -dump-without-time
The information dumped with -d (or -dump) does not show the timestamp.
• -e BINARY
Uses the given BINARY to translate addresses that are stored in the intermediate trace files
into useful information (including function name, source file and line). The application has
to be compiled with -g flag so as to obtain valuable information.
NOTE: Since Extrae version 2.4.0 this flag is superseded in Linux systems where /proc/self/maps
is readable. The instrumentation part will annotate the binaries and shared libraries in use
and will try to use them before using BINARY. This flag is still available in Linux systems
as a default case just in case the binaries and libraries pointed by /proc/self/maps are not
available.
• -emit-library-events
Emit additional events for the source code references that belong to a separate shared library
that cannot be translated. Only add information with respect to the shared library name.
This option is disabled by default.
• -evtnum N
Partially processes (up to N events) the intermediate trace files to generate the Dimemas
tracefile.
• -f FILE.mpits (where FILE.mpits file is generated by the instrumentation)
The merger uses the given file (which contains a list of intermediate trace files of a single
executions) instead of giving set of intermediate trace files.
This option looks first for each file listed in the parameter file. Each contained file is searched
in the absolute given path, if it does not exist, then it’s searched in the current directory.
40
• -f-relative FILE.mpits (where FILE.mpits file is generated by the instrumentation)
This options behaves like the -f options but looks for the intermediate files in the current
directory.
• -h
Provides minimal help about merger options.
• -maxmem M
The last step of the merging process will be limited to use M megabytes of memory. By
default, M is 512.
• -no-syn
If set, the merger will not attempt to synchronize the different tasks. This is useful when
merging intermediate files obtained from a single node (and thus, share a single clock).
• -o FILE.prv
Choose the name of the target Paraver tracefile.
• -o FILE.prv.gz
Choose the name of the target Paraver tracefile compressed using the libz library.
• -remove-files
The merging process removes the intermediate tracefiles when succesfully generating the
Paraver tracefile.
• -skip-sendrecv
Do not match point to point communications issued by MPI Sendrecv or MPI Sendrecv replace.
• -sort-addresses
Sort event values that reference source code locations so as the values are sorted by file name
first and then line number (enabled by default).
• -split-states
Do not join consecutive states that are the same into a single one.
• -syn
If different nodes are used in the execution of a tracing run, there can exist some clock
differences on all the nodes. This option makes mpi2prv to recalculate all the timings based
41
on the end of the MPI Init call. This will usually lead to ”synchronized” tasks, but it will
depend on how the clocks advance in time.
• -syn-node
If different nodes are used in the execution of a tracing run, there can exist some clock
differences on all the nodes. This option makes mpi2prv to recalculate all the timings based
on the end of the MPI Init call and the node where they ran. This will usually lead to better
synchronized tasks than using -syn, but, again, it will depend on how the clocks advance in
time.
• -unique-caller-id
Choose whether use a unique value identifier for different callers locations (MPI calling rou-
tines, user routines, OpenMP outlined routines andpthread routines).
• -block
Intermediate trace files will be distributed in a block fashion instead of a cyclic fashion to the
merger.
• -cyclic
Intermediate trace files will be distributed in a cyclic fashion instead of a block fashion to the
merger.
• -size
The intermediate trace files will be sorted by size and then assigned to processors in a such
manner that each processor receives approximately the same size.
• -consecutive-size
Intermediate trace files will be distributed consecutively to processors but trying to distribute
the overall size equally among processors.
• -use-disk-for-comms
Use this option if your memory resources are limited. This option uses an alternative matching
communication algorithm that saves memory but uses intensively the disk.
42
• -tree-fan-out N
Use this option to instruct the merger to generate the tracefile using a tree-based topology.
This should improve the performance when using a large number of processes at the merge
step. Depending on the combination of processes and the width of the tree, the merger will
need to run several stages to generate the final tracefile.
The number of processes used in the merge process must be equal or greater than the N
parameter. If it is not, the merger itself will automatically set the width of the tree to the
number of processes used.
• -evtnum N
Partially processes (up to N events) the intermediate trace files to generate the Dimemas
tracefile.
• -h
Provides minimal help about merger options.
• -maxmem M
The last step of the merging process will be limited to use M megabytes of memory. By
default, M is 512.
• -o FILE.dim
Choose the name of the target Dimemas tracefile.
43
6.3.1 Environment variables suitable to Paraver merger
EXTRAE LABELS
This environment variable lets the user add custom information to the generated Paraver Configu-
ration File (.pcf). Just set this variable to point to a file containing labels for the unknown (user)
events.
The format for the file is:
EVENT_TYPE
0 [type1] [label1]
0 [type2] [label2]
...
0 [typeK] [labelK]
Where [typeN] is the event value and [labelN] is the description for the event with value
[typeN]. It is also possible to link both type and value of an event:
EVENT_TYPE
0 [type] [label]
VALUES
[value1] [label1]
[value2] [label2]
...
[valueN] [labelN]
With this information, Paraver can deal with both type and value when giving textual infor-
mation to the end user. If Paraver does not find any information for an event/type it will shown it
in numerical form.
44
Chapter 7
Examples
We present here three different examples of generating a Paraver tracefile. First example re-
quires the package to be compiled with DynInst libraries. Second example uses the LD PRELOAD or
LDR PRELOAD[64] mechanism to interpose code in the application. Such mechanism is available in
Linux and FreeBSD operating systems and only works when the application uses dynamic libraries.
Finally, there is an example using the static library of the instrumentation package.
3 export EXTRAE_HOME=WRITE-HERE-THE-PACKAGE-LOCATION
4 export LD_LIBRARY_PATH=${EXTRAE_HOME}/lib
5 source ${EXTRAE_HOME}/etc/extrae.sh
6
A similar script can be found in the share/example/SEQ directory in your tracing package
directory. Just tune the EXTRAE HOME environment variable and make the script executable (using
chmod u+x). You can either pass the XML configuration file through the EXTRAE CONFIG FILE if
you prefer instead. Line no. 5 is responsible for loading all the environment variables needed for
the DynInst launcher (called extrae) that is invoked in line 8.
In fact, there are two examples provided in share/example/SEQ, one for static (or manual)
instrumentation and another for the DynInst-based instrumentation. When using the DynInst
1
The IA-64 architecture support was dropped by DynInst 7.0
45
instrumentation, the user may add new routines to instrument using the existing function-list
file that is already pointed by the extrae.xml configuration file. The way to specify the routines
to instrument is add as many lines with the name of every routine to be instrumented.
Running OpenMP applications using DynInst is rather similar to serial codes. Just compile the
application with the appropiate OpenMP flags and run as before. You can find an example in the
share/example/OMP directory.
The most important thing in the previous script is the line number 11, which is responsible for
spawning the MPI tasks (using the srun command). The spawn method is told to execute ./run.sh
./mpi ping which in fact refers to instrument the mpi ping binary using the run.sh script. You
must adapt this file to your queue-system (if any) and to your MPI submission mechanism (i.e.,
change srun to mpirun, mpiexec, poe, etc...). Note that changing the line 11 to read like ./run.sh
srun ./mpi ping would result in instrumenting the srun application not mpi ping.
run.sh
1 #!/bin/bash
2
3 export EXTRAE_HOME=@sub_PREFIXDIR@
4 source ${EXTRAE_HOME}/etc/extrae.sh
5
6 # Only show output for task 0, others task send output to /dev/null
7 if test "${SLURM_PROCID}" == "0" ; then
8 ${EXTRAE_HOME}/bin/extrae -config ../extrae.xml $@ > job.out 2> job.err
9 else
10 ${EXTRAE_HOME}/bin/extrae -config ../extrae.xml $@ > /dev/null 2> /dev/null
11 fi
46
This is the script responsible for instrumenting a single MPI task. In line number 4 we set-up the
instrumentation environment by executing the commands from extrae.sh. Then we execute the
binary passed to the run.sh script in lines 8 and 10. Both lines are executing the same command
except that line 8 sends all the output to two different files (one for standard output and another
for standard error) and line 10 sends all the output to /dev/null.
Please note, this script is particularly adapted to the MOAB/Slurm queue systems. You may
need to adapt the script to other systems by using the appropiate environment variables. Partic-
ularly, SLURM PROCID identifies the MPI task id (i.e., the task rank) and may be changed to the
proper environemnt variable (PMI RANK in ParaStation/Torque/MOAB system or MXMPI ID
in systems having Myrinet MX devices, for example).
7.2.1 Linux
The following script preloads the libmpitrace library to instrument MPI calls of the application
passed as an argument (tune EXTRAE HOME according to your installation).
trace.sh
1 #!/bin/sh
2
3 export EXTRAE_HOME=WRITE-HERE-THE-PACKAGE-LOCATION
4 export EXTRAE_CONFIG_FILE=extrae.xml
5 export LD_PRELOAD=${EXTRAE_HOME}/lib/libmpitrace.so
6
The previous script can be found in the share/example/MPI/ld-preload directory in your tracing
package directory. Copy the script to one of your directories, tune the EXTRAE HOME environment
variable and make the script executable (using chmod u+x). Also copy the XML configuration
extrae.xml file from the share/example/MPI directory instrumentation package to the current di-
rectory. This file is used to configure the whole behavior of the instrumentation package (there is
more information about the XML file on chapter 4). The last line in the script, $∗, executes the
arguments given to the script, so as you can run the instrumentation by simply adding the script
in between your execution command.
2
Look at http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html for further information.
47
Regarding the execution, if you run MPI applications from the command-line, you can issue
the typical mpirun command as:
${MPI HOME}/bin/mpirun -np N ./trace.sh mpi-app
where, ${MPI HOME} is the directory for your MPI installation, N is the number of MPI tasks
you want to run and mpi-app is the binary of the MPI application you want to run.
However, if you execute your MPI applications through a queue system you may need to write
a submission script. The following script is an example of a submission script for MOAB/Slurm
queuing system using the aforementioned trace.sh script for an execution of the mpi-app on two
processors.
slurm-trace.sh
1 #! /bin/bash
2 #@ job_name = trace_run
3 #@ output = trace_run%j.out
4 #@ error = trace_run%j.out
5 #@ initialdir = .
6 #@ class = bsc_cs
7 #@ total_tasks = 2
8 #@ wall_clock_limit = 00:30:00
9
If your system uses LoadLeveler your job script may look like:
ll.sh
1 #! /bin/bash
2 #@ job_type = parallel
3 #@ output = trace_run.ouput
4 #@ error = trace_run.error
5 #@ blocking = unlimited
6 #@ total_tasks = 2
7 #@ class = debug
8 #@ wall_clock_limit = 00:10:00
9 #@ restart = no
10 #@ group = bsc41
11 #@ queue
12
19 rm ${MLIST}
Besides the job specification given in lines 1-11, there are commands of particular interest.
Lines 13-15 are used to know which and how many nodes are involved in the computation. Such
48
information information is given to the mpirun command to proceed with the execution. Once the
execution finished, the temporal file created on line 14 is removed on line 19.
7.2.2 CUDA
There are two ways to instrument CUDA applications, depending on how the package was config-
ured. If the package was configure with --enable-cuda only interposition on binaries using shared
libraries are available. If the package was configured with --with-cupti any kind of binary can be
instrumented because the instrumentation relies on the CUPTI library to instrument CUDA calls.
The example shown below is intended for the former case.
run.sh
1 #!/bin/bash
2
3 export EXTRAE_HOME=/home/harald/extrae
4 export PAPI_HOME=/home/harald/aplic/papi/4.1.4
5
6 EXTRAE_CONFIG_FILE=extrae.xml LD_LIBRARY_PATH=${EXTRAE_HOME}/lib:${PAPI_HOME}/lib:${LD_LIBRARY
7 ${EXTRAE_HOME}/bin/mpi2prv -f TRACE.mpits -e ./hello
In this example, the hello application is compiled using the nvcc compiler and linked against
the -lcudatrace library. The binary contains calls to Extrae init and Extrae fini and then
executes a CUDA kernel. Line number 6 refers to the execution of the application itself. The
Extrae configuration file and the location of the shared libraries are set in this line. Line number 7
invokes the merge process to generate the final tracefile.
7.2.3 AIX
AIX typically ships with POE and LoadLeveler as MPI implementation and queue system respec-
tively. An example for a system with these software packages is given below. Please, note that the
example is intended for 64 bit applications, if using 32 bit applications then LDR PRELOAD64 needs
to be changed in favour of LDR PRELOAD.
ll-aix64.sh
1 #@ job_name = basic_test
2 #@ output = basic_stdout
3 #@ error = basic_stderr
4 #@ shell = /bin/bash
5 #@ job_type = parallel
6 #@ total_tasks = 8
7 #@ wall_clock_limit = 00:15:00
8 #@ queue
9
10 export EXTRAE_HOME=WRITE-HERE-THE-PACKAGE-LOCATION
11 export EXTRAE_CONFIG_FILE=extrae.xml
12 export LDR_PRELOAD64=${EXTRAE_HOME}/lib/libmpitrace.so
13
14 ./mpi-app
49
Lines 1-8 contain a basic LoadLeveler job definition. Line 10 sets the Extrae package directory
in EXTRAE HOME environment variable. Follows setting the XML configuration file that will
be used to set up the tracing. Then follows setting LDR PRELOAD64 which is responsible for in-
strumentation using the shared library libmpitrace.so. Finally, line 14 executes the application
binary.
7 F77 = $(MPI_HOME)/bin/mpif77
8 FFLAGS = -O2
9 FLIBS = $(EXTRAE_HOME)/lib/libmpitracef.a \
10 -L$(PAPI_HOME)/lib -lpapi -lperfctr \
11 $(XML2_LDFLAGS) $(XML2_LIBS)
12
13 all: mpi_ping
14
15 mpi_ping: mpi_ping.f
16 $(F77) $(FFLAGS) mpi_ping.f $(FLIBS) -o mpi_ping
17
18 clean:
19 rm -f mpi_ping *.o pingtmp? TRACE.*
Lines 2-5 are definitions of some Makefile variables to set up the location of different packages
needed by the instrumentation. In particular, EXTRAE HOME sets where the Extrae package directory
is located. In order to link your application with Extrae you have to add its libraries in the link
stage (see lines 9-11 and 16). Besides libmpitracef.a we also add some PAPI libraries (-lpapi,
and its dependency (which you may or not need -lperfctr), the libxml2 parsing library (-lxml2),
and finally, the bfd and liberty libraries (-lbfd and -liberty), if the instrumentation package was
compiled to support merge after trace (see chapter 3 for further information).
50
7.3.2 Generating the intermediate files
Executing an application with the statically linked version of the instrumentation package is
very similar as the method shown in Section 7.2. There is, however, a difference: do not set
LD PRELOAD in trace.sh.
trace.sh
1 #!/bin/sh
2
3 export EXTRAE_HOME=WRITE-HERE-THE-PACKAGE-LOCATION
4 export EXTRAE_CONFIG_FILE=extrae.xml
5 export LD_LIBRARY_PATH=${EXTRAE_HOME}/lib:\
6 /gpfs/apps/MPICH2/mx/1.0.7..2/64/lib:\
7 /gpfs/apps/PAPI/3.6.2-970mp-patched/64/lib
8
See section 7.2 to know how to run this script either through command line or queue systems.
This command will convert the intermediate files generated in the previous step into a single
Paraver tracefile. The TRACE.mpits is a file generated automatically by the instrumentation and
contains a reference to all the intermediate files generated during the execution run. The -e
parameter receives the application binary mpi-app in order to perform translations from addresses
to source code. To use this feature, the binary must have been compiled with debugging information.
Finally, the -o flag tells the merger how the Paraver tracefile will be named (trace.prv in this case).
51
52
Appendix A
<?xml version=’1.0’?>
<trace enabled="yes"
home="@sed_MYPREFIXDIR@"
initial-mode="detail"
type="paraver"
xml-parser-id="@sed_XMLID@"
>
<mpi enabled="yes">
<counters enabled="yes" />
</mpi>
<pacx enabled="no">
<counters enabled="yes" />
</pacx>
<pthread enabled="yes">
<locks enabled="no" />
<counters enabled="yes" />
</pthread>
<openmp enabled="yes">
<locks enabled="no" />
<counters enabled="yes" />
</openmp>
<callers enabled="yes">
<mpi enabled="yes">1-3</mpi>
<pacx enabled="no">1-3</pacx>
<sampling enabled="no">1-5</sampling>
53
</callers>
<user-functions enabled="no"
list="/home/bsc41/bsc41273/user-functions.dat"
exclude-automatic-functions="no">
<counters enabled="yes" />
</user-functions>
<counters enabled="yes">
<cpu enabled="yes" starting-set-distribution="1">
<set enabled="yes" domain="all" changeat-globalops="5">
PAPI_TOT_INS,PAPI_TOT_CYC,PAPI_L1_DCM
<sampling enabled="no" period="100000000">PAPI_TOT_CYC</sampling>
</set>
<set enabled="yes" domain="user" changeat-globalops="5">
PAPI_TOT_INS,PAPI_FP_INS,PAPI_TOT_CYC
</set>
</cpu>
<network enabled="yes" />
<resource-usage enabled="yes" />
</counters>
<storage enabled="no">
<trace-prefix enabled="yes">TRACE</trace-prefix>
<size enabled="no">5</size>
<temporal-directory enabled="yes">/scratch</temporal-directory>
<final-directory enabled="yes">/gpfs/scratch/bsc41/bsc41273</final-directory>
<gather-mpits enabled="no" />
</storage>
<buffer enabled="yes">
<size enabled="yes">150000</size>
<circular enabled="no" />
</buffer>
<trace-control enabled="yes">
<file enabled="no" frequency="5M">/gpfs/scratch/bsc41/bsc41273/control</file>
<global-ops enabled="no">10</global-ops>
<remote-control enabled="yes">
<mrnet enabled="yes" target="150" analysis="spectral" start-after="30">
<clustering max_tasks="26" max_points="8000"/>
<spectral min_seen="1" max_periods="0" num_iters="3" signals="DurBurst,InMPI"/>
</mrnet>
<signal enabled="no" which="USR1"/>
</remote-control>
54
</trace-control>
<others enabled="yes">
<minimum-time enabled="no">10m</minimum-time>
</others>
<bursts enabled="no">
<threshold enabled="yes">500u</threshold>
<mpi-statistics enabled="yes" />
<pacx-statistics enabled="no" />
</bursts>
<cell enabled="no">
<spu-file-size enabled="yes">5</spu-file-size>
<spu-buffer-size enabled="yes">64</spu-buffer-size>
<spu-dma-channel enabled="yes">2</spu-dma-channel>
</cell>
<merge enabled="yes"
synchronization="default"
binary="mpi_ping"
tree-fan-out="16"
max-memory="512"
joint-states="yes"
keep-mpits="yes"
sort-addresses="yes"
overwrite="yes"
>
mpi_ping.prv
</merge>
</trace>
55
56
Appendix B
Environment variables
Although Extrae is configured through an XML file (which is pointed by the EXTRAE CONFIG FILE),
it also supports minimal configuration to be done via environment variables for those systems that
do not have the library responsible for parsing the XML files (i.e., libxml2).
This appendix presents the environment variables the Extrae package uses if EXTRAE CONFIG FILE
is not set and a description. For those environment variable that refer to XML ’enabled’ attributes
(i.e., that can be set to ”yes” or ”no”) are considered to be enabled if their value are defined to 1.
57
Environment variable Description
EXTRAE BUFFER SIZE Set the number of records that the instrumentation buffer can
hold before flushing them.
EXTRAE CIRCULAR BUFFER (deprecated)
EXTRAE COUNTERS See section 4.9.1. Just one set can be defined. Counters (in PAPI)
groups (in PMAPI) are given separated by commas.
EXTRAE CONTROL FILE The instrumentation will be enabled only when the file pointed exists.
EXTRAE CONTROL GLOPS Starts the instrumentation when the specified number of global collectives
have been executed.
EXTRAE CONTROL TIME Checks the file pointed by EXTRAE CONTROL FILE at this period.
EXTRAE DIR Specifies where temporal files will be created during
instrumentation.
EXTRAE DISABLE MPI Disable MPI instrumentation.
EXTRAE DISABLE OMP Disable OpenMP instrumentation.
EXTRAE DISABLE PTHREAD Disable pthread instrumentation.
EXTRAE DISABLE PACX Disable PACX instrumentation.
58
EXTRAE FILE SIZE Set the maximum size (in Mbytes) for the intermediate trace file.
EXTRAE FUNCTIONS List of routine to be instrumented, as described in 4.8 using the
GNU C -finstrument-functions or the IBM XL -qdebug=function trace
option at compile and link time.
EXTRAE FUNCTIONS COUNTERS ON Specify if the performance counters should be collected when a
user function event is emitted.
EXTRAE FINAL DIR Specifies where files will be stored when the application ends.
EXTRAE GATHER MPITS Gather intermediate trace files into a single directory
(this is only available when instrumenting MPI applications).
EXTRAE HOME Points where the Extrae is installed.
EXTRAE INITIAL MODE Choose whether the instrumentation runs in in detail or
in bursts mode.
EXTRAE BURST THRESHOLD Specify the threshold time to filter running bursts.
EXTRAE MINIMUM TIME Specify the minimum amount of instrumentation time.
EXTRAE PACX COUNTERS ON Set to 1 if PACX must report performace counter values.
EXTRAE PACX STATISTICS Set to 1 if basic PACX statistics must be collected in burst mode.
EXTRAE PROGRAM NAME Specify the prefix of the resulting intermediate trace files.
EXTRAE SAMPLING CALLER Determines the callstack segment stored through time-sampling capabilities.
EXTRAE SAMPLING CLOCKTYPE Determines domain for sampling clock. Options are: DEFAULT, REAL, VIRTUAL
and PROF.
EXTRAE SAMPLING PERIOD Enable time-sampling capabilities with the indicated period.
EXTRAE SAMPLING VARIABILITY Adds some variability to the sampling period.
EXTRAE RUSAGE Instrumentation emits resource usage at flush points if set to 1.
EXTRAE SPU DMA CHANNEL Choose the SPU-PPU dma communication channel.
EXTRAE SPU BUFFER SIZE Set the buffer size of the SPU side.
EXTRAE SPU FILE SIZE Set the maximum size for the SPU side (default: 5Mbytes).
EXTRAE TRACE TYPE Choose whether the resulting tracefiles are intended for Paraver or Dimemas.
61
src/common/utils.c:125: undefined reference to ‘ intel sse2 strdup’
src/common/utils.c:132: undefined reference to ‘ intel sse2 strtok’
src/common/utils.c:100: undefined reference to ‘ intel sse2 strncpy’
src/common/timesync.c:211: undefined reference to ‘ intel fast memset’
Answer: The instrumentation libraries have been compiled using Intel compilers (i.e. icc,
icpc) whereas the application is being linked through non-Intel compilers or ld directly.
You can proceed in three directions, you can either compile your application using the Intel
compilers, or add a Intel library that provides these routines (libintlc.so and libirc.so,
for instance), or even recompile Extrae using the GNU compilers. Note, moreover, that using
Intel MPI compiler does not guarantee using the Intel compiler backends, just run the MPI
compiler (mpicc, mpiCC, mpif77, mpif90, .. ) with the -v flag to get information on what
compiler backend relies.
• Question: The make command dies when building libraries belonging Extrae in an AIX ma-
chine with messages like:
libtool: link: ar cru libcommon.a libcommon la-utils.o libcommon la-events.o
ar: 0707-126 libcommon la-utils.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 libcommon la-events.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
Answer: Libtool uses ar command to build static libraries. However, ar does need special
flags (-X64) to deal with 64 bit objects. To workaround this problem, just set the environ-
ment variable OBJECT MODE to 64 before executing gmake. The ar command honors this
variable to properly handle the object files in 64 bit mode.
• Question: The configure script dies saying
configure: error: Unable to determine pthread library support.
Answer: Some systems (like BG/L) does not provide a pthread library and configure
claims that cannot find it. Launch the configure script with the -disable-pthread param-
eter.
• Question: NOT! gmake command fails when compiling the instrumentation package in a
machine running AIX operating system, using 64 bit mode and IBM XL compilers complaining
about Profile MPI (PMPI) symbols.
Answer: NOT! Use the reentrant version of IBM compilers (xlc r and xlC r). Non
reentrant versions of MPI library does not include 64 bit MPI symbols, whereas reentrant
versions do. To use these compilers, set the CC (C compiler) and CXX (C++ compiler)
environment variables before running the configure script.
• Question: The compiler fails complaining that some parameters can not be understand when
compiling the parallel merge. Answer: If the environment has more than one compiler (for
example, IBM and GNU compilers), is it possible that the parallel merge compiler is not the
same as the rest of the package. There are two ways to solve this:
– Force the package compilation with the same backend as the parallel compiler. For
example, for IBM compiler, set CC=xlc and CXX=xlC at the configure step.
– Tell the parallel compiler to use the same compiler as the rest of the package. For
example, for IBM compiler mpcc, set MP COMPILER=gcc when issuing the make command.
62
• Question: The instrumentation package does not generate the shared instrumentation li-
braries but generates the satatic instrumentation libraries.
Answer 1: Check that the configure step was compiled without --disable-shared or force
it to be enabled through --enable-shared.
Answer 2: Some MPI libraries (like MPICH 1.2.x) do not generate the shared libraries by
default. The instrumentation package rely on them to generate its shared libraries, so make
sure that the shared libraries of the MPI library are generated.
• Question: In BlueGene systems where the libxml2 (or any optional library for extrae) the
linker shows error messages like when compiling the final application with the Extrae library:
../libxml2/lib/libxml2.a(xmlschemastypes.o): In function ‘ xmlSchemaDateAdd’:
../libxml2-2.7.2/xmlschemastypes.c:3771: undefined reference to ‘ uitrunc’
../libxml2-2.7.2/xmlschemastypes.c:3796: undefined reference to ‘ uitrunc’
../libxml2-2.7.2/xmlschemastypes.c:3801: undefined reference to ‘ uitrunc’
../libxml2-2.7.2/xmlschemastypes.c:3842: undefined reference to ‘ uitrunc’
../libxml2-2.7.2/xmlschemastypes.c:3843: undefined reference to ‘ uitrunc’
../libxml2/lib/libxml2.a(xmlschemastypes.o): In function ‘xmlSchemaGetCanonValue’:
../libxml2-2.7.2/xmlschemastypes.c:5840: undefined reference to ‘ f64tou64rz’
../libxml2-2.7.2/xmlschemastypes.c:5843: undefined reference to ‘ f64tou64rz’
../libxml2-2.7.2/xmlschemastypes.c:5846: undefined reference to ‘ f64tou64rz’
../libxml2-2.7.2/xmlschemastypes.c:5849: undefined reference to ‘ f64tou64rz’
../libxml2/lib/libxml2.a(debugXML.o): In function ‘xmlShell’:
../libxml2-2.7.2/debugXML.c:2802: undefined reference to ‘ fill’
collect2: ld returned 1 exit status
Answer: The libxml2 library (or any other optional library) has been compiled using the
IBM XL compiler. There are two alternatives to circumvent the problem: add the XL li-
braries into the link stage when building your application, or recompile the libxml2 library
using the GNU gcc cross compiler for BlueGene.
• Question: Where do I get the procedure and constant declarations for Fortran?
Answer: You can find a module (ready to be compiled) in $EXTRAE HOME/include/extrae module.f.
To use the module, just compile it (do not link it), and then use it in your compiling / linking
step. If you do not use the module, the trace generation (specially for those routines that
expect parameters which are not INTEGER*4) can result in type errors and thus generate a
tracefile that does not honor the Extrae calls.
63
Answer 3: If the code is MPI and Fortran, check that you’re using the proper Fortran library
for the instrumentation.
Answer 4: If the code is MPI and you are using LD PRELOAD, check that the binary is
linked against a shared MPI library (you can use the ldd command).
• Question: The instrumentation begins for a single process instead for several processes?
Answer 1: Check that you place the appropriate parameter to indicate the number of tasks
(typically -np).
Answer 2: Some MPI implementation require the application to receive special MPI pa-
rameters to run correctly. For example, MPICH based on CH-P4 device require the binary
to receive som paramters. The following example is an sh-script that solves this issue:
#!/bin/sh
EXTRAE CONFIG FILE=extrae.xml ./mpi program $@ real params
• Question: The resulting traces does not contain the routines that have been instrumented.
Answer 1: Check that the routines have been actually executed.
Answer 2: Some compilers do automatic inlining of functions at some optimization levels
(e.g., Intel Compiler at -O2). When functions are inlined, they do not have entry and exit
blocks and cannot be instrumented. Turn off inlining or decrease the optimization level.
• Question: When running the instrumented application, the loader complains about:
undefined symbol: clock gettime
Answer : The instrumentation package was configured using --enable-posix-clock and
on many systems this implies the inclusion of additional libraries (namely, -lrt).
64
Answer 2: If using PMAPI (on AIX systems), check for the pmlist command. Specifically,
check for the available groups running pmlist -g -1.
• Question: When using PAPI, I cannot read eight performance counters or the specified in
papi avail output.
Answer 1: There are some performance counters (those listed in papi avail) that are
classified as derived. Such performance counters depend on more than one counter increasing
the number of real performance counters used. Check for the derived column within the list
to check whether a performance counter is derived or not.
Answer 2: On some architectures, like the PowerPC, the performance counters are grouped
in a such way that choosing a performance counter precludes others from being elected in the
same set. A feasible work-around is to create as many sets in the XML file to gather all the
required hardware counters and make sure that the sets change from time to time.
• Question: The resulting Paraver tracefile contains invalid references to the source code.
Answer: This usually happens when the code has not been compiled and linked with the
-g flag. Moreover, some high level optimizations (which includes inlining, interprocedural
analysis, and so on) can lead to generate bad references.
• Question: The resulting trace contains information regarding the stack (like callers) but
their value does not coincide with the source code.
Answer: Check that the same binary is used to generate the trace and referenced with the
the -e parameter when generating the Paraver tracefile.
65
66
Appendix D
Instrumented routines
• MPI Init
• MPI Finalize
• MPI Bsend
• MPI Ssend
• MPI Rsend
• MPI Send
• MPI Ibsend
• MPI Issend
• MPI Irsend
• MPI Isend
• MPI Recv
• MPI Irecv
67
• MPI Reduce
• MPI Allreduce
• MPI Barrier
• MPI Cancel
• MPI Test
• MPI Wait
• MPI Waitall
• MPI Waitany
• MPI Waitsome
• MPI Bcast
• MPI Alltoall
• MPI Alltoallv
• MPI Allgather
• MPI Allgatherv
• MPI Gather
• MPI Gatherv
• MPI Scatter
• MPI Scatterv
• MPI Start
68
• MPI Startall
• MPI Scan
• MPI Sendrecv
• MPI Get3
• MPI Put3
• kmpc barrier
69
• kmpc unset lock4
The instrumentation of the Intel OpenMP runtime for version 11.0 to 12.0 is available using
the Extrae package based on the LD PRELOAD and also the DynInst mechanisms. The instrumented
routines include:
• kmpc barrier
• kmpc single
• kmpc critical4
• xlsmpParallelDoSetup TPO
• xlsmpParRegionSetup TPO
• xlsmpWSDoSetup TPO
4
The instrumentation of OpenMP locks can be enabled/disabled
70
• xlsmpBarrier TPO
• xlsmpSingleSetup TPO
• xlsmpWSSectSetup TPO
• xlsmpRelDefaultSLock4
• xlsmpGetDefaultSLock4
71
• GOMP parallel loop runtime start
• GOMP barrier
• GOMP task
• GOMP taskwait
• pthread create
• pthread detach
• pthread join
72
• pthread rwlock wrlock
• cudaLaunch
• cudaConfigureCall
• cudaThreadSynchronize
• cudaStreamCreate
• cudaStreamSynchronize
• cudaMemcpy
• cudaMemcpyAsync
• cudaDeviceReset
The CUDA accelerators do not have memory for the tracing buffers, so the tracing buffer
resides in the host side. Typically, the CUDA tracing buffer is flushed at cudaThreadSynchronize,
cudaStreamSynchronize and cudaMemcpy calls, so it is possible that the tracing buffer for the
device gets filled if no calls to this routines are executed.
• clBuildProgram
• clCompileProgram
• clCreateBuffer
• clCreateCommandQueue
• clCreateContext
• clCreateContextFromType
• clCreateKernel
• clCreateKernelsInProgram
73
• clCreateProgramWithBinary
• clCreateProgramWithBuiltInKernels
• clCreateProgramWithSource
• clCreateSubBuffer
• clEnqueueBarrierWithWaitList5
• clEnqueueCopyBuffer
• clEnqueueCopyBufferRect
• clEnqueueFillBuffer
• clEnqueueMarkerWithWaitList5
• clEnqueueMapBuffer
• clEnqueueMigrateMemObjects5
• clEnqueueNativeKernel
• clEnqueueNDRangeKernel
• clEnqueueReadBuffer
• clEnqueueReadBufferRect
• clEnqueueTask
• clEnqueueUnmapMemObject
• clEnqueueWriteBuffer
• clEnqueueWriteBufferRect
• clFinish
• clFlush
• clLinkProgram
• clRetainCommandQueue
• clRetainContext
• clRetainDevice
• clRetainEvent
• clRetainKernel
• clRetainMemObject
74
• clRetainProgram
• clReleaseCommandQueue
• clReleaseContext
• clReleaseDevice
• clReleaseEvent
• clReleaseKernel
• clReleaseMemObject
• clReleaseProgram
• clSetKernelArg
• clWaitForEvents
The OpenCL accelerators have small amounts of memory, so the tracing buffer resides in the host
side. Typically, the accelerator tracing buffer is flushed at each cl Finish call, so it is possible that
the tracing buffer for the accelerator gets filled if no calls to this routine are executed. However
if the operated OpenCL command queue is tagged as not Out-of-Order, then flushes will also
happen at clEnqueueReadBuffer, clEnqueueReadBufferRect and clEnqueueMapBuffer if their
corresponding blocking parameter is set to true.
5
Available in OpenCL v1.2
75