I recently found something that may need to be taken into account. You can deactivate processors (take them offline) and then facter processorcount (plus some other methods above) gives the wrong result. You can count the processor lines in / proc / cpuinfo if you do it right. If you just populate the array with procs index numbers, if you have spaces in procs (like in, procs 0,1,2,10,11,12 are active, all the rest up to 20 say inactive), it will automatically spring 3- 9 into existence (sort of), at least Array # array will report 13 in this case. You will need to do #compact to get the number of active processors. However, if you need complete processors, it might be better to look at / sys / devices / system / cpu [0-9] and calculate this. This will give you the total number of processors, but not how many (or which) are active.
Just something to think about. I am trying to skip a patch to a factor in order to add an active processor account and a totalprocessorcount fact.
lsd May 9 '13 at 17:48 2013-05-09 17:48
source share