benchbuild.likwid module

Likwid helper functions.

Extract information from likwid’s CSV output.

benchbuild.likwid.fetch_cols(fstream, split_char=', ')[source]

Fetch columns from likwid’s output stream.

Parameters:
  • fstream – The filestream with likwid’s output.
  • split_car (str) – The character we split on, default ‘,’
Returns (list(str)):
A list containing the elements of fstream, after splitting at split_char.
benchbuild.likwid.get_measurements(region, core_info, data, extra_offset=0)[source]

Get the complete measurement info from likwid’s region info.

Parameters:
  • region – The region we took a measurement in.
  • core_info – The core information.
  • data – The raw data.
  • extra_offset (int) – default = 0
Returns (list((region, metric, core, value))):
A list of measurement tuples, a tuple contains the information about the region, the metric, the core and the actual value.
benchbuild.likwid.perfcounters(infile)[source]

Get a complete list of all measurements.

Parameters:infile – The filestream containing all likwid output.
Returns:A list of all measurements extracted from likwid’s file stream.
benchbuild.likwid.read_struct(fstream)[source]

Read a likwid struct from the text stream.

Parameters:fstream – Likwid’s filestream.
Returns (dict(str: str)):
A dict containing all likwid’s struct info as key/value pairs.
benchbuild.likwid.read_structs(fstream)[source]

Read all structs from likwid’s file stream.

Parameters:fstream – Likwid’s output file stream.
Returns:A generator that can be used to iterate over all structs in the fstream.
benchbuild.likwid.read_table(fstream)[source]

Read a likwid table info from the text stream.

Parameters:fstream – Likwid’s filestream.
Returns (dict(str: str)):
A dict containing likwid’s table info as key/value pairs.
benchbuild.likwid.read_tables(fstream)[source]

Read all tables from likwid’s file stream.

Parameters:fstream – Likwid’s output file stream.
Returns:A generator that can be used to iterate over all tables in the fstream.