Adjust number of threads with number of CPUs.