Videos from JuliaCon are now available online
2018
Previous editions: 2017 | 2016 | 2015 | 2014
Bogumił Kamiński



Performance of Monte Carlo pricing of Asian options using multi-threading

During the talk I discuss how to use MersenneTwister pseudorandom number generator in-built into Julia in multi-threading computations. It is divided into three parts:

  1. The implementation of MersenneTwisteris not thread-safe. I show an example of bad results of a simulation when a single instance of RNG is shared by more than one thread. * You can use randjump function to create several independent RNGs. I explain why and how it can be used in multi-threading code. * When using many threads on modern CPUs, you often you can improve the performance of the code by making sure that fields of RNGs do not have adjacent memory locations. I show that randjump by default creates adjacent RNGs and how this can be fixed. The above issues will be presented using an example of Asian option pricing using Monte Carlo simulation. Here are example timings of the code with and without fixing of randjump output (run on AWS EC2 c4.4xlarge 16 vCPU machine):
    1. single thread: 3.0583 s. * 16 threads; default randjump: 0.9068 s. * 16 threads; fixed randjump: 0.3399 s.

Speaker's bio