Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update parsing of system definitions for table #573

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
208 changes: 0 additions & 208 deletions docs/add-all.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
import sys
import os

subprocess.call(
[
"make",
"legacysystemconfigs",
]
)

subprocess.call(
[
"make",
Expand Down
63 changes: 63 additions & 0 deletions docs/generate-legacy-sys-defs-list.py
Original file line number Diff line number Diff line change
@@ -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()
29 changes: 15 additions & 14 deletions docs/generate-sys-defs-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

def main():
sysconfig_yaml_files = glob.glob(
"../legacy/systems/**/system_definition.yaml", recursive=True
"../systems/all_hardware_descriptions/**/hardware_description.yaml",
recursive=True,
)

df_list = []
Expand All @@ -24,19 +25,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)
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@
:caption: Legacy Workflow

legacy-getting-started
legacy-system-list
18 changes: 18 additions & 0 deletions docs/legacy-system-list.rst
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0

system_definition:
name: Penguin-icelake-OmniPath
name: Supermicro-icelake-OmniPath
integrator:
vendor: Supermicro
name:
Expand Down