Custom Search

Add new comment

First steps with HPCToolkit

Enjoy this short guide of how I have installed and used HPCToolkit.

Before installing HPCToolkit we must ensure that we have installed in advance PAPI in order to hace access to the Hardware counters.

Setting up HPCToolkit

The installation of HPCToolkit involves 3 packages that can be downloaded from:

  1. Externals

    To begin with, we must set up HPCToolkit externals, giving the path of the MPI version we will use (if MPI is needed).
    So, the configure command may be:

    $ ./configure --prefix=/home/siserte/soft/hpctoolkit-externals-install/ --with-mpi=/state/partition1/soft/gnu/mpich-3.2/

    You'd better compile with the -j<number of processors> option because it takes a while. Hence:

    $ make -j12 && make -j12 install

  2. HPCToolkit

    To install the tool itself, I have used this configure command, where apart from giving the path of the externals, MPI and the installation path, I point out the path of the PAPI installation:

    $ ./configure --prefix=/home/siserte/soft/hpctoolkit-install/ --with-papi=/home/siserte/soft/papi-install/ --with-mpi=/state/partition1/soft/gnu/mpich-3.2/ --with-externals=/home/siserte/soft/hpctoolkit-externals-install/

    Then again, we must compile the code:

    $ make -j12 && make -j12 install

  3. HPCViewer & HPCTraceViewer

    I decided to install the viewers in a remote machine, so I only needed to unpack the packages in the desired location. More info can be found:

Counting cache misses

I will enumerate the steps I took:

  1. $ hpcstruct ./exec
  2. $ mpiexec -n 20 hpcrun --event PAPI_L2_TCM@10000 --event PAPI_L2_DCA@10000 ./exec
  3. $ hpcprof -S exec.hpcstruct -I ./'*' hpctoolkit-exec-measurements
  4. $ hpcviewer hpctoolkit-exec-database

The last step will open a window with information and the amount of L2 cache misses (PAPI_L2_TCM) and L2 cache addresses (PAPI_L2_DCA).

Tracing an execution

To visualize a trace of our execution, we should follow the previous steps, changing some parameter, though:

  1. $ hpcstruct ./exec
  2. $ mpiexec -n 20 hpcrun -t ./exec
  3. $ hpcprof -S exec.hpcstruct -I ./'*' hpctoolkit-exec-measurements
  4. $ hpctraceviewer hpctoolkit-exec-database

You'll realise that we have replaced the --event for the parameter -t when launching the application.
Finally, remember to use the tool hpctraceviewer, instead of hpcviewer as in the previous example.