alan-turing-institute/PDSampler.jl

Add switch for multithreading and test resulting performances

tlienart opened this issue · 2 comments

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.

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

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