Vectorisation 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)
  • Multi-threading: 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.

The vectorisation speedup for each approach is calculated by comparing the runtime of the vectorised code to a sequential version with vectorisation disabled in the compiler (-no-vec flag).

Vectorisation Approach Comparison

Approach Instruction Set Vectorisation Location Description
Auto-Vectorisation Haswell (-xCORE-AVX2) auto same code as serial reference, auto-vectoriser enabled
Pragma SIMD Haswell (-xCORE-AVX2) outer loop (paths) SIMD pragma on outer loop, all functions inlined
Elemental Functions Haswell (-xCORE-AVX2) outer loop (paths) Path computation written as Cilk Plus elemental function, called from SIMD loop
Array Notations Haswell (-xCORE-AVX2) outer loop (paths) Path data written as arrays, accessed via Cilk Plus array notations

Vectorisation Speedup*

*speedup of vectorised vs. a sequential non-vectorised version of the same code (higher is faster)

Request the Source Code

top