PAPI

Introduction

Performance Application Programming Interface PAPI was designed to be a portable and efficient API to access the performance counters available on modern processors. These counters can provide insight to performance engineers about improvements that can be make in their code. As performance metrics can have different definitions and different programming interfaces across platforms, PAPI attempts:

  • To present a set of standard definitions for performance metrics on all platforms
  • To provide a standardized API among users, vendors, and academics

This package provides access to the functionality of libPAPI, but also builds more high-level functions on top of it. Its goal is to implement useful primitives that developers can easily understand and use. For example,

using PAPI
f() = sum(sin, -1:.1:1)
@profile f()
EventValues:
  BR_INS = 452 # 14.0% of all instructions # 127.0 M/sec 
  BR_MSP = 95 # 21.0% of all branches
  TOT_INS = 3280 # 0.152 insn per cycle
  TOT_CYC = 21600 # 6.064 Ghz # 6.585 cycles per insn
  runtime = 3562 nsecs

See the Index for the complete list of documented functions and types.

Prerequisites

The package depends on libPAPI which can either be installed on the system (recommended) or from PAPI_jll (default) which is available from (https://github.com/tomhaber/PAPI_jll.jl).

To install PAPI_jll, you'll need to run

import Pkg; Pkg.add("https://github.com/tomhaber/PAPI_jll.jl")

To use the system's libPAPI, you'll need to build PAPI.jl as follows

JULIA_PAPI_BINARY=system julia -e 'import Pkg; Pkg.build()'

This will try to locate libPAPI on the system. Additional hint can be given using: JULIA_PAPI_LIBRARY and JULIA_PAPI_PATH environment variables.

To install libPAPI on Debian/Ubuntu, you'll need to run

sudo apt-get install libpapi-dev

Manual Outline

Library Outline

Index

Contributing

Contributions are encouraged. In particular, PAPI provides many components, configurable at compilation time, while counters can be accessed through the native API by name, this can be cumbersome, low-level and ill-documented.

If there are additional functions you would like to use, please open an issue or pull request.

Additional examples and documentation improvements are also very welcome.