LbProdRun 1.6.0__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.6.0/src/LbProdRun.egg-info → lbprodrun-1.7.0}/PKG-INFO +1 -1
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun/__init__.py +34 -5
- {LbProdRun-1.6.0 → lbprodrun-1.7.0/src/LbProdRun.egg-info}/PKG-INFO +1 -1
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/.gitignore +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/.gitlab-ci.yml +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/.pre-commit-config.yaml +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/.pylintrc +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/CONTRIBUTING.md +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/LICENSE +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/README.md +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/pyproject.toml +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/setup.cfg +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun/__main__.py +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun/models.py +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/SOURCES.txt +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/dependency_links.txt +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/entry_points.txt +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/requires.txt +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/src/LbProdRun.egg-info/top_level.txt +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/tests/test_cli.py +0 -0
- {LbProdRun-1.6.0 → lbprodrun-1.7.0}/tests/test_options.py +0 -0
|
@@ -53,8 +53,11 @@ def _write_prod_conf_options(job_spec, path: Path, verbose=False):
|
|
|
53
53
|
"FirstEventNumber": job_spec.input.first_event_number,
|
|
54
54
|
"TCK": job_spec.input.tck,
|
|
55
55
|
"ProcessingPass": job_spec.options.processing_pass,
|
|
56
|
-
"NThreads": job_spec.application.number_of_processors,
|
|
57
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
|
|
58
61
|
|
|
59
62
|
lines = ["from ProdConf import ProdConf", ""]
|
|
60
63
|
lines += ["ProdConf("]
|
|
@@ -235,8 +238,9 @@ def _make_gaudirun_command(job_spec):
|
|
|
235
238
|
|
|
236
239
|
command = []
|
|
237
240
|
command += job_spec.options.command
|
|
238
|
-
if job_spec.application.
|
|
239
|
-
|
|
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}"]
|
|
240
244
|
command += job_spec.options.files
|
|
241
245
|
command += [str(prod_conf_fn)]
|
|
242
246
|
|
|
@@ -257,8 +261,12 @@ def _make_gaudirun_command(job_spec):
|
|
|
257
261
|
return command
|
|
258
262
|
|
|
259
263
|
|
|
260
|
-
def
|
|
261
|
-
"""
|
|
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
|
+
"""
|
|
262
270
|
try:
|
|
263
271
|
parsed_version = Version(re.sub(r"[^\d]+", ".", version).strip("."))
|
|
264
272
|
except Exception: # pylint: disable=broad-except
|
|
@@ -266,6 +274,14 @@ def _is_new_style(name: str, version: str) -> bool:
|
|
|
266
274
|
if version == "HEAD":
|
|
267
275
|
return True
|
|
268
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
|
|
269
285
|
|
|
270
286
|
version_compatibility: dict[str, Union[bool, Version]] = {
|
|
271
287
|
"Analysis": Version("40"),
|
|
@@ -293,6 +309,19 @@ def _is_new_style(name: str, version: str) -> bool:
|
|
|
293
309
|
return is_new_style < parsed_version
|
|
294
310
|
|
|
295
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
|
+
|
|
296
325
|
def _prepare_env():
|
|
297
326
|
"""Get a dictionary containing the environment that should be used for the job"""
|
|
298
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
|