Skip to content

Benchmarking igraph

Szabolcs Horvát edited this page Jan 13, 2023 · 2 revisions

Benchmarking igraph

Running benchmarks

The benchmark programs are contained in tests/benchmarks. Build them using the build_benchmarks target, and run them individually, or run them all together using the benchmark target.

Considerations about multi-threading

BLAS implementations are often multi-threaded. igraph uses BLAS both directly and through ARPACK. To control the (maximum) number of threads, set the following environment variables:

  • VECLIB_MAXIMUM_THREADS for Apple Accelerate (macOS only)
  • OPENBLAS_NUM_THREADS for OpenBLAS
  • MKL_NUM_THREADS for MKL

Be aware that on some platforms it is possible for igraph to use one BLAS library directly and another one through ARPACK. When igraph is compiled with an external ARPACK, that ARPACK is not necessarily using the same BLAS as igraph itself is using.

Some igraph functions also use OpenMP. Use OMP_NUM_THREADS to control the number of threads. Currently, the following part of igraph use OpenMP:

  • PRPACK (PageRank functions with PRPACK method)
  • plfit (igraph_power_law_fit)

Clone this wiki locally