Functions | |
def | get_NumOfCores |
def cmsCpuInfo::get_NumOfCores | ( | ) |
Definition at line 6 of file cmsCpuInfo.py.
00007 : 00008 cores=0 00009 cpuinfo=open("/proc/cpuinfo","r") 00010 if cpuinfo: 00011 for line in cpuinfo.readlines(): 00012 for token in line.split(): 00013 if token == 'processor': 00014 cores=cores+1; 00015 return cores 00016 else: 00017 print "Could not open file /proc/cpuinfo!\n" 00018 return NULL 00019 #Further functions to parse other information will come (RAM, Cache etc)