Fixed grain num_cpus get wrong CPUs count in case of inconsistent CPU numbering.