Adding option to override number of threads to allow running in deterministic mode