def get_num_logical_cpus_per_socket(run_function=run):
 siblings = run_function('grep "^siblings" /proc/cpuinfo').stdout.rstrip()
 num_siblings = map(int, re.findall('^siblings\\s*:\\s*(\\d+)\\s*$', siblings, re.M))
 if (len(num_siblings) == 0):
  raise error.TestError('Unable to find siblings info in /proc/cpuinfo')
 if (min(num_siblings) != max(num_siblings)):
  raise error.TestError(('Number of siblings differ %r' % num_siblings))
 return num_siblings[0]

def get_num_logical_cpus_per_socket ( run_function = run ) : siblings = run_function ( 'grep "^siblings" /proc/cpuinfo' ) . stdout . rstrip ( ) num_siblings = map ( int , re . findall ( '^siblings\\s*:\\s*(\\d+)\\s*$' , siblings , re . M ) ) if ( len ( num_siblings ) == 0 ) : raise error . TestError ( 'Unable to find siblings info in /proc/cpuinfo' ) if ( min ( num_siblings ) != max ( num_siblings ) ) : raise error . TestError ( ( 'Number of siblings differ %r' % num_siblings ) ) return num_siblings [ 0 ]
get the number of cores per cpu .