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

Function create_submit_script_body

benchmarks/src/submit/submit.py:46–74  ·  view source on GitHub ↗
(
    header: str,
    options: PBSSubmitOptions,
    identifiers_path: Path,
    submit_options_path: Path,
    directory: Path,
    database_path: Optional[Path] = None,
    resubmit=False,
)

Source from the content-addressed store, hash-verified

44
45
46def create_submit_script_body(
47 header: str,
48 options: PBSSubmitOptions,
49 identifiers_path: Path,
50 submit_options_path: Path,
51 directory: Path,
52 database_path: Optional[Path] = None,
53 resubmit=False,
54) -> str:
55 workdir = Path(os.getcwd()).absolute()
56 resubmit_flag = "--resubmit" if resubmit else "--no-resubmit"
57
58 init_cmd = f"source {options.init_script.absolute()} || exit 1" if options.init_script else ""
59
60 command = f"""{header}
61
62{init_cmd}
63
64cd {workdir} || exit 1
65python {EXECUTE_SCRIPT_PATH} \\
66 --directory {directory} \\
67 --benchmarks {identifiers_path} \\
68 --submit-options {submit_options_path} \\
69 {resubmit_flag}"""
70 if database_path:
71 command += f""" \\
72 --database-path {database_path}"""
73
74 return command
75
76
77def submit(

Callers 1

submitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected