Coder Social home page Coder Social logo

pcm-graph's Introduction

pcm-graph

Tool that plots graphs from the CSV output of Intel PCM (Processor Counter Monitor)

Requirements

This script has been tested with Python 2.7, but should also work with Python 3.

The matplotlib library is required. Either install it with pip install matplotlib or use the requirements.txt file in this repository:

pip install -r requirements.txt

Usage

You can generate CSV output with the Intel PCM tool like so:

sudo ./pcm.x -csv=results.csv -- ./my_benchmark

This CSV file can then be plotted with this tool like this:

./pcm_graph.py -o output.png results.csv

The file extension of the output file will determine the file type. So if you want to generate a PDF, simply use something like output.pdf.

Further command line arguments can be inquired with ./pcm_graph.py --help:

usage: pcm_graph.py [-h] [-o OUTPUT] [-n NODES] [-p] [-q] [-s STYLE] [-t TITLE] input

positional arguments:
  input                 Path to the CSV file that contains the PCM results

optional arguments:
  -h, --help            show this help message and exit

  -o OUTPUT, --output OUTPUT
                        Path to output file. Defaults to %input%.png

  -n NODES, --nodes NODES
                        List of nodes to plot (e.g., 0,1,2,3)

  -p, --percentages     Use the percentage values for traffic instead of absolute values

  -q, --separate-qpi    Plot traffic for all QPI links separately

  -s STYLE, --style STYLE
                        Define a custom matplotlib style to use, see `matplotlib.style`

  -t TITLE, --title TITLE
                        Title of the figure

Styling

If you would like to customize the style of the output plot, I would recommand using the --style parameter with a matplotlib stylesheet.

For example, create a style sheet named custom.mplstyle with the following content:

figure.figsize : 10, 4
xtick.labelsize : 16
ytick.labelsize : 16

And this style sheet can then be invoked with --style:

./pcm_graph.py results.csv --style=custom.mplstyle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.