VampirTrace 5.8.4 User Manual
TU Dresden
Center for Information Services and
High Performance Computing (ZIH)
01062 Dresden
Germany
http://www.tu-dresden.de/zih
http://www.tu-dresden.de/zih/vampirtrace
Contact: mailto:vampirsupport@zih.tu-dresden.devampirsupport@zih.tu-dresden.de
This documentation describes how to apply VampirTrace to an application in order to generate trace files at execution time. This step is called instrumentation. It furthermore explains how to control the runtime measurement system during execution (tracing). This also includes performance counter sampling as well as selective filtering and grouping of functions.
VampirTrace consists of a tool set and a runtime library for instrumentation and tracing of software applications. It is particularly tailored to parallel and distributed High Performance Computing (HPC) applications.
The instrumentation part modifies a given application in order to inject additional measurement calls during runtime. The tracing part provides the actual measurement functionality used by the instrumentation calls. By this means, a variety of detailed performance properties can be collected and recorded during runtime. This includes function enter and leave events, MPI communication, OpenMP events, and performance counters.
After a successful tracing run, VampirTrace writes all collected data to a trace file in the Open Trace Format (OTF)[+]. As a result, the information is available for post-mortem analysis and visualization by various tools. Most notably, VampirTrace provides the input data for the Vampir analysis and visualization tool[+].
VampirTrace is included in OpenMPI 1.3 and later versions. If not disabled explicitly, VampirTrace is built automatically when installing OpenMPI[+].
Trace files can quickly become very large, especially with automatic instrumentation. Tracing applications for only a few seconds can result in trace files of several hundred megabytes. To protect users from creating trace files of several gigabytes, the default behavior of VampirTrace limits the internal buffer to 32 MB per process. Thus, even for larger scale runs the total trace file size will be moderate. Please read Section 3.3 on how to remove or change this limit.
VampirTrace supports various Unix and Linux platforms that are common in HPC nowadays. It is available as open source software under a BSD License.
The following list shows a summary of all instrumentation and tracing features that VampirTrace offers. Note that not all features are supported on all platforms.
Tracing of user functions ⇒ Chapter 2
MPI Tracing ⇒ Chapter 2
OpenMP Tracing ⇒ Chapter 2
Pthread Tracing
Java Tracing ⇒ Chapter 2
3rd-Party Library tracing ⇒ Section 2.7
MPI Correctness Checking ⇒ Section 4.8
User API
Performance Counters ⇒ Sections 4.1 and 4.2
Memory Tracing ⇒ Section 4.3
I/O Tracing ⇒ Section 4.6
CPU ID Tracing ⇒ Section 4.4
Fork/System/Exec Tracing ⇒ Section 4.7
Filtering & Grouping ⇒ Chapter 5
OTF Output ⇒ Chapter 3
To perform measurements with VampirTrace, the user's application program needs to be instrumented, i.e., at specific points of interest (called ``events'') VampirTrace measurement calls have to be activated. As an example, common events are, amongst others, entering and leaving of functions as well as sending and receiving of MPI messages.
VampirTrace handles this automatically by default. In order to enable the instrumentation of function calls, the user only needs to replace the compiler and linker commands with VampirTrace's wrappers, see Section 2.1 below. VampirTrace supports different ways of instrumentation as described in Section 2.2.
All the necessary instrumentation of user functions, MPI, and OpenMP events is handled by VampirTrace's compiler wrappers (vtcc, vtcxx, vtf77, and vtf90). In the script used to build the application (e.g. a makefile), all compile and link commands should be replaced by the VampirTrace compiler wrapper. The wrappers perform the necessary instrumentation of the program and link the suitable VampirTrace library. Note that the VampirTrace version included in OpenMPI 1.3 has additional wrappers (mpicc-vt, mpicxx-vt, mpif77-vt, and mpif90-vt) which are like the ordinary MPI compiler wrappers (mpicc, mpicxx, mpif77, and mpif90) with the extension of automatic instrumentation.
The following list shows some examples specific to the parallelization type of the program:
original: | gfortran hello.f90 -o hello |
with instrumentation: | vtf90 hello.f90 -o hello |
This will instrument user functions (if supported by the compiler) and link the VampirTrace library.
original: | mpicc hello.c -o hello |
with instrumentation: | vtcc -vt:cc mpicc hello.c -o hello |
MPI implementations without own compilers require the user to link the MPI library manually. In this case, simply replace the compiler by VampirTrace's compiler wrapper:
original: | icc hello.c -o hello -lmpi |
with instrumentation: | vtcc hello.c -o hello -lmpi |
If you want to instrument MPI events only (this creates smaller trace files and less overhead) use the option -vt:inst manual to disable automatic instrumentation of user functions (see also Section 2.4.1).
original: | ifort <-openmp|-pthread> hello.f90 |
-o hello | |
with instrumentation: | vtf90 <-openmp|-pthread> hello.f90 |
-o hello |
For more information about OPARI read the documentation available in VampirTrace's installation directory at: share/vampirtrace/doc/opari/Readme.html
original: | mpif90 <-openmp|-pthread> hello.F90 |
-o hello | |
with instrumentation: | vtf90 -vt:f90 mpif90 |
<-openmp|-pthread> hello.F90 | |
-o hello |
The VampirTrace compiler wrappers automatically try to detect which parallelization method is used by means of the compiler flags (e.g. -lmpi, -openmp or -pthread) and the compiler command (e.g. mpif90). If the compiler wrapper failed to detect this correctly, the instrumentation could be incomplete and an unsuitable VampirTrace library would be linked to the binary. In this case, you should tell the compiler wrapper which parallelization method your program uses by using the switches -vt:mpi, -vt:mt, and -vt:hyb for MPI, multithreaded, and hybrid programs, respectively. Note that these switches do not change the underlying compiler or compiler flags. Use the option -vt:verbose to see the command line that the compiler wrapper executes. See Section B.1 for a list of all compiler wrapper options.
The default settings of the compiler wrappers can be modified in the files share/vampirtrace/vtcc-wrapper-data.txt (and similar for the other languages) in the installation directory of VampirTrace. The settings include compilers, compiler flags, libraries, and instrumentation types. You could for instance modify the default C compiler from gcc to mpicc by changing the line compiler=gcc to compiler=mpicc. This may be convenient if you instrument MPI parallel programs only.
The wrapper option -vt:inst <insttype> specifies the instrumentation type to be used. The following values for <insttype> are possible:
To determine which instrumentation type will be used by default and which instrumentation types are available on your system have a look at the entry inst_avail in the wrapper's configuration file (e.g. share/vampirtrace/vtcc-wrapper-data.txt in the installation directory of VampirTrace for the C compiler wrapper).
See Section B.1 or type vtcc -vt:help for other options that can be passed to VampirTrace's compiler wrapper.
Automatic instrumentation is the most convenient method to instrument your program. If available, simply use the compiler wrappers without any parameters, e.g.:
% vtf90 hello.f90 -o hello
To get the application executable for nm during runtime, VampirTrace uses the /proc file system. As /proc is not present on all operating systems, automatic symbol information might not be available. In this case, it is necessary to set the environment variable VT_APPPATH to the pathname of the application executable to get symbols resolved via nm.
Should any problems emerge to get symbol information automatically, then the environment variable VT_GNU_NMFILE can be set to a symbol list file, which is created with the command nm, like:
% nm hello > hello.nm
To get the source code line for the application functions use nm -l on Linux systems.
VampirTrace will include this information into the trace.
Note that the output format of nm must be written in BSD-style. See the manual page
of nm to obtain help for dealing with the output format setting.
__attribute__ ((__no_instrument_function__))
The PGI and IBM compilers prefer inlining over instrumentation when compiling with enabled inlining. Thus, one needs to disable inlining to enable the instrumentation of inline functions and vice versa.
The bottom line is that a function cannot be inlined and instrumented at the same time. For more information on how to inline functions read your compiler's manual.
The VT_USER_START, VT_USER_END calls can be used to instrument any user-defined sequence of statements.
Fortran: #include "vt_user.inc" VT_USER_START('name') ... VT_USER_END('name')
C: #include "vt_user.h" VT_USER_START("name"); ... VT_USER_END("name");If a block has several exit points (as it is often the case for functions), all exit points have to be instrumented with VT_USER_END, too.
For C++ it is simpler as is demonstrated in the following example. Only entry points into a scope need to be marked. The exit points are detected automatically when C++ deletes scope-local variables.
C++: #include "vt_user.h" { VT_TRACER("name"); ... }
The instrumented sources have to be compiled with -DVTRACE for all three languages, otherwise the VT_* calls are ignored. Note that Fortran source files instrumented this way have to be preprocessed, too.
In addition, you can combine this particular instrumentation type with all other types. In such a way, all user functions can be instrumented by a compiler while special source code regions (e.g. loops) can be instrumented by VT's API.
Use VT's compiler wrapper (described above) for compiling and linking the instrumented source code, such as:
Note that you can also use the option -vt:inst manual with non-instrumented sources. Binaries created in this manner only contain MPI and OpenMP instrumentation, which might be desirable in some cases.
Furthermore the "on/off" functionality can be used to control the
tracing behavior of VampirTrace and allows to trace only parts of interests.
Therefore the amount of trace data can be reduced essentially.
To check whether if tracing is enabled or not use the call VT_IS_ON.
Please note that stopping and starting the recording of events has to be performed at the same call stack level. If this is not the case, an error message will be printed during runtime and VampirTrace will abort execution. For further information have a look at the FAQ D.6.
The option -vt:inst dyninst is used with the compiler wrapper to instrument the application during runtime (binary instrumentation), by using Dyninst[+]. Recompiling is not necessary for this kind of instrumentation, but relinking:
% vtf90 -vt:inst dyninst hello.o -o hello
The compiler wrapper dynamically links the library libvt-dynatt.so
to the application. This library attaches the Mutator-program
vtdyn during runtime which invokes the instrumentation by using
the Dyninst-API.
Note that the application should have been compiled with the -g
switch to have visible symbol names.
After a tracing run with this kind of instrumentation, the vtunify
utility needs to be invoked manually (⇒ Sections 3.5 and B.2).
To prevent certain functions from being instrumented you can set the environment variable VT_DYN_BLACKLIST to a file containing a newline-separated list of function names. All additional overhead, due to instrumentation of these functions, will be removed.
VampirTrace also allows binary instrumentation of functions located in shared libraries. For this to work the shared libraries have to be compiled with -g and a colon-separated list of their names has to be given in the environment variable VT_DYN_SHLIBS:
VT_DYN_SHLIBS=libsupport.so:libmath.so
% java -agentlib:vt-java ...
Or more easier, by replacing the usal Java application launcher java by the command vtjava:
% vtjava ...
When tracing Java applications, you probably want to filter out dispensable function calls. Please have a look at Sections 5.1 and 5.2 to learn about different ways for excluding parts of the application from tracing.
% vtlibwrapgen -g SDL -o SDLwrap.c /usr/include/SDL/*.h
This generates the source file SDLwrap.c that contains wrapper-functions for all library functions found in the header-files located in /usr/include/SDL/ and instructs VampirTrace to assign these functions to the new group SDL.
The generated wrapper source file can be edited in order to add manual instrumentation or alter attributes of the library wrapper. A detailed description can be found in the generated source file or in the header file vt_libwrap.h which can be found in the include directory of VampirTrace.
To adapt the library instrumentation it is possible to pass a filter file to
the generation process. The rules are like these for normal VampirTrace instrumentation
(see Section 5.1), where only 0 (exclude functions) and -1 (generally include
functions) are allowed.
The second step is to compile the generated source file:
% vtlibwrapgen --build --shared -o libSDLwrap SDLwrap.c
This builds the shared library libSDLwrap.so which can be linked to the application or preloaded by using the environment variable LD_PRELOAD:
% LD_PRELOAD=$PWD/libSDLwrap.so <executable>
For more information about the tool vtlibwrapgen see Section B.5.
Running a VampirTrace instrumented application should normally result in an OTF trace file in the current working directory where the application was executed. If a problem occurs, set the environment variable VT_VERBOSE to 2 before executing the instrumented application in order to see control messages of the VampirTrace runtime system which might help tracking down the problem.
The internal buffer of VampirTrace is limited to 32 MB per process. Use the environment variables VT_BUFFER_SIZE and VT_MAX_FLUSHES to increase this limit. Section 3.3 contains further information on how to influence trace file size.
The default name of the trace file depends on the operating system where the application is run. On Linux, MacOS and Sun Solaris the trace file will be named like the application, e.g. hello.otf for the executable hello. For other systems, the default name is a.otf. Optionally, the trace file name can be defined manually by setting the environment variable VT_FILE_PREFIX to the desired name. The suffix .otf will be added automatically.
To prevent overwriting of trace files by repetitive program runs, one can enable unique trace file naming by setting VT_FILE_UNIQUE to yes. In this case, VampirTrace adds a unique number to the file names as soon as a second trace file with the same name is created. A *.lock file is used to count up the number of trace files in a directory. Be aware that VampirTrace potentially overwrites an existing trace file if you delete this lock file. The default value of VT_FILE_UNIQUE is no. You can also set this variable to a number greater than zero, which will be added to the trace file name. This way you can manually control the unique file naming.
The default location of the final trace file is the working directory at application start time. If the trace file shall be stored in another place, use VT_PFORM_GDIR as described in Section 3.2 to change the location of the trace file.
Variable | Purpose | Default |
---|---|---|
Global Settings |
||
VT_APPPATH | Path to the application executable.
⇒ Section 2.3.2 |
- |
VT_BUFFER_SIZE | Size of internal event trace buffer. This is the place where
event records are stored, before being written to a file.
⇒ Section 3.3 |
32M |
VT_CLEAN | Remove temporary trace files? | yes |
VT_COMPRESSION | Write compressed trace files? | yes |
VT_FILE_PREFIX | Prefix used for trace filenames. | ⇒Sect.3.1 |
VT_FILE_UNIQUE | Enable unique trace file naming?
Set to yes, no, or a numerical ID.
⇒ Section 3.1 |
no |
VT_MAX_FLUSHES | Maximum number of buffer flushes.
⇒ Section 3.3 |
1 |
VT_MAX_THREADS | Maximum number of threads ([IMAGE png]) per process that VampirTrace reserves resources for. | 65536 |
VT_PFORM_GDIR | Name of global directory to store final trace file in. | ./ |
VT_PFORM_LDIR | Name of node-local directory which can be used to store temporary trace files. | /tmp/ |
VT_UNIFY | Unify local trace files afterwards? | yes |
VT_VERBOSE | Level of VampirTrace related information messages: Quiet (0), Critical (1), Information (2) | 1 |
Optional Features |
||
VT_CPUIDTRACE | Enable tracing of core ID of a CPU?
⇒ Section 4.4 |
no |
VT_ETIMESYNC | Enable enhanced timer synchronization?
⇒ Section 3.7 |
no |
VT_ETIMESYNC_INTV | Interval between two successive synchronization phases in s. | 120 |
VT_IOLIB_PATHNAME | Provides an alternative library to use for LIBC I/O calls. ⇒ Section 4.6 | - |
VT_IOTRACE | Enable tracing of application I/O calls?
⇒ Section 4.6 |
no |
VT_LIBCTRACE | Enable tracing of fork/system/exec calls?
⇒ Section 4.7 calls |
yes |
VT_MEMTRACE | Enable memory allocation counter?
⇒ Section 4.3 |
no |
VT_MODE | Colon-separated list of VampirTrace modes: Tracing (TRACE), Profiling (STAT).
⇒ Section 3.4 |
TRACE |
VT_MPICHECK | Enable MPI correctness checking via UniMCI? | no |
VT_MPICHECK_ERREXIT | Force trace write and application exit if an MPI usage error is detected? | no |
VT_MPITRACE | Enable tracing of MPI events? | yes |
VT_PTHREAD_REUSE | Reuse IDs of terminated Pthreads? | yes |
VT_STAT_INV | Length of interval for writing the next profiling record | 0 |
VT_STAT_PROPS | Colon-separated list of event types that shall be recorded in profiling mode:
Functions (FUNC), Messages (MSG), Collective Ops. (COLLOP) or all of them
(ALL)
⇒ Section 3.4 |
ALL |
VT_SYNC_FLUSH | Enable synchronized buffer flush?
⇒ Section 3.6 |
no |
VT_SYNC_FLUSH_LEVEL | Minimum buffer fill level for synchronized buffer flush in percent. | 80 |
Counters |
||
VT_METRICS | Specify counter metrics to be recorded with trace events as a
colon/VT_METRICS_SEP-separated list of names.
⇒ Section 4.1 |
- |
VT_METRICS_SEP | Separator string between counter specifications in VT_METRICS. | : |
VT_RUSAGE | Colon-separated list of resource usage counters which shall be recorded.
⇒ Section 4.2 |
- |
VT_RUSAGE_INTV | Sample interval for recording resource usage counters in ms. | 100 |
Filtering, Grouping |
||
VT_DYN_BLACKLIST | Name of blacklist file for Dyninst instrumentation.
⇒ Section 2.5 |
- |
VT_DYN_SHLIBS | Colon-separated list of shared libraries for Dyninst instrumentation.
⇒ Section 2.5 |
- |
VT_FILTER_SPEC | Name of function/region filter file.
⇒ Section 5.1 |
- |
VT_GROUPS_SPEC | Name of function grouping file.
⇒ Section 5.3 |
- |
VT_JAVA_FILTER_SPEC | Name of Java specific filter file.
⇒ Section 5.2 |
- |
VT_GROUP_CLASSES | Create a group for each Java class automatically? | yes |
VT_MAX_STACK_DEPTH | Maximum number of stack level to be traced.
(0 = unlimited) |
0 |
Symbol List |
||
VT_GNU_NM | Command to list symbols from object files.
⇒ Section 2.3 |
nm |
VT_GNU_NMFILE | Name of file with symbol list information.
⇒ Section 2.3 |
- |
The variables VT_PFORM_GDIR, VT_PFORM_LDIR, VT_FILE_PREFIX may contain (sub)strings of the form $XYZ or ${XYZ} where XYZ is the name of another environment variable. Evaluation of the environment variable is done at measurement runtime.
When you use these environment variables, make sure that they have the same value for all processes of your application on all nodes of your cluster. Some cluster environments do not automatically transfer your environment when executing parts of your job on remote nodes of the cluster, and you may need to explicitly set and export them in batch job submission scripts.
The default values of the environment variables VT_BUFFER_SIZE and VT_MAX_FLUSHES limit the internal buffer of VampirTrace to 32 MB per process and the number of times that the buffer is flushed to 1, respectively. Events that are to be recorded after the limit has been reached are no longer written into the trace file. The environment variables apply to every process of a parallel application, meaning that applications with n processes will typically create trace files n times the size of a serial application.
To remove the limit and get a complete trace of an application, set VT_MAX_FLUSHES to 0. This causes VampirTrace to always write the buffer to disk when it is full. To change the size of the buffer, use the environment variable VT_BUFFER_SIZE. The optimal value for this variable depends on the application which is to be traced. Setting a small value will increase the memory available to the application, but will trigger frequent buffer flushes by VampirTrace. These buffer flushes can significantly change the behavior of the application. On the other hand, setting a large value, like 2G, will minimize buffer flushes by VampirTrace, but decrease the memory available to the application. If not enough memory is available to hold the VampirTrace buffer and the application data, parts of the application may be swapped to disk, leading to a significant change in the behavior of the application.
Note that you can decrease the size of trace files significantly by using the runtime function filtering as explained in Section 5.1.
To profile an application set the variable VT_MODE to STAT. Setting VT_MODE to STAT:TRACE tells VampirTrace to perform tracing and profiling at the same time. By setting the variable VT_STAT_PROPS the user can influence whether functions, messages, and/or collective operations shall be profiled. See Section 3.2 for information about these environment variables.
After a run of an instrumented application the traces of the single processes need to be unified in terms of timestamps and event IDs. In most cases, this happens automatically. If the environment variable VT_UNIFY is set to no or under certain circumstances it is necessary to perform unification of local traces manually. To do this, use the following command:
% vtunify <nproc> <prefix>
If VampirTrace was built with support for OpenMP and/or MPI, it is possible to speedup the unification of local traces significantly. To distribute the unification on multible processes the MPI parallel version vtunify-mpi can be used as follow:
% mpirun -np <nranks> vtunify-mpi <nproc> <prefix>
Furthermore, both tools vtunify and vtunify-mpi are capable to open additional OpenMP threads for unification. The number of threads can be specified by the OMP_NUM_THREADS environment variable.
Especially on cluster environments, where each process has its own local timer,
tracing relies on precisely synchronized timers. Therefore, VampirTrace provides
several mechanisms for timer synchronization. The default synchronization scheme is a
linear synchronization at the very begin and the very end of a trace run with a
master-slave communication pattern.
However, this way of synchronization can become to imprecise for long trace runs.
Therefore, we recommend the usage of the enhanced timer synchronization scheme of
VampirTrace. This scheme inserts additional synchronization phases at appropriate
points in the program flow. Currently, VampirTrace makes use of all MPI collective
functions associated with MPI_COMM_WORLD.
To enable this synchronization scheme, a LAPACK library with C wrapper support has to be
provided for VampirTrace and the environment variable
VT_ETIMESYNC (⇒ Section 3.2)
has to be set before the tracing.
The length of the interval between two successive synchronization phases can be
adjusted with VT_ETIMESYNC_INTV.
The following LAPACK libraries provide a C-LAPACK API that can be used by VampirTrace
for the enhanced timer synchronization:
If VampirTrace has been built with hardware counter support (⇒ Appendix A), it is capable of recording hardware counter information as part of the event records. To request the measurement of certain counters, the user is required to set the environment variable VT_METRICS. The variable should contain a colon-separated list of counter names or a predefined platform-specific group.
The user can leave the environment variable unset to indicate that no counters are requested. If any of the requested counters are not recognized or the full list of counters cannot be recorded due to hardware resource limits, program execution will be aborted with an error message.
If the PAPI library is used to access hardware performance counters, metric names can be any PAPI preset names or PAPI native counter names. For example, set
VT_METRICS=PAPI_FP_OPS:PAPI_L2_TCM:!CPU_TEMP1
to record the number of floating point instructions and level 2 cache misses (PAPI preset counters),
cpu temperature from the lm_sensors component.
The leading exclamation mark let CPU_TEMP1 be interpreted as absolute value counter.
See Section C.1 for a full list of PAPI preset counters.
On Sun Solaris operating systems VampirTrace can make use of the CPC performance counter library to query the processor's hardware performance counters. The counters which are actually available on your platform can be queried with the tool vtcpcavail. The listed names can then be used within VT_METRICS to tell VampirTrace which counters to record.
On NEC SX machines VampirTrace uses special register calls to query the processor's hardware counters. Use VT_METRICS to specify the counters that have to be recorded. See Section C.3 for a full list of NEC SX hardware performance counters.
The Unix system call getrusage provides information about consumed resources and operating system events of processes such as user/system time, received signals, and context switches.
If VampirTrace has been built with resource usage support, it is able to record this information as performance counters to the trace. You can enable tracing of specific resource counters by setting the environment variable VT_RUSAGE to a colon-separated list of counter names, as specified in Section C.4. For example, set
VT_RUSAGE=ru_stime:ru_majflt
to record the system time consumed by each process and the number of page faults.
Alternatively, one can set this variable to the value all to
enable recording of all 16 resource usage counters.
Note that not all counters are supported by all Unix operating systems.
Linux 2.6 kernels, for example, support only resource information for six of them.
See Section C.4 and the manual page of getrusage for details.
The resource usage counters are not recorded at every event. They are only read if 100ms have passed since the last sampling. The interval can be changed by setting VT_RUSAGE_INTV to the number of desired milliseconds. Setting VT_RUSAGE_INTV to zero leads to sampling resource usage counters at every event, which may introduce a large runtime overhead. Note that in most cases the operating system does not update the resource usage information at the same high frequency as the hardware performance counters. Setting VT_RUSAGE_INTV to a value less than 10ms does usually not improve the granularity.
Be aware that, when using the resource usage counters for multi-threaded programs, the information displayed is valid for the whole process and not for each single thread.
The GNU LIBC implementation provides a special hook mechanism that allows intercepting all calls to memory allocation and free functions (e.g. malloc, realloc, free). This is independent from compilation or source code access, but relies on the underlying system library.
If VampirTrace has been built with memory-tracing support (⇒ Appendix A), VampirTrace is capable of recording memory allocation information as part of the event records. To request the measurement of the application's allocated memory, the user must set the environment variable VT_MEMTRACE to yes.
The GNU LIBC implementation provides a function to determine the core id of a CPU on which the calling thread is running. VampirTrace uses this functionality to record the current core identifier as counter. This feature can be activated by setting the environment variable VT_CPUIDTRACE to yes.
C/C++: #include "vt_user.h"
% vtcc
-DVTRACE_PTHREAD hello.c -o hello
Calls to functions which reside in external libraries can be intercepted by implementing identical functions and linking them before the external library. Such ``wrapper functions'' can record the parameters and return values of the library functions.
If VampirTrace has been built with I/O tracing support, it uses this technique for recording calls to I/O functions of the standard C library, which are executed by the application. The following functions are intercepted by VampirTrace:
close | creat | creat64 | dup |
dup2 | fclose | fcntl | fdopen |
fgetc | fgets | flockfile | fopen |
fopen64 | fprintf | fputc | fputs |
fread | fscanf | fseek | fseeko |
fseeko64 | fsetpos | fsetpos64 | ftrylockfile |
funlockfile | fwrite | getc | gets |
lockf | lseek | lseek64 | open |
open64 | pread | pread64 | putc |
puts | pwrite | pwrite64 | read |
readv | rewind | unlink | write |
writev |
The gathered information will be saved as I/O event records in the trace file. This feature has to be activated for each tracing run by setting the environment variable VT_IOTRACE to yes.
This works for both dynamically and statically linked executables. Note that when linking statically, a warning like the following may be issued: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking. This is ok as long as the mentioned libraries are available for running the application.
If you'd like to experiment with some other I/O library, set the environment variable VT_IOLIB_PATHNAME to the alternative one. Beware that this library must provide all I/O functions mentioned above otherwise VampirTrace will abort.
If VampirTrace has been built with LIBC trace support (⇒ Appendix A), it is capable of tracing programs which call functions from the LIBC exec family (execl, execlp, execle, execv, execvp, execve), system, and fork. VampirTrace records the call of the LIBC function to the trace. This feature works for sequential (i.e. no MPI or threaded parallelization) programs only. It works for both dynamically and statically linked executables. Note that when linking statically, a warning like the following may be issued: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking. This is ok as long as the mentioned libraries are available for running the application.
When VampirTrace detects a call of an exec function, the current trace file is closed before executing the new program. If the executed program is also instrumented with VampirTrace, it will create a different trace file. Note that VampirTrace aborts if the exec function returns unsuccessfully.
Calling fork in an instrumented program creates an additional process in the same trace file.
VampirTrace supports the recording of MPI correctness events, e.g., usage of invalid MPI requests. This is implemented by using the Universal MPI Correctness Interface (UniMCI), which provides an interface between tools like VampirTrace and existing runtime MPI correctness checking tools. Correctness events are stored as markers in the trace file and are visualized by Vampir.
If VampirTrace is built with UniMCI support, the user only has to enable MPI correctness checking. This is done by merely setting the environment variable VT_MPICHECK to yes. Further, if your application crashes due to an MPI error you should set VT_MPICHECK_ERREXIT to yes. This environmental variable forces VampirTrace to write its trace to disk and exit afterwards. As a result, the trace with the detected error is stored before the application might crash.
To install VampirTrace with correctness checking support it is necessary to have UniMCI installed on your system. UniMCI in turn requires you to have a supported MPI correctness checking tool installed, currently only the tool Marmot is known to have UniMCI support. So all in all you should use the following order to install with correctness checking support:
Information on how to install Marmot and UniMCI is given in their respective manuals. VampirTrace will automatically detect an UniMCI installation if the unimci-config tool is in path.
In addition to the manual instrumentation (⇒ Section 2.4.1), the VampirTrace API provides instrumentation calls which allow recording of program variable values (e.g. iteration counts, calculation results, ...) or any other numerical quantity. A user-defined counter is identified by its name, the counter group it belongs to, the type of its value (integer or floating-point) and the unit that the value is quoted (e.g. ``GFlop/sec'').
The VT_COUNT_GROUP_DEF and VT_COUNT_DEF instrumentation calls can be used to define counter groups and counters:
Fortran: #include "vt_user.inc" integer :: id, gid VT_COUNT_GROUP_DEF('name', gid) VT_COUNT_DEF('name', 'unit', type, gid, id)
C/C++: #include "vt_user.h" unsigned int id, gid; gid = VT_COUNT_GROUP_DEF("name"); id = VT_COUNT_DEF("name", "unit", type, gid);
The definition of a counter group is optional. If no special counter group is desired, the default group ``User'' can be used. In this case, set the parameter gid of VT_COUNT_DEF() to VT_COUNT_DEFGROUP.
The third parameter type of VT_COUNT_DEF specifies the data type of the counter value. To record a value for any of the defined counters the corresponding instrumentation call VT_COUNT_*_VAL must be invoked.
Fortran: | ||
---|---|---|
Type | Count call | Data type |
VT_COUNT_TYPE_INTEGER | VT_COUNT_INTEGER_VAL | integer (4 byte) |
VT_COUNT_TYPE_INTEGER8 | VT_COUNT_INTEGER8_VAL | integer (8 byte) |
VT_COUNT_TYPE_REAL | VT_COUNT_REAL_VAL | real |
VT_COUNT_TYPE_DOUBLE | VT_COUNT_DOUBLE_VAL | double precision |
C/C++: | ||
---|---|---|
Type | Count call | Data type |
VT_COUNT_TYPE_SIGNED | VT_COUNT_SIGNED_VAL | signed int (max. 64-bit) |
VT_COUNT_TYPE_UNSIGNED | VT_COUNT_UNSIGNED_VAL | unsigned int (max. 64-bit) |
VT_COUNT_TYPE_FLOAT | VT_COUNT_FLOAT_VAL | float |
VT_COUNT_TYPE_DOUBLE | VT_COUNT_DOUBLE_VAL | double |
The following example records the loop index i:
Fortran: #include "vt_user.inc" program main integer :: i, cid, cgid VT_COUNT_GROUP_DEF('loopindex', cgid) VT_COUNT_DEF('i', '#', VT_COUNT_TYPE_INTEGER, cgid, cid) do i=1,100 VT_COUNT_INTEGER_VAL(cid, i) end do end program main
C/C++: #include "vt_user.h" int main() { unsigned int i, cid, cgid; cgid = VT_COUNT_GROUP_DEF('loopindex'); cid = VT_COUNT_DEF("i", "#", VT_COUNT_TYPE_UNSIGNED, cgid); for( i = 1; i <= 100; i++ ) { VT_COUNT_UNSIGNED_VAL(cid, i); } return 0; }
For all three languages the instrumented sources have to be compiled with -DVTRACE. Otherwise the VT_* calls are ignored.
Optionally, if the sources contain further VampirTrace API calls and only the calls for user-defined counters shall be disabled, then the sources have to be compiled with -DVTRACE_NO_COUNT in addition to -DVTRACE.
In addition to the manual instrumentation (⇒ Section 2.4.1), the VampirTrace API provides instrumentation calls which allow recording of special user information, which can be used to better identify parts of interest. A user-defined marker is identified by its name and type.
Fortran: #include "vt_user.inc" integer :: mid VT_MARKER_DEF('name', type, mid) VT_MARKER(mid, 'text') C/C++: #include "vt_user.h" unsigned int mid; mid = VT_MARKER_DEF("name",type); VT_MARKER(mid, "text"); Types for Fortran/C/C++: VT_MARKER_TYPE_ERROR VT_MARKER_TYPE_WARNING VT_MARKER_TYPE_HINT
For all three languages the instrumented sources have to be compiled with -DVTRACE. Otherwise the VT_* calls are ignored.
Optionally, if the sources contain further VampirTrace API calls and only the calls for user-defined markers shall be disabled, then the sources have to be compiled with -DVTRACE_NO_MARKER in addition to -DVTRACE.
By default, all calls of instrumented functions will be traced, so that the resulting trace files can easily become very large. In order to decrease the size of a trace, VampirTrace allows the specification of filter directives before running an instrumented application. The user can decide on how often an instrumented function/region shall be recorded to a trace file. To use a filter, the environment variable VT_FILTER_SPEC needs to be defined. It should contain the path and name of a file with filter directives.
Here is an example of a file containing filter directives:
# VampirTrace region filter specification # # call limit definitions and region assignments # # syntax: <regions> -- <limit> # # regions semicolon-separated list of regions # (can be wildcards) # limit assigned call limit # 0 = region(s) denied # -1 = unlimited # add;sub;mul;div -- 1000 * -- 3000000
These region filter directives cause that the functions add, sub, mul and div be recorded at most 1000 times. The remaining functions * will be recorded at most 3000000 times.
Besides creating filter files manually, you can also use the vtfilter tool to generate them automatically. This tool reads a provided trace and decides whether a function should be filtered or not, based on the evaluation of certain parameters. For more information see Section B.4.
An experimental extension allows rank specific filtering. Use @ clauses to restrict all following filters to the given ranks. The rank selection must be given as a list of <from> - <to> pairs or single values.
@ 4 - 10, 20 - 29, 34 foo;bar -- 2000 * -- 0
The example defines two limits for the ranks 4 - 10, 20 - 29, and 34.
For Java tracing there are additional possibilities of filtering. Firstly, there is a default filter applied. The rules can be found in the filter file <vt-install>/etc/ vt-java-default-filter.spec. Secondly, user-defined filters can be applied additionally by setting VT_JAVA_FILTER_SPEC to a file containing the rules.
The syntax of the filter rules is as follows:
<method|thread> <include|exclude> <filter string[;fs]...>
Filtering can be done on thread names and method names, defined by the first parameter. The second parameter determines whether the matching item shall be included for tracing or excluded from it. Multiple filter strings on a line have to be separated by ; and may contain occurences of * for wildcard matching.
The user-supplied filter rules will be applied before the default filter and the first match counts so it is possible to include items that would be excluded by the default filter otherwise.
VampirTrace allows assigning functions/regions to a group. Groups can, for instance, be highlighted by different colors in Vampir displays. The following standard groups are created by VampirTrace:
Group name | Contained functions/regions |
---|---|
MPI | MPI functions |
OMP | OpenMP API function calls |
OMP_SYNC | OpenMP barriers |
OMP_PREG | OpenMP parallel regions |
Pthreads | Pthread API function calls |
MEM | Memory allocation functions (⇒ Section 4.3) |
I/O | I/O functions (⇒ Section 4.6) |
LIBC | LIBC fork/system/exec functions (⇒ Section 4.7) |
Application | remaining instrumented functions and source code regions |
Additionally, you can create your own groups, e.g., to better distinguish different phases of an application. To use function/region grouping set the environment variable VT_GROUPS_SPEC to the path of a file which contains the group assignments. Below, there is an example of how to use group assignments:
# VampirTrace region groups specification # # group definitions and region assignments # # syntax: <group>=<regions> # # group group name # regions semicolon-separated list of regions # (can be wildcards) # CALC=add;sub;mul;div USER=app_*
These group assignments associate the functions add, sub, mul and div with group ``CALC'', and all functions with the prefix app_ are associated with group ``USER''.
Building VampirTrace is typically a combination of running configure and make. Execute the following commands to install VampirTrace from the directory at the top of the tree:
% ./configure --prefix=/where/to/install [...lots of output...] % make all install
If you need special access for installing, you can execute make all as a user with write permissions in the build tree and a separate make install as a user with write permissions to the install tree.
However, for more details, also read the following instructions. Sometimes it might be necessary to provide ./configure with options, e.g., specifications of paths or compilers.
VampirTrace comes with example programs written in C, C++, and Fortran. They can be used to test different instrumentation types of the VampirTrace installation. You can find them in the directory examples of the VampirTrace package.
Note that you should compile VampirTrace with the same compiler you use for the application to trace, see D.1.
Some systems require unusual options for compiling or linking which the configure script does not know. Run ./configure -help for details on some of the pertinent environment variables.
You can pass initial values for configuration parameters to configure by setting variables in the command line or in the environment. Here is an example:
% ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
By default, make install will install the package's files in /usr/local/bin, /usr/local/include, etc. You can specify an installation prefix other than /usr/local by giving configure the option -prefix=PATH.
This a summary of the most important optional features. For a full list of all available features run ./configure -help.
This a summary of the most important optional features. For a full list of all available features run ./configure -help.
If you would like to use an external version of OTF library, set:
If the supplied OTF library was built without zlib support then OTFLIB will be set to -lotf.
If you have not specified the environment variable MPICC (MPI compiler command) use the following options to set the location of your MPI installation:
If your system does not have an MPI Fortran library set -enable-fmpi-lib (see above), otherwise set:
Use the following options to specify your MPI-implementation
To enable enhanced timer synchronization a LAPACK library with C wrapper support is needed:
To enable Java support the JVM Tool Interface (JVMTI) version 1.0 or higher is required:
To enable support for generating wrapper for 3th-Party libraries the C code parser CTool is needed:
Building VampirTrace on cross compilation platforms needs some special attention. The compiler wrappers and OPARI are built for the front-end (build system) whereas the VampirTrace libraries, vtdyn, vtunify, and vtfilter are built for the back-end (host system). Some configure options which are of interest for cross compilation are shown below:
% ./configure CC=sxcc CXX=sxc++ F77=sxf90 FC=sxf90 MPICC=sxmpicc AR=sxar RANLIB="sxar st" CXX_FOR_BUILD=c++ --host=sx6-nec-superux14.1 --with-cross-prefix=sx --with-otf-lib=-lotf
Add the bin subdirectory of the installation directory to your
$PATH environment variable. To use VampirTrace with Dyninst,
you will also need to add the lib subdirectory to your
LD_LIBRARY_PATH environment variable:
for csh and tcsh:
> setenv PATH <vt-install>/bin:$PATH > setenv LD_LIBRARY_PATH <vt-install>/lib:$LD_LIBRARY_PATHfor bash and sh:
% export PATH=<vt-install>/bin:$PATH % export LD_LIBRARY_PATH=<vt-install>/lib:$LD_LIBRARY_PATH
If you have checked out a developer's copy of VampirTrace (i.e. checked out from CVS), you should first run:
% ./bootstrap [--otf-package <package>] [--version <version>]Note that GNU Autoconf ≥2.60 and GNU Automake ≥1.9.6 are required. You can download them from http://www.gnu.org/software/autoconf and http://www.gnu.org/software/automake.
vtcc,vtcxx,vtf77,vtf90 - compiler wrappers for C, C++, Fortran 77, Fortran 90 Syntax: vt<cc|cxx|f77|f90> [-vt:<cc|cxx|f77|f90> <cmd>] [-vt:inst <insttype>] [-vt:<seq|mpi|mt|hyb>] [-vt:opari <args>] [-vt:verbose] [-vt:version] [-vt:show] ... options: -vt:help Show this help message. -vt:<cc|cxx|f77|f90> <cmd> Set the underlying compiler command. -vt:inst <insttype> Set the instrumentation type. possible values: compinst fully-automatic by compiler manual manual by using VampirTrace's API dyninst binary by using Dyninst (www.dyninst.org) -vt:opari <args> Set options for OPARI command. (see share/vampirtrace/doc/opari/Readme.html) -vt:<seq|mpi|mt|hyb> Force application's parallelization type. Necessary, if this cannot be determined by underlying compiler and flags. seq = sequential mpi = parallel (uses MPI) mt = parallel (uses OpenMP/POSIX threads) hyb = hybrid parallel (MPI + Threads) (default: automatically determining by underlying compiler and flags) -vt:verbose Enable verbose mode. -vt:show Do not invoke the underlying compiler. Instead, show the command line that would be executed to compile and link the program. See the man page for your underlying compiler for other options that can be passed through 'vt<cc|cxx|f77|f90>'. Environment variables: VT_INST Equivalent to '-vt:inst' VT_CC Equivalent to '-vt:cc ' VT_CXX Equivalent to '-vt:cxx ' VT_F77 Equivalent to '-vt:f77' VT_F90 Equivalent to '-vt:f90' VT_CFLAGS C compiler flags VT_CXXFLAGS C++ compiler flags VT_F77FLAGS Fortran 77 compiler flags VT_FCFLAGS Fortran 90 compiler flags VT_LDFLAGS Linker flags VT_LIBS Libraries to pass to the linker The corresponding command line options overwrite the environment variables setting. Examples: automatically instrumentation by compiler: vtcc -vt:cc gcc -vt:inst compinst -c foo.c -o foo.o vtcc -vt:cc gcc -vt:inst compinst -c bar.c -o bar.o vtcc -vt:cc gcc -vt:inst compinst foo.o bar.o -o foo manually instrumentation by using VT's API: vtf90 -vt:inst manual foobar.F90 -o foobar -DVTRACE IMPORTANT: Fortran source files instrumented by VT's API have to be preprocessed by CPP.
vtunify[-mpi] - local trace unifier for VampirTrace. Syntax: vtunify[-mpi] <#files> <iprefix> [options...] Options: -h, --help Show this help message. #files Number of local trace files. (equal to # of '*.uctl' files) iprefix Prefix of input trace filename. -o <oprefix> Prefix of output trace filename. -s <statsofile> Statistics output filename. default=<oprefix>.stats -c, --nocompress Don't compress output trace files. -k, --keeplocal Don't remove input trace files. -p, --progress Show progress. -q, --quiet Enable quiet mode. (only emergency output) -v, --verbose Increase output verbosity. (can be used more than once)
vtdyn - Dyninst Mutator for VampirTrace. Syntax: vtdyn [-v|--verbose] [-s|--shlib <shlib>[,...]] [-b|--blacklist <bfile> [-p|--pid <pid>] <app> [appargs ...] Options: -h, --help Show this help message. -v, --verbose Enable verbose mode. -s, --shlib Comma-separated list of shared libraries <shlib>[,...] which should also be instrumented. -b, --blacklist Set path of blacklist file containing <bfile> a newline-separated list of functions which should not be instrumented. -p, --pid <pid> application's process id (attaches the mutator to a running process) app path of application executable appargs application's arguments
vtfilter - filter generator for VampirTrace. Syntax: Filter a trace file using an already existing filter file: vtfilter -filt [filt-options] <input trace file> Generate a filter: vtfilter -gen [gen-options] <input trace file> general options: -h, --help show this help message -p show progress filt-options: -to <file> output trace file name -fi <file> input filter file name -z <zlevel> Set the compression level. Level reaches from 0 to 9 where 0 is no compression and 9 is the highest level. Standard is 4. -f <n> Set max number of file handles available. Standard is 256. gen-options: -fo <file> output filter file name -r <n> Reduce the trace size to <n> percent of the original size. The program relies on the fact that the major part of the trace are function calls. The approximation of size will get worse with a rising percentage of communication and other non function calling or performance counter records. -l <n> Limit the number of accepted function calls for filtered functions to <n>. Standard is 0. -ex <f>,<f>,... Exclude certain symbols from filtering. A symbol may contain wildcards. -in <f>,<f>,... Force to include certain symbols into the filter. A symbol may contain wildcards. -inc Automatically include children of included functions as well into the filter. -stats Prints out the desired and the expected percentage of file size. environment variables: TRACEFILTER_EXCLUDEFILE Specifies a file containing a list of symbols not to be filtered. The list of members can be seperated by space, comma, tab, newline and may contain wildcards. TRACEFILTER_INCLUDEFILE Specifies a file containing a list of symbols to be filtered.
vtlibwrapgen - library wrapper generator for VampirTrace. Syntax: Generate a library wrapper source file: vtlibwrapgen [gen-options] <input header file> [input header file...] Build a wrapper library from a generated source file: vtlibwrapgen --build [build-options] <input lib. wrapper source file> options: --gen Generate a library wrapper source file. (default) See 'gen-options' below for valid options. --build Build a wrapper library from a generated source file. See 'build-options' below for valid options. -q, --quiet Enable quiet mode. (only emergency output) -v, --verbose Increase output verbosity. (can be used more than once) -h, --help Show this help message. gen-options: -o, --output=FILE Pathname of output wrapper source file. (default: wrap.c) -l, --shlib=SHLIB Pathname of shared library that contains the actual library functions. (can be used more then once) -f, --filter=FILE Pathname of input filter file. -g, --group=NAME Separate function group name for wrapped functions. -s, --sysheader=FILE Header file to be included additionally. --nocpp Don't use preprocessor. --keepcppfile Don't remove preprocessed header files. --cpp=CPP C preprocessor command (default: gcc -E) --cppflags=CPPFLAGS C preprocessor flags, e.g. -I<include dir> --cppdir=DIR Change to this preprocessing directory. environment variables: VT_CPP C preprocessor command (equivalent to '--cpp') VT_CPPFLAGS C preprocessor flags (equivalent to '--cppflags') build-options: -o, --output=PREFIX Prefix of output wrapper library. (default: libwrap) --shared Do only build shared wrapper library. --static Do only build static wrapper library. --libtool=LT Libtool command --cc=CC C compiler command (default: gcc) --cflags=CFLAGS C compiler flags --ld=LD linker command (default: CC) --ldflags=LDFLAGS linker flags, e.g. -L<lib dir> (default: CFLAGS) --libs=LIBS libraries to pass to the linker, e.g. -l<library> environment variables: VT_CC C compiler command (equivalent to '--cc') VT_CFLAGS C compiler flags (equivalent to '--cflags') VT_LD linker command (equivalent to '--ld') VT_LDFLAGS linker flags (equivalent to '--ldflags') VT_LIBS libraries to pass to the linker (equivalent to '--libs') examples: Generating wrapper library 'libm_wrap' for the Math library 'libm.so': vtlibwrapgen -l libm.so -g MATH -o mwrap.c /usr/include/math.h vtlibwrapgen --build -o libm_wrap mwrap.c export LD_PRELOAD=$PWD/libm_wrap.so:libvt.so
Available counter names can be queried with the PAPI commands papi_avail and papi_native_avail. Depending on the hardware there are limitations in the combination of different counters. To check whether your choice works properly, use the command papi_event_chooser.
PAPI_L[1|2|3]_[D|I|T]C[M|H|A|R|W] Level 1/2/3 data/instruction/total cache misses/hits/accesses/reads/writes PAPI_L[1|2|3]_[LD|ST]M Level 1/2/3 load/store misses PAPI_CA_SNP Requests for a snoop PAPI_CA_SHR Requests for exclusive access to shared cache line PAPI_CA_CLN Requests for exclusive access to clean cache line PAPI_CA_INV Requests for cache line invalidation PAPI_CA_ITV Requests for cache line intervention PAPI_BRU_IDL Cycles branch units are idle PAPI_FXU_IDL Cycles integer units are idle PAPI_FPU_IDL Cycles floating point units are idle PAPI_LSU_IDL Cycles load/store units are idle PAPI_TLB_DM Data translation lookaside buffer misses PAPI_TLB_IM Instruction translation lookaside buffer misses PAPI_TLB_TL Total translation lookaside buffer misses PAPI_BTAC_M Branch target address cache misses PAPI_PRF_DM Data prefetch cache misses PAPI_TLB_SD Translation lookaside buffer shootdowns PAPI_CSR_FAL Failed store conditional instructions PAPI_CSR_SUC Successful store conditional instructions PAPI_CSR_TOT Total store conditional instructions PAPI_MEM_SCY Cycles Stalled Waiting for memory accesses PAPI_MEM_RCY Cycles Stalled Waiting for memory Reads PAPI_MEM_WCY Cycles Stalled Waiting for memory writes PAPI_STL_ICY Cycles with no instruction issue PAPI_FUL_ICY Cycles with maximum instruction issue PAPI_STL_CCY Cycles with no instructions completed PAPI_FUL_CCY Cycles with maximum instructions completed PAPI_BR_UCN Unconditional branch instructions PAPI_BR_CN Conditional branch instructions PAPI_BR_TKN Conditional branch instructions taken PAPI_BR_NTK Conditional branch instructions not taken PAPI_BR_MSP Conditional branch instructions mispredicted PAPI_BR_PRC Conditional branch instructions correctly predicted PAPI_FMA_INS FMA instructions completed PAPI_TOT_IIS Instructions issued PAPI_TOT_INS Instructions completed PAPI_INT_INS Integer instructions PAPI_FP_INS Floating point instructions PAPI_LD_INS Load instructions PAPI_SR_INS Store instructions PAPI_BR_INS Branch instructions PAPI_VEC_INS Vector/SIMD instructions PAPI_LST_INS Load/store instructions completed PAPI_SYC_INS Synchronization instructions completed PAPI_FML_INS Floating point multiply instructions PAPI_FAD_INS Floating point add instructions PAPI_FDV_INS Floating point divide instructions PAPI_FSQ_INS Floating point square root instructions PAPI_FNV_INS Floating point inverse instructions PAPI_RES_STL Cycles stalled on any resource PAPI_FP_STAL Cycles the FP unit(s) are stalled PAPI_FP_OPS Floating point operations PAPI_TOT_CYC Total cycles PAPI_HW_INT Hardware interrupts
Available counter names can be queried with the VampirTrace tool vtcpcavail. In addition to the counter names, it shows how many performance counters can be queried at a time. See below for a sample output.
% ./vtcpcavail CPU performance counter interface: UltraSPARC T2 Number of concurrently readable performance counters on the CPU: 2 Available events: AES_busy_cycle AES_op Atomics Br_completed Br_taken CPU_ifetch_to_PCX CPU_ld_to_PCX CPU_st_to_PCX CRC_MPA_cksum CRC_TCPIP_cksum DC_miss DES_3DES_busy_cycle DES_3DES_op DTLB_HWTW_miss_L2 DTLB_HWTW_ref_L2 DTLB_miss IC_miss ITLB_HWTW_miss_L2 ITLB_HWTW_ref_L2 ITLB_miss Idle_strands Instr_FGU_arithmetic Instr_cnt Instr_ld Instr_other Instr_st Instr_sw L2_dmiss_ld L2_imiss MA_busy_cycle MA_op MD5_SHA-1_SHA-256_busy_cycle MD5_SHA-1_SHA-256_op MMU_ld_to_PCX RC4_busy_cycle RC4_op Stream_ld_to_PCX Stream_st_to_PCX TLB_miss See the "UltraSPARC T2 User's Manual" for descriptions of these events. Documentation for Sun processors can be found at: http://www.sun.com/processors/manuals
SX_CTR_STM System timer reg SX_CTR_USRCC User clock counter SX_CTR_EX Execution counter SX_CTR_VX Vector execution counter SX_CTR_VE Vector element counter SX_CTR_VECC Vector execution clock counter SX_CTR_VAREC Vector arithmetic execution clock counter SX_CTR_VLDEC Vector load execution clock counter SX_CTR_FPEC Floating point data execution counter SX_CTR_BCCC Bank conflict clock counter SX_CTR_ICMCC Instruction cache miss clock counter SX_CTR_OCMCC Operand cache miss clock counter SX_CTR_IPHCC Instruction pipeline hold clock counter SX_CTR_MNCCC Memory network conflict clock counter SX_CTR_SRACC Shared resource access clock counter SX_CTR_BREC Branch execution counter SX_CTR_BPFC Branch prediction failure counter
The list of resource usage counters can also be found in the manual page of getrusage. Note that, depending on the operating system, not all fields may be maintained. The fields supported by the Linux 2.6 kernel are shown in the table.
Name | Unit | Linux | Description |
---|---|---|---|
ru_utime | ms | x | Total amount of user time used. |
ru_stime | ms | x | Total amount of system time used. |
ru_maxrss | kB | Maximum resident set size. | |
ru_ixrss | kB × s | Integral shared memory size (text segment) over the runtime. | |
ru_idrss | kB × s | Integral data segment memory used over the runtime. | |
ru_isrss | kB × s | Integral stack memory used over the runtime. | |
ru_minflt | # | x | Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation). |
ru_majflt | # | x | Number of hard page faults (i.e. those that required I/O). |
ru_nswap | # | Number of times a process was swapped out of physical memory. | |
ru_inblock | # | Number of input operations via the file system. Note: This and ru_oublock do not include operations with the cache. | |
ru_oublock | # | Number of output operations via the file system. | |
ru_msgsnd | # | Number of IPC messages sent. | |
ru_msgrcv | # | Number of IPC messages received. | |
ru_nsignals | # | Number of signals delivered. | |
ru_nvcsw | # | x | Number of voluntary context switches, i.e. because the process gave up the processor before it had to (usually to wait for some resource to be available). |
ru_nivcsw | # | x | Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice. |
There are several limitations which make this generally a bad idea:
If subroutines have been instrumented with automatic instrumentation by GNU, Intel, or PathScale compilers, VampirTrace needs to look-up the function names and their source code line before program start. In certain cases, this may take very long. To accelerate this process prepare a file with symbol information using the command nm as explained in Section 2.3 and set VT_GNU_NMFILE to the pathname of this file. This method prevents VampirTrace from getting the function names from the binary.
Functions that reside in shared libraries (*.so) cannot be traced with the GNU backend of VampirTrace. This affects GNU GCC, Intel and PathScale compilers. Tracing of functions in shared libraries works for the PGI compiler. The workaround for tracing such functions is building a static binary.
vtunify is an OpenMP parallel application that operates on all local traces and produces the final OTF trace. Normally, it is called automatically by VampirTrace after the actual application has run to completion. vtunify opens as many threads as specified by the OMP_NUM_THREADS environment variable. If the variable is not set, it uses only a single thread, so one should set OMP_NUM_THREADS also for applications that normally do not use OpenMP.
To speed up trace unification, one can disable automatic trace unification by setting the environment variable VT_UNIFY to no and manually unify the trace described in section 3.5.
The absence of an *.otf file usually means that the trace was not unified. This is the case on certain platforms, e.g. when using DYNINST or when the local traces are not available when the application ends and VampirTrace performs trace unification.
In those cases, *.uctl files can be found in the directory of the trace file and the user needs to perform trace unification manually. See Sections 3.5 and B.2 to learn more about using vtunify.
Starting and stopping tracing by using the VT_ON/VT_OFF calls is considered advanced usage of VampirTrace and should be performed with care. When restarting the recording of events, the call stack of the application has to have the same depth as when stopping the recording. For example, this can be ensured by calling VT_OFF and VT_ON in the same function.
In addition, stopping tracing while waiting for MPI messages can cause those MPI messages not to be recorded in the trace. This can cause problems when analyzing the OTF trace afterwards, e.g., with Vampir.
For unique naming of multiple trace files in the same directory, a file *.lock is created and locked for exclusive access if VT_FILE_UNIQUE is set to yes (⇒ Section 3.1). Some file systems do not implement file locking. In this case, VampirTrace still tries to name the trace files uniquely, but this may fail in certain cases. Alternatively, you can manually control the unique file naming by setting VT_FILE_UNIQUE to a different numerical ID for each program run.
VampirTrace hard-codes some directory paths in its executables and libraries based on installation paths specified by the configure script. However, it's possible to move an existing VampirTrace installation to another location and use it without re-build from source. Therefore it's necessary to set the environment variable VT_PREFIX to the new installation prefix before using VampirTrace's Compiler Wrappers (⇒ Section 2.1) or launching an instrumented application. For example:
./configure --prefix=/opt/vampirtrace make install mv /opt/vampirtrace $HOME/vampirtrace export VT_PREFIX=$HOME/vampirtrace
You may contact us at mailto:vampirsupport@zih.tu-dresden.devampirsupport@zih.tu-dresden.de for support on installing and using VampirTrace.
Suggestions are always welcome (contact: mailto:vampirsupport@zih.tu-dresden.devampirsupport@zih.tu-dresden.de) but there is a chance that we can not implement all your wishes as our resources are limited.
Anyways, the source code of VampirTrace is open to everybody so you may implement support for new stuff yourself. If you provide us with your additions afterwards we will consider merging them into the official VampirTrace package.