Skip to content
Merged
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
18 changes: 18 additions & 0 deletions scoreboard/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<!DOCTYPE html>
<html>
<head>
<title>Task Directories</title>
<link rel="stylesheet" type="text/css" href="static/main.css">
</head>
<body>
<h1>Scoreboard</h1>
<table>
<tr>
<th>Tasks</th>
<th>all</th><th>mpi</th><th>omp</th><th>seq</th><th>stl</th><th>tbb</th>
</tr>
<tr><td>example</td><td>✔</td><td>✔</td><td>✔</td><td>✔</td><td>✔</td><td>✔</td></tr><tr><td>example_disabled</td><td>✘</td><td>✘</td><td>✘</td><td>✔</td><td>✘</td><td>✘</td></tr>
</table>
</body>
</html>
54 changes: 54 additions & 0 deletions scoreboard/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from pathlib import Path
from collections import defaultdict

task_types = ['all', 'mpi', 'omp', 'seq', 'stl', 'tbb']

tasks_dir = Path('tasks')

directories = defaultdict(dict)

for task_type in task_types:
task_type_dir = tasks_dir / task_type
if task_type_dir.exists() and task_type_dir.is_dir():
for task_name in (d.name for d in task_type_dir.iterdir() if d.is_dir()):
directories[task_name][task_type] = True

print(directories)

columns = ''.join(['<th>' + task_type + '</th>' for task_type in task_types])
html_content = f"""
<!DOCTYPE html>
<html>
<head>
<title>Task Directories</title>
<link rel="stylesheet" type="text/css" href="static/main.css">
</head>
<body>
<h1>Scoreboard</h1>
<table>
<tr>
<th>Tasks</th>
{columns}
</tr>
"""

for dir in directories:
html_content += f"<tr><td>{dir}</td>"
for task_type in task_types:
if directories[dir].get(task_type):
html_content += "<td>✔</td>"
else:
html_content += "<td>✘</td>"
html_content += "</tr>"

html_content += """
</table>
</body>
</html>
"""

output_file = Path('scoreboard/index.html')
with open(output_file, 'w') as file:
file.write(html_content)

print(f"HTML page generated at {output_file}")
12 changes: 12 additions & 0 deletions scoreboard/static/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
Loading