MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / discover_problems

Function discover_problems

scripts/run_dataset.py:53–77  ·  view source on GitHub ↗

Return a sorted list of problem directories under *benchmark_dir*. Each problem directory must contain definition.json and workload.jsonl. If *categories* is given (e.g. ["L1", "L2"]), only those sub-directories are searched.

(
    benchmark_dir: Path, categories: list[str] | None = None
)

Source from the content-addressed store, hash-verified

51
52
53def discover_problems(
54 benchmark_dir: Path, categories: list[str] | None = None
55) -> list[Path]:
56 """Return a sorted list of problem directories under *benchmark_dir*.
57
58 Each problem directory must contain definition.json and workload.jsonl.
59 If *categories* is given (e.g. ["L1", "L2"]), only those sub-directories are searched.
60 """
61 if categories:
62 roots = [benchmark_dir / c for c in categories]
63 else:
64 roots = sorted(
65 p for p in benchmark_dir.iterdir() if p.is_dir() and p.name in CATEGORIES
66 )
67
68 problems = []
69 for root in roots:
70 if not root.is_dir():
71 continue
72 for problem_dir in sorted(root.iterdir()):
73 defn = problem_dir / "definition.json"
74 wkl = problem_dir / "workload.jsonl"
75 if defn.exists() and wkl.exists():
76 problems.append(problem_dir)
77 return problems
78
79
80# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected