LbProdRun 1.5.2__tar.gz → 1.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {LbProdRun-1.5.2/src/LbProdRun.egg-info → lbprodrun-1.7.0}/PKG-INFO +1 -1
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun/__init__.py +34 -4
- {LbProdRun-1.5.2 → lbprodrun-1.7.0/src/LbProdRun.egg-info}/PKG-INFO +1 -1
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/.gitignore +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/.gitlab-ci.yml +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/.pre-commit-config.yaml +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/.pylintrc +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/CONTRIBUTING.md +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/LICENSE +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/README.md +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/pyproject.toml +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/setup.cfg +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun/__main__.py +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun/models.py +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/SOURCES.txt +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/dependency_links.txt +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/entry_points.txt +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/requires.txt +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/top_level.txt +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/tests/test_cli.py +0 -0
- {LbProdRun-1.5.2 → lbprodrun-1.7.0}/tests/test_options.py +0 -0
|
@@ -54,6 +54,10 @@ def _write_prod_conf_options(job_spec, path: Path, verbose=False):
|
|
|
54
54
|
"TCK": job_spec.input.tck,
|
|
55
55
|
"ProcessingPass": job_spec.options.processing_pass,
|
|
56
56
|
}
|
|
57
|
+
if _uses_gaudi_mp(job_spec.application.name, job_spec.application.version):
|
|
58
|
+
data["NThreads"] = 1
|
|
59
|
+
else:
|
|
60
|
+
data["NThreads"] = job_spec.application.number_of_processors
|
|
57
61
|
|
|
58
62
|
lines = ["from ProdConf import ProdConf", ""]
|
|
59
63
|
lines += ["ProdConf("]
|
|
@@ -234,8 +238,9 @@ def _make_gaudirun_command(job_spec):
|
|
|
234
238
|
|
|
235
239
|
command = []
|
|
236
240
|
command += job_spec.options.command
|
|
237
|
-
if job_spec.application.
|
|
238
|
-
|
|
241
|
+
if _uses_gaudi_mp(job_spec.application.name, job_spec.application.version):
|
|
242
|
+
if job_spec.application.number_of_processors > 1:
|
|
243
|
+
command += ["--ncpus", f"{job_spec.application.number_of_processors}"]
|
|
239
244
|
command += job_spec.options.files
|
|
240
245
|
command += [str(prod_conf_fn)]
|
|
241
246
|
|
|
@@ -256,8 +261,12 @@ def _make_gaudirun_command(job_spec):
|
|
|
256
261
|
return command
|
|
257
262
|
|
|
258
263
|
|
|
259
|
-
def
|
|
260
|
-
"""
|
|
264
|
+
def _parse_version(version: str) -> Union[Version, bool]:
|
|
265
|
+
"""Parse a version string into a Version object
|
|
266
|
+
|
|
267
|
+
If this fails, it will return a bool indicating a safe default value
|
|
268
|
+
for if an application supports modern features or not.
|
|
269
|
+
"""
|
|
261
270
|
try:
|
|
262
271
|
parsed_version = Version(re.sub(r"[^\d]+", ".", version).strip("."))
|
|
263
272
|
except Exception: # pylint: disable=broad-except
|
|
@@ -265,6 +274,14 @@ def _is_new_style(name: str, version: str) -> bool:
|
|
|
265
274
|
if version == "HEAD":
|
|
266
275
|
return True
|
|
267
276
|
return False
|
|
277
|
+
return parsed_version
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def _is_new_style(name: str, version: str) -> bool:
|
|
281
|
+
"""Determine if a given application/version combination should use lbexec"""
|
|
282
|
+
parsed_version = _parse_version(version)
|
|
283
|
+
if isinstance(parsed_version, bool):
|
|
284
|
+
return parsed_version
|
|
268
285
|
|
|
269
286
|
version_compatibility: dict[str, Union[bool, Version]] = {
|
|
270
287
|
"Analysis": Version("40"),
|
|
@@ -292,6 +309,19 @@ def _is_new_style(name: str, version: str) -> bool:
|
|
|
292
309
|
return is_new_style < parsed_version
|
|
293
310
|
|
|
294
311
|
|
|
312
|
+
def _uses_gaudi_mp(name: str, version: str) -> bool:
|
|
313
|
+
parsed_version = _parse_version(version)
|
|
314
|
+
if isinstance(parsed_version, bool):
|
|
315
|
+
return parsed_version
|
|
316
|
+
|
|
317
|
+
# Gauss v60+ supports multi-threading despite still using ProdConf
|
|
318
|
+
if name == "Gauss":
|
|
319
|
+
return parsed_version < Version("60")
|
|
320
|
+
|
|
321
|
+
# Otherwise assume only lbexec-style applications support native multi-threading
|
|
322
|
+
return _is_new_style(name, version)
|
|
323
|
+
|
|
324
|
+
|
|
295
325
|
def _prepare_env():
|
|
296
326
|
"""Get a dictionary containing the environment that should be used for the job"""
|
|
297
327
|
env = os.environ.copy()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|