MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / run_test_case

Function run_test_case

benchmarks/src/cli.py:59–94  ·  view source on GitHub ↗
(
    workdir: Path,
    case: TestCase,
    slurm_cli: Optional[SlurmCliOptions] = None,
    postprocess_only: bool = False,
)

Source from the content-addressed store, hash-verified

57
58
59def run_test_case(
60 workdir: Path,
61 case: TestCase,
62 slurm_cli: Optional[SlurmCliOptions] = None,
63 postprocess_only: bool = False,
64):
65 descriptors = list(case.generate_descriptors())
66 has_work = has_work_left(workdir, descriptors)
67
68 def compute():
69 if has_work and not postprocess_only:
70 database = run_benchmarks_with_postprocessing(workdir, descriptors)
71 else:
72 database = load_or_create_database(workdir)
73
74 # Keep only results that we are interested in, there might be some old stale results
75 identifiers = [instance.identifier for instance in create_benchmark_instances(descriptors, workdir=workdir)]
76 database = database.filter(identifiers)
77 case.postprocess(workdir=workdir, database=database)
78
79 if not postprocess_only and has_work and slurm_cli is not None:
80 run_in_slurm(
81 SlurmOptions(
82 name="slurm-auto-submit",
83 queue=slurm_cli.queue,
84 project=slurm_cli.project,
85 walltime=datetime.timedelta(hours=slurm_cli.walltime_h),
86 init_script=slurm_cli.init_script.absolute(),
87 node_count=slurm_cli.node_count,
88 workdir=Path("slurm").absolute(),
89 wait_for_job=slurm_cli.wait_for_job,
90 ),
91 compute,
92 )
93 else:
94 compute()
95
96
97def register_case(app: Typer):

Callers 1

commandFunction · 0.85

Calls 5

has_work_leftFunction · 0.85
run_in_slurmFunction · 0.85
SlurmOptionsClass · 0.85
computeFunction · 0.70
generate_descriptorsMethod · 0.45

Tested by

no test coverage detected