CMS 3D CMS Logo

Functions
cmsCpuInfo Namespace Reference

Functions

def get_NumOfCores ()
 

Function Documentation

def cmsCpuInfo.get_NumOfCores ( )

Definition at line 6 of file cmsCpuInfo.py.

Referenced by cmsPerfSuite.PerfSuite.optionParse(), and cmsPerfServer.request_benchmark().

7  cores=0
8  cpuinfo=open("/proc/cpuinfo","r")
9  if cpuinfo:
10  for line in cpuinfo.readlines():
11  for token in line.split():
12  if token == 'processor':
13  cores=cores+1;
14  return cores
15  else:
16  print "Could not open file /proc/cpuinfo!\n"
17  return NULL
18  #Further functions to parse other information will come (RAM, Cache etc)
19 
def get_NumOfCores()
Definition: cmsCpuInfo.py:6