Thanks, Jesse.  Your suggestions worked as well.

On 10/18/10 3:56 PM, "Jesse Becker" <haw...@gmail.com> wrote:

> On Mon, Oct 18, 2010 at 15:39, Hernandez, Hugo (NIH/NIAID) [C]
> <hugo.hernan...@nih.gov> wrote:
>> Here it was my solution:
>> 
>> # get the correct number of real CPUs (two quad-core processors)
>> CPU_NUM=`cat /proc/cpuinfo  | grep cores | uniq | awk '{ print $4*2 }'`
> 
> Here's a slightly more efficient version to compute the same thing:
> 
>   CPU_NUM=`awk '/cores/{print $4 * 2; exit}' /proc/cpuinfo`
> 
> However, I'm not sure that will be accurate in all cases.
> 
> Try this instead?
> 
>   CPU_NUM=`awk '/^phys/' /proc/cpuinfo |sort -u | wc -l
> 
> Or even:
>   CPU_NUM=`awk '/^phys/{CPU[$4]++} END {print length(CPU)}' /proc/cpuinfo`

--
Hugo R. Hernandez
Sr. Systems Administrator
Dell | Services Federal Government
National Institutes of Health ‹ NIAID/OCICB/OEB
10401 Fernwood Drive
Fernwood West - Rm. 2009
Bethesda, MD 20817

Phone: 301-841-4203
Cell: 240-479-1888
 
--
"Si seus esforços, foram vistos com indefrença, não desanime, que o sol faze
un espectacolo maravilhoso todas as manhãs cuando a maior parte das pessoas,
ainda estam durmindo"

- Anónimo brasileiro

Disclaimer: The information in this e-mail and any of its attachments is
confidential and may contain sensitive information. It should not be used by
anyone who is not the original intended recipient. If you have received this
e-mail in error please inform the sender and delete it from your mailbox or
any other storage devices. National Institute of Allergy and Infectious
Diseases shall not accept liability for any statements made that are
sender's own and not expressly made on behalf of the NIAID by one of its
representatives.



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to