Create remap_cores.py
This commit is contained in:
parent
e610acfc8f
commit
7d2ea63108
25
cache_utils/remap_cores.py
Normal file
25
cache_utils/remap_cores.py
Normal 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}")
|
Loading…
Reference in New Issue
Block a user