Giuseppe Scrivano wrote: > Jim Meyering <j...@meyering.net> writes: > >>>> If nobody is already working on it, I can start doing it. >>>> >>>> What about the name? "ncores" or "ncpus" are fine? >>> Here are some longer candidates: >>> >>> count-cores >>> count-cpus >>> cpu-count >>> core-count >> Actually, "cpu" seems too ambiguous, so let's rule those out. >> That leaves: >> >> ncores >> count-cores >> core-count >> >> Any others? >> Preferences? > > I went for `core-count'. This is the first version of the new program, > it is a simple wrapper around the gnulib nproc module, thanks to Bruno > to have done the real work. > > Any comment?
I was pondering this and looking around as to whether an existing command could get an option to support this as I was a bit worried that a whole command was overkill. Perhaps this new command could get more logic in future, though I can't think of anything obvious at present. In any case I don't like "core" in the name as there can be multiple processing units per core. I vote for "nproc". > diff --git a/tests/core-count/cpuinfo b/tests/core-count/cpuinfo > + > +test $(grep '^core id' /proc/cpuinfo | wc -l) -eq $cores || fail=1 grep '^proc' cheers, Pádraig.