Automatically detect how many CPUs are available