EZTrace
 

Analyzing a custom application with EZTrace

Installing EZTrace

First, configure EZTrace as described in the support page. Make sure that either libelf (on Debian-based systems: install package libelf-dev) or libbfd (on Debian-based systems: install package binutils-dev)is installed on your system.
$ ./configure --prefix=<INSTALLATION_DIR>

If everything is OK, compile and install EZTrace:
$ make &&make install

If everything went well, you should see a program named eztrace in <INSTALLATION_DIR>/bin.

Creating an EZTrace plugin

Let's analyze this FFT application[1]. First, compile it:
$ tar xzvf fft_serial.tgz
[...]
$ make

You can run the application with:

$ ./fft_serial
[...]

FFT_SERIAL
  C version

  Demonstrate an implementation of the Fast Fourier Transform
  of a complex data vector.

  Accuracy check:

    FFT ( FFT ( X(1:N) ) ) == N * X(1:N)

             N      NITS    Error         Time          Time/Call     MFLOPS

          1024         1  2.439019e-16  6.040000e-04  3.020000e-04    186.490066

FFT_SERIAL:
  Normal end of execution.


In order to analyze precisely this application, we need to create a new plugin in charge of tracing this application functions. This can be done automatically using eztrace_plugin_generator:

$ eztrace_plugin_generator fft_serial
Creating the plugin script fft_serial.tpl
        Found 'void ccopy (int n, double x[], double y[])'
        Found 'void cfft2 (int n, double x[], double y[], double w[], double sgn)'
        Found 'void cffti (int n, double w[])'
        Found 'double cpu_time (void)'
        Found 'double ggl (double *seed)'
        Found 'void step (int n, int mj, double a[], double b[], double c[], double d[], double w[], double sgn)'
        Found 'void timestamp (void)'
7 symbols found

Generating the plugin...
        $ eztrace_create_plugin -o plugin_fft_serial fft_serial.tpl

Compiling the plugin...
        $ make -C plugin_fft_serial

You can now use the generated plugin by setting the following environment variables:
        $ export EZTRACE_LIBRARY_PATH=$EZTRACE_LIBRARY_PATH:/tmp/fft_serial/plugin_fft_serial

This command runs the following steps:

Using the EZTrace plugin

Once the plugin is properly compiled, you need to tell EZTrace where to find it:

$ export EZTRACE_LIBRARY_PATH=$EZTRACE_LIBRARY_PATH:/tmp/fft_serial/plugin_fft_serial

$ eztrace_avail
3       stdio   Module for stdio functions (read, write, select, poll, etc.)
2       pthread Module for PThread synchronization functions (mutex, semaphore, spinlock, etc.)
6       papi    Module for PAPI Performance counters
1       omp     Module for OpenMP parallel regions
4       mpi     Module for MPI functions
5       memory  Module for memory functions (malloc, free, etc.)
153     fft_serial      Module for the fft_serial program

You can now use the plugin to analyze the application:

$ eztrace -t fft_serial ./fft_serial
Starting EZTrace... done
30 June 2014 12:38:48 PM

FFT_SERIAL
  C version

  Demonstrate an implementation of the Fast Fourier Transform
  of a complex data vector.

  Accuracy check:

    FFT ( FFT ( X(1:N) ) ) == N * X(1:N)

             N      NITS    Error         Time          Time/Call     MFLOPS

          1024         1  2.439019e-16  6.210000e-04  3.105000e-04    181.384863

FFT_SERIAL:
  Normal end of execution.

30 June 2014 12:38:48 PM
Stopping EZTrace... saving trace  /tmp/<USERNAME>_eztrace_log_rank_1


This should generate a trace file in /tmp/${USER}_eztrace_log_rank_1.

Analyzing the execution of the application

Once the execution traces are generated, we need to analyze them. EZTrace allows to generate a PAJE/OTF trace file that can be visualized with tools such as ViTE or Vampir.
Visualizing an execution trace
In order to generate a PAJE/OTF trace file that can be visualized with ViTE or Vampir, you need to run eztrace_convert:

$ eztrace_convert /tmp/${USER}_eztrace_log_rank_1
module stdio loaded
module pthread loaded
module papi loaded
module omp loaded
module mpi loaded
module memory loaded
module fft_serial loaded
7 modules loaded
no more block for trace #0
4205 events handled


This generates a file named eztrace_output.trace that you can visualize with ViTE:
$ vite eztrace_output.trace




[1] The FFT application is based on John Burkardt implementation.

This tutorial was designed for EZTrace 1.0 or higher. If you encounter any problem, feel free to contact EZTrace developpers.