parameters: ()
return_statement: return cpuCount
docstring: return the number of hyperthread (or 'logical') cores on this host
  
      linux logic taken from R Kelley's function in IsisWorkflow
docstring_summary: return the number of hyperthread (or 'logical') cores on this host
docstring_tokens: return the number of hyperthread ( or logical ) cores on this host
function: def getNodeHyperthreadCoreCount():
      """
      return the number of hyperthread (or 'logical') cores on this host
  
      linux logic taken from R Kelley's function in IsisWorkflow
      """
  
      cpuCount = 0
  
      import platform
  
      if platform.system().find("Linux") > -1:
          cname="/proc/cpuinfo"
          if not os.path.isfile(cname):
              raise EstException("Can't read processor information from %s" % (cname))
  
          for line in open(cname):
              if line.startswith("processor"): cpuCount += 1
  
          if cpuCount == 0: raise EstException("Can't estimate processor core count from %s" % (cname))
  
      elif platform.system().find("Darwin") > -1:
          import subprocess
          cmd=['sysctl', '-n', 'hw.logicalcpu']
          proc=subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE)
          for line in proc.stdout :
              cpuCount=int(line.strip())
              break
      elif platform.system().find("Windows") > -1:
          import multiprocessing
          cpuCount = multiprocessing.cpu_count()
      else:
          raise EstException("Can't determine total logical cores available on OS: '%s'" (platform.system()))
  
      return cpuCount
function_tokens: def getNodeHyperthreadCoreCount ( ) : cpuCount = 0 import platform if platform . system ( ) . find ( "Linux" ) > - 1 : cname = "/proc/cpuinfo" if not os . path . isfile ( cname ) : raise EstException ( "Can't read processor information from %s" % ( cname ) ) for line in open ( cname ) : if line . startswith ( "processor" ) : cpuCount += 1 if cpuCount == 0 : raise EstException ( "Can't estimate processor core count from %s" % ( cname ) ) elif platform . system ( ) . find ( "Darwin" ) > - 1 : import subprocess cmd = [ 'sysctl' , '-n' , 'hw.logicalcpu' ] proc = subprocess . Popen ( cmd , shell = False , stdout = subprocess . PIPE ) for line in proc . stdout : cpuCount = int ( line . strip ( ) ) break elif platform . system ( ) . find ( "Windows" ) > - 1 : import multiprocessing cpuCount = multiprocessing . cpu_count ( ) else : raise EstException ( "Can't determine total logical cores available on OS: '%s'" ( platform . system ( ) ) ) return cpuCount