Don't loop beyond maximum cpu ID (ncpus - 1); this probably hasn't done