Intel® Trace Analyzer 9.1 Update 1 User and Reference Guide
The Custom Plug-in Framework (CPF) enables you to write your own simulators using the provided API. For example, Ideal Interconnect Simulator (IIS) is implemented using this framework. Custom developed simulators can interact with trace files from the Intel® Trace Analyzer and can model any condition you can think of.
CPF implementation works with traces that were obtained from applications that pass correctly message checking. To use CPF, install Intel® compilers on the systems where you are building your simulator and where you are running CPF.
Use the CLI option --icpf to process your trace files through a specific simulator library. You can use the following command line:
$ traceanalyzer --cli --icpf [options] <tracefile> --simulator <simulator library>
where <tracefile> is the name of your trace file, <simulator library> is the name of your simulator.
Intel® Trace Analyzer includes examples of the simulator. You can customize the examples of the simulator library to create your own simulator.
The examples are located in: <trace_analyzer_install_dir>/examples/icpf
Use the following files in this directory:
h_devsim.cpp - is the simplest template for developing your own simulator.
h_doublesim.cpp - is an example of simulator library with doubled durations of all MPI events.
Makefile - is a makefile for Linux* gmake.
Makefile_win - is a makefile for Windows* nmake.
To build a simulator library, do the following:
Set up your development environment. If you use a non Intel® compiler, modify the Makefile for Linux* OS or Makefile_win for Windows* OS in the simulator development directory. To modify a Makefile, open the Makefile with any text editor and edit the following lines to change the compiler:
Makefile:
SIMCOMP = icc
To build the examples of simulator libraries, you can use the following commands:
make devsim to build the simplest library
make doublesim to build the library with doubled durations of all MPI events
make or make all to build both libraries
Before beginning simulator development, you need to understand the virtual class that is inherited by a simulator.
The CustomPluginFramework.h header file connects between the Intel Trace Analyzer source and other tools such as simulators. This file contains the following information:
data structures that are passed to the API
public virtual functions that are called by CPF
private functions that can be called by any simulator help/aid with simulator development
private members that provide a simulator with access to certain aspects about a particular trace
If you change the file, you will not be able to plug a simulator into the API.
You can create your simulator filling virtual functions in h_devsim.cpp (or your .cpp file if you have renamed it).
Examples
In this example, durations of all non-blocking sending MPI events in trace file become zero time.
virtual void ProcessNonBlockingSend( FuncEventInfo * _event_, P2PInfo * _message_ )
{
_event_->_endTime = _event_->_startTime;
}
In this example, durations of all collective operations are doubled.
virtual void ProcessCollOp( CollOpInfo * _collop_ )
{
//Traverse vector of CollOpInfo
for( U4 k = 0; k < _collop_->_threads->count(); k++)
{
(*(_collop_->_threads))[k]->_endTime += ( (*(_collop_->_threads))[k]->_endTime - (*(_collop_->_threads))[k]->_startTime );
}
}
If you need to add more inline functions for your simulator, add them only to h_devsim.cpp or your .cpp file. Do not modify the h_custompluginframework.h header file.
When modifying end time, ensure that the end time you change is never less than the start time.
All values of time are stored in a simulator in ticks instead of in seconds. To convert ticks in seconds, use _clockResolution coefficient.
When you have trouble with trace, it is suggested that you run the trace through Intel Trace Analyzer and Collector message checker before filling a bug report.