Joblib version of simulation code
[skip ci]