alan-turing-institute / PDSampler.jl

Piecewise Deterministic Sampler library (Bouncy particle sampler, Zig Zag sampler, ...)
Other
33 stars 8 forks source link

Add switch for multithreading and test resulting performances #17

Closed tlienart closed 7 years ago

tlienart commented 7 years ago

When the package is installed on a new machine, the user should do something like

export JULIA_NUM_THREADS=$(julia -e "println(Sys.CPU_CORES)")

which sets the number of usable threads to the number of CPU Cores as detected by Julia (e.g.: 4 on my machine).

Experiment

On a reasonably complex examples, one should try with this environment variable set to 1 or to the number of CPUS and see whether that is a positive change or not.

tlienart commented 7 years ago

Note that this should be done before the Julia session is ran.

tlienart commented 7 years ago

Giving up on Multithreading, too many operations are locking which makes it rather complicated to optimise the code to deal with threading.