set number of threads to num of cores