LIKWID-BENCH(1)

✨ likwid-bench β€” the manual page but make it a group chat ✨

okay so bestie, welcome to likwid-bench(1) πŸ’– this is a General Commands Manual entry and it's literally the low-level benchmark suite and microbenchmarking framework. no cap. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

likwid-bench β€” low-level benchmark suite and microbenchmarking framework. yes that's the whole vibe. it benchmarks. at a low level. slay.


🌸 SYNOPSIS 🌸

likwid-bench [-hap] [-t <testname>] [-s <min_time>] [-w
<workgroup_expression>] [-W <workgroup_expression_short>] [-l
<testname>] [-d <delimiter>] [-i <iterations>] [-f <filepath>]

copy it exactly, bestie, it's giving exact and we don't improvise πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So likwid-bench is a benchmark suite for low-level (assembly) benchmarks, and its whole job is measuring bandwidths and instruction throughput for specific instruction code on x86 systems. iconic behavior honestly.

The benchmark codes that come included rn cover common data access patterns like load and store, but also calculations like vector triad and sum. so it's not just moving bytes around, it's also doing math about it ✨

likwid-bench includes architecture-specific benchmarks for x86, x86_64 and x86 for Intel Xeon Phi coprocessors. and with LIKWID 5, ARM and POWER benchmarks are supported too β€” we love an inclusive queen πŸ‘‘

Now the performance values? They can either be calculated by likwid-bench itself, or measured using performance counters by using likwid-perfctr as a wrapper to likwid-bench. tiny catch: that requires you to build likwid-bench with instrumentation enabled in config.mk. no shortcuts, babes.

Benchmarks can be dynamically added when a proper ptt file is present at $HOME/.likwid/bench/<arch>/<testname>.ptt. The files are compiled to a .S file and compiled using either gcc, icc or pgcc (searched in $PATH). The default folder is /tmp/<PID>. Possible values for <arch> are 'x86', 'x86-64', 'phi', armv7', 'armv8' and 'power'. (yes, the quotes are messy in the original, we are not fixing them, we respect the source 😌)


πŸ’… OPTIONS πŸ’…

  • -h β€” prints a help message to standard output, then exits. the classic "help me" move, valid, respected.
  • -a β€” list available benchmark codes for the current system. window shopping but for benchmarks πŸ›οΈ
  • -p β€” list available thread domains. where can your threads even sit, bestie.
  • -s <min_time> β€” Run the benchmark for at least <min_time> seconds. The amount of iterations is determined using this value. Default: 1 second.
  • -t <testname> β€” Name of the benchmark code to run (mandatory). you literally cannot skip this one.
  • -w <workgroup_expression> β€” Specify the affinity domain, thread count and data set size for the current benchmarking run (-w or -W mandatory). First thread in thread domain initializes the stream.
  • -W <workgroup_expression_short> β€” Specify the affinity domain, thread count and data set size for the current benchmarking run (-w or -W mandatory). Each thread in the workgroup initializes its own chunk of the stream.
  • -l <testname> β€” list properties of a benchmark code. little info dump, we love to see it.
  • -i <iterations> β€” Set the number of iterations per thread (optional).
  • -f <filepath> β€” Filepath for the dynamic generation of benchmarks. Default /tmp/. <PID> is always attached.
ngl, -w and -W being mandatory while also not being in the [] brackets of the synopsis is peak mysterious energy, but that's what it says so that's what I'm telling you 🫢

🌈 WORKGROUP SYNTAX 🌈

okay this is the part where you lock in, bestie, because this syntax is doing the most:

<thread_domain>:<size> [:<num_threads>[:<chunk_size>:<stride>]]
[-<streamId>:<domain_id>]

with size in B, kB, MB, GB, kiB, MiB or GiB.

Let's break it down because we're not leaving anyone behind:

  • The <thread_domain> defines where the threads are placed.
  • <size> is the total data set size for the benchmark β€” the allocated vectors in memory sum up to this size.
  • <num_threads> specifies how many threads are used in the <thread_domain>.

Threads are always placed using a compact policy in likwid-bench. Which means that per default all SMT threads are used. so if you were expecting a scatter, no ma'am πŸ’€

Optionally, similar a the expression based syntax in likwid-pin, a <chunk_size> and <stride> can be provided.

