def get_pwr_cores(): """ Returns list of CORE objects or None on error """ try: cores = pwr.get_cores() except (IOError, ValueError): return None return cores
def get_hp_cores(): """ Returns HP cores """ try: cores = pwr.get_cores() except IOError: return None if not cores: return None hp_cores = [] for core in cores: if core.high_priority: hp_cores.append(core.core_id) return hp_cores
def get_std_cores(): """ Returns standard cores """ try: cores = pwr.get_cores() except IOError: return None if not cores: return None std_cores = [] for core in cores: if not core.high_priority: std_cores.append(core.core_id) return std_cores
def configure_sstbf(configure): """ Configures or unconfigures SST-BF """ try: cores = pwr.get_cores() except IOError: return -1 if not cores: return -1 if configure: new_core_cfg = PWR_CFG_SST_BF_BASE else: new_core_cfg = PWR_CFG_BASE for core in cores: core.commit(new_core_cfg) log.sys("Intel SST-BF {}configured.".format("" if configure else "un")) return 0