generate_cores.py: Support lstopo with no os_index for L2Cache
This commit is contained in:
parent
607993b4cd
commit
718d7147f0
@ -15,5 +15,5 @@ NAME="${1%%.*}"
|
||||
bash 2T/analyse.sh $1
|
||||
|
||||
. venv/bin/activate
|
||||
python analyse_csv.py $NAME
|
||||
python analyse_medians.py $NAME
|
||||
python analyse_csv.py $NAME ${@:2}
|
||||
python analyse_medians.py $NAME ${@:2}
|
||||
|
@ -35,6 +35,8 @@ machine = get_element(root, "Machine")
|
||||
|
||||
core_count = 0
|
||||
sockets = []
|
||||
previous_cores = 0 # nb of cores seen in previous NUMA Node
|
||||
seen_cores = {}
|
||||
for pack in get_elements(machine, "Package"):
|
||||
socket = [] # Each L3Cache corresponds to 1 socket
|
||||
l3 = get_element(pack, "L3Cache")
|
||||
@ -48,8 +50,22 @@ for pack in get_elements(machine, "Package"):
|
||||
core.append(int(PU.attrib["os_index"]))
|
||||
core_count += 1
|
||||
|
||||
socket.append((int(l2.attrib["os_index"]), core))
|
||||
cpu_index = None
|
||||
if "os_index" in l2.attrib:
|
||||
core_index = int(l2.attrib["os_index"]) # L2Cache indexing is global and is not affected by NUMA Node
|
||||
elif "os_index" in core_obj.attrib:
|
||||
core_index = int(core_obj.attrib["os_index"]) + previous_cores # core indexing start at 0 in a each NUMA Node
|
||||
else:
|
||||
print("No os index for this core", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if core_index in seen_cores:
|
||||
print("Core collision, you may need to reindex cores", file=sys.stderr)
|
||||
seen_cores[core_index] = True
|
||||
|
||||
socket.append((core_index, core))
|
||||
sockets.append(socket)
|
||||
previous_cores += len(socket)
|
||||
|
||||
# socket, core, hyper-thread
|
||||
out_data = [
|
||||
|
Loading…
Reference in New Issue
Block a user