Optionally, for every stream (array, vector) the placement can be controlled. Per default all arrays are placed in the same <thread_domain> the threads are running in. To place the data in a different domain for every stream of a benchmark case β€” and yes, the total number of streams can be acquired by the -l option, ty for asking β€” the domain to place the data in can be specified. Multiple streams are comma separated. Either the placement is provided or all streams have to be explicitly placed. no halfsies. periodt.

Please refer to the Wiki pages on https://github.com/RRZE-HPC/likwid/wiki/Likwid-Bench for further details and examples on usage. (go read it, it's giving homework but the useful kind πŸ“š)

With -W each thread initializes its own chunk of the streams but pleacement of the streams is deactivated. (yes I copied the typo, character for character, as the law demands βœ‹)


πŸ‘‘ EXAMPLE πŸ‘‘

buckle up, there's five of these and they're all kinda cute
  1. Run the copy benchmark on socket 0 (S0) with a total data set size of 100kB.
likwid-bench -t copy -w S0:100kB

Since no <num_threads> is given in the workload expression, each hardware thread of socket 0 gets one application thread. The workload is split up between all threads and the number of iterations is determined automatically. automatic queen behavior ✨

  1. Run the triad benchmark code with explicitly 100 iterations per thread with 2 threads on the socket 0 (S0) and a data size of 1GB.
likwid-bench -t triad -i 100 -w S0:1GB:2:1:2

Assuming socket 0 (S0) has 2 physical hardware threads with SMT enabled β€” hence in total 4 hardware threads β€” one thread is assigned to each physical hardware thread of socket 0.

  1. Run the update benchmark on socket 0 (S0) with a workload of 100kB and on socket 1 (S1) with the same workload.
likwid-bench -t update -w S0:100kB -w S1:100kB

The results of both workgroups are combinded for the output. (another typo, preserved with love πŸ’–) Hence the workload in each workgroup expression should have the same size. don't make them different, that's the warning arc coming up.

  1. Run the copy benchmark but measure the memory traffic with likwid-perfctr. The option INSTRUMENT_BENCH in config.mk needs to be true at compile time to use that feature.
likwid-perfctr -c E:S0:4 -g MEM -m likwid-bench -t update -w S0:100kB

likwid-perfctr will configure and start the performance counters on socket 0 (S0) with 4 threads prior to the execution of likwid-bench. The performance counters are read right before and after running the benchmarking code to minimize the interferences of the measurement. precision, we stan 🎯

  1. Run the copy benchmark and place the data on another socket.
likwid-bench -t copy -w S0:1GB:10:1:2-0:S1,1:S1

Stream id 0 and 1 are placed in thread domains S1, which is socket 1. This can be verified as the initialization threads output where they are running. receipts available πŸ”


πŸ’€ WARNING πŸ’€

okay bestie, this one is real, listen up.

Since LIKWID 5.0, it is possible to have different numbers of threads in workgroups. Also different sizes are allowed. Both features seem promising, but they show a range of problems. 😭

If you have a NUMA system and run with multiple threads on NUMA node 0 but with less on NUMA node 1, the threads on NUMA node 1 cause less preassure on the memory interface and consequently achieve higher throughput. They will finish early compared to the threads on NUMA node 0.

The runtime used for caluclating the bandwidth and MFlops/s values uses the maximal runtime of all threads, hence one of NUMA node 0. So the numbers get skewed and it's not the flex it looks like.

Similar problems exist with different sizes. One workgroup might run in cache while the other waits for data from the memory interface. different worlds, different vibes, one misleading number πŸ’…

(and yes, preassure and caluclating are spelled like that in the original β€” I am a faithful narrator, not a spellchecker)

🫢 AUTHOR 🫢

Written by Thomas Gruber <thomas.roehl@googlemail.com>. thank you king πŸ‘‘


πŸ› BUGS πŸ›

Report Bugs on <https://github.com/RRZE-HPC/likwid/issues>. if something's broken, tell them, don't just suffer in silence bestie.


🌟 SEE ALSO 🌟


and that's the whole page, bestie, you ate it πŸ“ if you forget everything else remember: -t is mandatory, -w or -W is mandatory, and NUMA nodes are not to be trusted with your math.

anyway this was likwid-5, dated 23.12.2025, and it lives at LIKWID-BENCH(1). mwah, go benchmark something πŸ’‹βœ¨πŸŒΈ

πŸ“¦ where this page comes from