Add a flag to specify the number of threads.