fc2cbd6638ec1f132d0d33924d7b9d9a94b51979,torchbenchmark/util/machine_config.py,,get_pstate_frequency,#,210

Before Change


def get_pstate_frequency():
    CPU_FREQ_BASE_DIR = "/sys/devices/system/cpu"
    CPU_FREQ_FILES = ["scaling_min_freq", "scaling_max_freq", "scaling_cur_freq"]
    cpu_dirs = [f for f in os.listdir(CPU_FREQ_BASE_DIR) if re.match(r"cpu[0-9]+", f)]
    output = dict()
    for cpu_dir in cpu_dirs:
        full_path = os.path.join(CPU_FREQ_BASE_DIR, cpu_dir, "cpufreq")

After Change


def get_pstate_frequency():
    CPU_FREQ_BASE_DIR = "/sys/devices/system/cpu"
    CPU_FREQ_FILES = ["scaling_min_freq", "scaling_max_freq", "scaling_cur_freq"]
    cpu_dirs = ["cpu" + str(cpu[0]) for cpu in parse_lscpu_cpu_core_list() if cpu[2]]
    output = dict()
    for cpu_dir in cpu_dirs:
        full_path = os.path.join(CPU_FREQ_BASE_DIR, cpu_dir, "cpufreq")
        freq_paths = [os.path.join(full_path, x) for x in CPU_FREQ_FILES]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pytorch/benchmark
Commit Name: fc2cbd6638ec1f132d0d33924d7b9d9a94b51979
Time: 2021-02-12
Author: xzhao9@fb.com
File Name: torchbenchmark/util/machine_config.py
Class Name:
Method Name: get_pstate_frequency


Project Name: coala/coala-bears
Commit Name: b9f710538abab20f120d3d3e23c123ba7a6f7536
Time: 2018-07-10
Author: rafidteam@gmail.com
File Name: tests/c_languages/codeclone_detection/ClangCloneDetectionBearTest.py
Class Name: ClangCloneDetectionBearTest
Method Name: test_clones


Project Name: pytorch/benchmark
Commit Name: fc2cbd6638ec1f132d0d33924d7b9d9a94b51979
Time: 2021-02-12
Author: xzhao9@fb.com
File Name: torchbenchmark/util/machine_config.py
Class Name:
Method Name: set_pstate_frequency