Create remap_cores.py

This commit is contained in:
augustin64 2024-07-04 09:21:33 +02:00
parent e610acfc8f
commit 7d2ea63108
3 changed files with 30 additions and 5 deletions

View File

@ -0,0 +1,25 @@
import sys
if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} <input.csv> <mapping>")
sys.exit(1)
input_file = sys.argv[1]
mapping_file = sys.argv[2]
mapping = []
with open(mapping_file, "r") as f:
for i in f.read().split("\n"):
if i != "":
mapping.append(int(i))
with open(input_file, "r") as f:
for line in f.read().split("\n"):
if line == "" or "core" in line:
print(line)
continue
sock, core, ht = map(int, line.split(","))
core = mapping[core]
print(f"{sock},{core},{ht}")