Use --all option to nproc for determining number of processors.