Allow number of threads as input