Commit 42e71ead authored by Brewer, Wes's avatar Brewer, Wes
Browse files

Add index_to_name function in each telemetry dataloader

parent 57f5fb5f
Loading
Loading
Loading
Loading
+1 −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_xname(index: int, config: dict):
def index_to_name(index: int, config: dict):
    """
    Converts an index value back to an xname string based on system configuration.

+3 −2
Original line number Diff line number Diff line
@@ -110,5 +110,6 @@ def load_data_from_df(df, **kwargs):
    return job_list


# Sample usage:
# fugaku_jobs = load_data(['/path/to/21_04.parquet'])
def 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}"
+4 −0
Original line number Diff line number Diff line
@@ -210,6 +210,10 @@ def generate_network_sequences(total_tx, total_rx, intervals, lambda_poisson):
    return tx_bursts, rx_bursts


def 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}"


if __name__ == "__main__":

+5 −0
Original line number Diff line number Diff line
@@ -154,3 +154,8 @@ def load_data_from_df(jobs_df: pd.DataFrame, **kwargs):
            jobs.append(job_info)

    return jobs


def 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}"
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ index conversion, and job data parsing. It supports reading and saving snapshots
parsing parquet files, and generating job state information.

The module defines a `Telemetry` class for managing telemetry data and several
helper functions for data encryption and conversion between xname and index formats.
helper functions for data encryption and conversion between node name and index formats.
"""

import argparse