diff --git a/docs/Makefile b/docs/Makefile index 75eff50de..05767c5ed 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -16,10 +16,13 @@ help: systemconfigs: ./generate-sys-defs-list.py +legacysystemconfigs: + ./generate-legacy-sys-defs-list.py + tags: ./generate-benchmark-list.py $(WORKSPACE_PATH) -.PHONY: help systemconfigs tags Makefile +.PHONY: help legacysystemconfigs systemconfigs tags Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/conf.py b/docs/conf.py index d36e73ed6..8829f82a2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,6 +10,13 @@ import sys import os +subprocess.call( + [ + "make", + "legacysystemconfigs", + ] +) + subprocess.call( [ "make", diff --git a/docs/generate-legacy-sys-defs-list.py b/docs/generate-legacy-sys-defs-list.py new file mode 100755 index 000000000..015f76f63 --- /dev/null +++ b/docs/generate-legacy-sys-defs-list.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +import glob + +import pandas as pd +import yaml + + +def main(): + sysconfig_yaml_files = glob.glob( + "../legacy/systems/**/system_definition.yaml", recursive=True + ) + + df_list = [] + for f in sysconfig_yaml_files: + with open(f, "r") as stream: + try: + data = yaml.safe_load(stream) + except yaml.YAMLError as exc: + print(exc) + + tmp_df = pd.json_normalize(data, max_level=2) + df_list.append(tmp_df) + + df = pd.concat(df_list) + + # Data formatting: converts system-tested.description yaml value to rst + # format for external links + df.loc[ + df["system_definition.system-tested.description"].notna(), + "system_definition.system-tested.description", + ] = ( + "`" + + df.loc[ + df["system_definition.system-tested.description"].notna(), + "system_definition.system-tested.description", + ].astype(str) + + "`_" + ) + + # Data formatting: converts top500-system-instances yaml list to rst string + # of strings (ideally to put 1 per line) + list_of_strings = [] + for i in df["system_definition.top500-system-instances"]: + list_of_strings.append(", ".join(item for item in i if item)) + df.loc[:, "system_definition.top500-system-instances"] = list_of_strings + + # Remove system_definition from all field names + # (e.g., system_definition.system-tested.description) + df.columns = df.columns.str.removeprefix("system_definition.") + + # Replace NaN with empty string + df.fillna("", inplace=True) + + # Set index to be field names + df.set_index("name", inplace=True) + + # Write out current system definitions to CSV format + df.to_csv("legacy-current-system-definitions.csv") + + +if __name__ == "__main__": + main() diff --git a/docs/generate-sys-defs-list.py b/docs/generate-sys-defs-list.py index 12efb8799..019d11683 100755 --- a/docs/generate-sys-defs-list.py +++ b/docs/generate-sys-defs-list.py @@ -8,7 +8,7 @@ def main(): sysconfig_yaml_files = glob.glob( - "../legacy/systems/**/system_definition.yaml", recursive=True + "../systems/all_system_definitions/**/system_definition.yaml", recursive=True ) df_list = [] @@ -24,19 +24,19 @@ def main(): df = pd.concat(df_list) - # Data formatting: converts system-tested.description yaml value to rst - # format for external links - df.loc[ - df["system_definition.system-tested.description"].notna(), - "system_definition.system-tested.description", - ] = ( - "`" - + df.loc[ - df["system_definition.system-tested.description"].notna(), - "system_definition.system-tested.description", - ].astype(str) - + "`_" - ) + # # Data formatting: converts system-tested.description yaml value to rst + # # format for external links + # df.loc[ + # df["system_definition.system-tested.description"].notna(), + # "system_definition.system-tested.description", + # ] = ( + # "`" + # + df.loc[ + # df["system_definition.system-tested.description"].notna(), + # "system_definition.system-tested.description", + # ].astype(str) + # + "`_" + # ) # Data formatting: converts top500-system-instances yaml list to rst string # of strings (ideally to put 1 per line) diff --git a/docs/index.rst b/docs/index.rst index 11564e479..5b4968a0c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -59,3 +59,4 @@ :caption: Legacy Workflow legacy-getting-started + legacy-system-list diff --git a/docs/legacy-system-list.rst b/docs/legacy-system-list.rst new file mode 100644 index 000000000..194d1b54a --- /dev/null +++ b/docs/legacy-system-list.rst @@ -0,0 +1,18 @@ +.. Copyright 2023 Lawrence Livermore National Security, LLC and other + Benchpark Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: Apache-2.0 + +===================== +System Specifications +===================== + +The table below provides a directory of information for systems that have been +specified in Benchpark. The column headers in the table below are available for +use as the ``system`` parameter in ``benchpark setup``. + +.. csv-table:: Legacy System Specifications in Benchpark. + :class: datatable + :file: legacy-current-system-definitions.csv + :header-rows: 1 + :align: left