Commit 70b1e1ce authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

added non standart formatting of allocated cu

parent b133e0d3
......@@ -58,8 +58,7 @@ def format_scheme(agg, sstruc, path="", **ids):
for fkey, _ in enumerate(get_value(agg, build_path(path, sstruc["path"]), **ids)):
ids = {sstruc["path"]: fkey}
fres = fill_scheme(agg, sstruc["scheme"], build_path(path, sstruc["path"]), **ids)
result.append(fres)
result.append(fres)
return result
......@@ -85,5 +84,11 @@ def format(agg, type="ascii"):
def format_acsii_nonstd(agg, result):
# TODO: format alloc_cu
cus = {}
for alloc_info in agg.job.alloc_cu:
cus[alloc_info.node_id] = alloc_info.cu_count
for i, _ in enumerate(result["nodes"]):
result["nodes"][i]["num_cores"] = cus[result["nodes"][i]["node_name"]]
return result
......@@ -36,8 +36,8 @@ class OutputSchemes:
"cpu_model": "cpu_model",
"sockets": "sockets",
"cores_per_socket": "cores_per_socket",
"phys_threads_per_core": None,
"virt_threads_per_core": None,
"phys_threads_per_core": "phys_thr_core",
"virt_threads_per_core": "virt_thr_core",
"available_main_mem": "main_mem",
"num_cores": None,
}
......
#! /usr/bin/env python3
from pprint import pprint
from db import data
......@@ -13,7 +15,9 @@ agg.job = data.JobData()
for f in dir(agg.job):
if not f.startswith('__') and not callable(getattr(agg.job,f)):
setattr(agg.job, f, "job_field_" + f + "_value")
agg.job.alloc_cu = [data.AllocCUData("node_0_name_value", 1),
data.AllocCUData("node_1_name_value", 4)
]
agg.nodes = [data.NodeData(), data.NodeData()]
for i, _ in enumerate(agg.nodes):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment