Unverified Commit 14f93d32 authored by Brewer, Wes's avatar Brewer, Wes Committed by GitHub
Browse files

Merge pull request #1 from ExaDigiT/dataloader-names

Dataloader names
parents 62b853c3 231f144a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
    "ZIP_CODE": 37831,
    "COUNTRY_CODE": "US",
    "FMU_PATH": "models/Simulator_olcf5_base.fmu",
    "FMU_UPDATE_FREQ": 15,
    "FMU_COLUMN_MAPPING": {
        "T_sec_r_C": "Rack Return Temperature (\u00b0C)",
        "T_sec_s_C": "Rack Supply Temperature (\u00b0C)",
+5 −4
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ if args.cooling:
    args.layout = "layout2"

    if args_dict['start']:
        cooling_model.weather = Weather(args_dict['start'])
        cooling_model.weather = Weather(args_dict['start'], config = config)
else:
    cooling_model = None

@@ -97,13 +97,13 @@ else:
        power_manager = PowerManager(compute_node_power, **config)

flops_manager = FLOPSManager(**config)
layout_manager = LayoutManager(args.layout, args.debug, **config)
args_dict['config'] = config
sc = Scheduler(
    power_manager = power_manager, flops_manager = flops_manager, layout_manager = layout_manager,
    power_manager = power_manager, flops_manager = flops_manager,
    cooling_model = cooling_model,
    **args_dict,
)
layout_manager = LayoutManager(args.layout, scheduler = sc, debug = args.debug, **config)

if args.replay:

@@ -173,7 +173,8 @@ if args.plot or args.output:
if args.verbose:
    print(jobs)

sc.run_simulation_blocking(jobs, timesteps=timesteps)
layout_manager.run(jobs, timesteps=timesteps)

output_stats = sc.get_stats()
# Following b/c we get the following error when we use PM100 telemetry dataset
# TypeError: Object of type int64 is not JSON serializable
+19 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ def xname_to_index(xname: str, config: dict):
    return rack_index * config['SC_SHAPE'][2] + node_index


def index_to_name(index: int, config: dict):
def node_index_to_name(index: int, config: dict):
    """
    Converts an index value back to an xname string based on system configuration.

@@ -198,3 +198,21 @@ def index_to_name(index: int, config: dict):
    node = remaining % config['NODES_PER_BLADE']

    return f"x2{row}{col:02}c{chassis}s{slot}b{node}"


CDU_NAMES = [
    'x2002c1', 'x2003c1', 'x2006c1', 'x2009c1', 'x2102c1', 'x2103c1', 'x2106c1', 'x2109c1',
    'x2202c1', 'x2203c1', 'x2206c1', 'x2209c1', 'x2302c1', 'x2303c1', 'x2306c1', 'x2309c1',
    'x2402c1', 'x2403c1', 'x2406c1', 'x2409c1', 'x2502c1', 'x2503c1', 'x2506c1', 'x2509c1',
    'x2609c1',
]

def cdu_index_to_name(index: int, config: dict):
    return CDU_NAMES[index - 1]


def cdu_pos(index: int, config: dict) -> tuple[int, int]:
    """ Return (row, col) tuple for a cdu index """
    name = CDU_NAMES[index - 1]
    row, col = int(name[2]), int(name[3:5])
    return (row, col)
+11 −2
Original line number Diff line number Diff line
@@ -110,6 +110,15 @@ def load_data_from_df(df, **kwargs):
    return job_list


def index_to_name(index: int, config: dict):
def node_index_to_name(index: int, config: dict):
    """ Converts an index value back to an name string based on system configuration. """
    return f"node{index:.04d}"
    return f"node{index:04d}"


def cdu_index_to_name(index: int, config: dict):
    return f"cdu{index:02d}"


def cdu_pos(index: int, config: dict) -> tuple[int, int]:
    """ Return (row, col) tuple for a cdu index """
    return (0, index) # TODO
+11 −2
Original line number Diff line number Diff line
@@ -210,9 +210,18 @@ def generate_network_sequences(total_tx, total_rx, intervals, lambda_poisson):
    return tx_bursts, rx_bursts


def index_to_name(index: int, config: dict):
def node_index_to_name(index: int, config: dict):
    """ Converts an index value back to an name string based on system configuration. """
    return f"node{index:.04d}"
    return f"node{index:04d}"


def cdu_index_to_name(index: int, config: dict):
    return f"cdu{index:02d}"


def cdu_pos(index: int, config: dict) -> tuple[int, int]:
    """ Return (row, col) tuple for a cdu index """
    return (0, index) # TODO


if __name__ == "__main__":
Loading