setNumThreads(-1) uses default number of threads.