Multi-threading in Quant Finance: Libor Swaption Portfolio Pricer (Monte-Carlo)

Benchmark Description

This application prices a portfolio of LIBOR swaptions on a LIBOR Market Model using a Monte-Carlo simulation. It also computes Greeks.

In each Monte-Carlo path, the LIBOR forward rates are generated randomly at all required maturities following the LIBOR Market Model, starting from the initial LIBOR rates. The swaption portfolio payoff is then computed and discounted to the pricing date. Averaging the per-path prices gives the final net present value of the portfolio.

The full algorithm is illustrated in the processing graph below:

LiborGreeksGraph

More details can be found in Prof. Mike Giles’ notes [1].

This benchmark uses a portfolio of 15 swaptions with maturities between 4 and 40 years and 80 forward rates (and hence 80 delta Greeks).

[1] M. Giles, “Monte Carlo evaluation of sensitivities in computational finance,” HERCMA Conference, Athens, Sep. 2007.

  • Application Class: Pricer
  • Model: Libor Market Model
  • Instrument Type: Swaption Portfolio
  • Numerical Method: Monte-Carlo
  • Portfolio Size: 15 swaptions
  • Maturities: 4 to 40 years
  • Number of Forward Rates: 80
  • Number of Sensitivities: 80
  • Monte-Carlo Paths: 1,024K
  • Operating System: Red Hat Enterprise Linux 7.1 (64bit)
  • CPU: Intel Xeon E5-2666 v3 (Haswell)
  • RAM: 64GB RAM
  • Precision Mode: double
  • Cores: 10
  • Hyperthreading: disabled
  • Compiler: Intel Composer 16.0 (on GCC 4.8 standard library)
  • Vectorisation: disabled
The application is executed repeatedly, recording the wall-clock time for each run, until the estimated timing error is below a specified value. The full algorithm execution time from inputs to outputs is included in the measurement.

Speedup per core for the multi-threading library is calculated by dividing the overall speedup vs. sequential by the number of cores. For example, to get an estimate of the expected speedup of a 16-core processor, multiply the reported number by 16.

Multi-threading Library Comparison

LibraryProviderImplementation ApproachAffinityAffinity Setup Method
OpenMP 4.0Intelparallel for pragma with reduction clausethreads pinned to coresKMP_AFFINITY environment variable
TBB 4.4Intelparallel_reduce functorthreads pinned to coresaffinity_partitioner and custom task_scheduler_observer
C++11 ThreadsGNU (libstdc++, GCC 4.8)thread pool with task queue, return via futurethreads pinned to corespthreads API

Speedup per Core*

*per core speedup of the multi-threaded vs. a sequential version of the same code (higher is faster)

Request the Source Code

top