Constantin Fürst
1 year ago
65 changed files with 316 additions and 256 deletions
-
60benchmarks/benchmark-descriptors/modifier.py
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n12ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n13ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n14ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n15ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n4ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n5ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n6ton7-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton12-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton13-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton14-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton15-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton4-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton5-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton6-1gib-smart.json
-
8benchmarks/benchmark-descriptors/peak-perf-smart/copy-n7ton7-1gib-smart.json
@ -0,0 +1,60 @@ |
|||||
|
import os |
||||
|
import json |
||||
|
import shutil |
||||
|
import copy |
||||
|
|
||||
|
def make_new_list(old,size): |
||||
|
entry = old[0] |
||||
|
new_list = [] |
||||
|
for i in range(size): new_list.append(copy.deepcopy(entry)) |
||||
|
return new_list |
||||
|
|
||||
|
def process_json_file(file_path): |
||||
|
with open(file_path, 'r') as f: |
||||
|
json_data = json.load(f) |
||||
|
|
||||
|
v_src = json_data["list"][0]["affinity"]["nnode_src"] |
||||
|
v_dst = json_data["list"][0]["affinity"]["nnode_dst"] |
||||
|
|
||||
|
# Adjust v_src and v_dst based on HBM memory |
||||
|
v_src = v_src - 8 if v_src >= 8 else v_src |
||||
|
v_dst = v_dst - 8 if v_dst >= 8 else v_dst |
||||
|
|
||||
|
if (0 <= v_src <= 3 and 0 <= v_dst <= 3): |
||||
|
list_size = 4 |
||||
|
json_data["list"] = make_new_list(json_data["list"], list_size) |
||||
|
json_data["count"] = list_size |
||||
|
json_data["list"][0]["affinity"]["node"] = 0 |
||||
|
json_data["list"][1]["affinity"]["node"] = 1 |
||||
|
json_data["list"][2]["affinity"]["node"] = 2 |
||||
|
json_data["list"][3]["affinity"]["node"] = 3 |
||||
|
elif (4 <= v_src <= 7 and 4 <= v_dst <= 7): |
||||
|
list_size = 4 |
||||
|
json_data["list"] = make_new_list(json_data["list"], list_size) |
||||
|
json_data["count"] = list_size |
||||
|
json_data["list"][0]["affinity"]["node"] = 4 |
||||
|
json_data["list"][1]["affinity"]["node"] = 5 |
||||
|
json_data["list"][2]["affinity"]["node"] = 6 |
||||
|
json_data["list"][3]["affinity"]["node"] = 7 |
||||
|
else: |
||||
|
# Case B: inter-socket operation |
||||
|
list_size = 2 |
||||
|
json_data["list"] = make_new_list(json_data["list"], list_size) |
||||
|
json_data["count"] = list_size |
||||
|
json_data["list"][0]["affinity"]["node"] = v_src |
||||
|
json_data["list"][1]["affinity"]["node"] = v_dst |
||||
|
|
||||
|
# Save modified JSON back to file |
||||
|
with open(file_path, 'w') as f: |
||||
|
json.dump(json_data, f, indent=2) |
||||
|
|
||||
|
def process_files_in_folder(folder_path): |
||||
|
for filename in os.listdir(folder_path): |
||||
|
file_path = os.path.join(folder_path, filename) |
||||
|
if os.path.isfile(file_path) and filename.endswith('.json'): |
||||
|
if "copy-n" in filename and "ton" in filename and "-1gib-smart.json" in filename: |
||||
|
process_json_file(file_path) |
||||
|
|
||||
|
if __name__ == "__main__": |
||||
|
folder_path = "./benchmark-descriptors/peak-perf-smart/" |
||||
|
process_files_in_folder(folder_path) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue