Intel® Trace Analyzer 9.1 Update 2 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 trace files for applications that pass correctness 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 with 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 and Collector contains 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 a simulator library with doubled duration of all MPI events.
Makefile - is a makefile for Linux* gmake.
Makefile_win - is a makefile for Windows* nmake.
Build a simulator library as follows:
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 line to change the compiler:
SIMCOMP = icc
To build the examples of simulator libraries, use the following commands:
make devsim to build the simplest library
make doublesim to build the library with doubled duration 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 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 of a particular trace file
If you change the file, you will not be able to plug a simulator into the API.
You can create your simulator by filling virtual functions in h_devsim.cpp (or your .cpp file, if you renamed it).
Examples
In this example, duration of all non-blocking sending MPI events in trace file becomes zero time.
virtual void ProcessNonBlockingSend( FuncEventInfo * _event_, P2PInfo * _message_ ) { _event_->_endTime = _event_->_startTime; }
In this example, duration of all collective operations is 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.
A simulator stores all time values in ticks. To convert ticks to seconds, use the _clockResolution coefficient.
When you have trouble with trace file, run it through the Intel Trace Analyzer and Collector correctness checker before filling a bug report.