| 100 | |
| 101 | @app.command(name=case.name()) |
| 102 | def command( |
| 103 | workdir: Optional[Path] = None, |
| 104 | queue: Optional[str] = None, |
| 105 | project: Optional[str] = None, |
| 106 | init_script: Optional[Path] = None, |
| 107 | node_count: Optional[int] = 1, |
| 108 | walltime_h: Optional[int] = 1, |
| 109 | wait: bool = False, |
| 110 | clear: bool = False, |
| 111 | postprocess_only: bool = False, |
| 112 | ): |
| 113 | if workdir is None: |
| 114 | workdir = case.get_workdir() |
| 115 | workdir = workdir.absolute() |
| 116 | if clear: |
| 117 | shutil.rmtree(workdir, ignore_errors=True) |
| 118 | |
| 119 | if queue is not None or project is not None or init_script is not None: |
| 120 | assert queue is not None and project is not None and init_script is not None |
| 121 | slurm = SlurmCliOptions( |
| 122 | queue=queue, |
| 123 | project=project, |
| 124 | init_script=init_script, |
| 125 | node_count=node_count, |
| 126 | wait_for_job=wait, |
| 127 | walltime_h=walltime_h, |
| 128 | ) |
| 129 | else: |
| 130 | slurm = None |
| 131 | |
| 132 | run_test_case( |
| 133 | workdir=workdir, |
| 134 | case=case, |
| 135 | slurm_cli=slurm, |
| 136 | postprocess_only=postprocess_only, |
| 137 | ) |
| 138 | |
| 139 | command.__doc__ = f""" |
| 140 | Run the {case.name()} benchmark. |