Making num_threads optional