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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LbProdRun
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: CLI for running LHCb applications from LHCbDIRAC
5
5
  Home-page: https://gitlab.cern.ch/lhcb-core/lbprodrun
6
6
  License: GPL-3.0-only
@@ -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.number_of_processors > 1:
239
- command += ["--ncpus", f"{job_spec.application.number_of_processors}"]
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 _is_new_style(name: str, version: str) -> bool:
261
- """Determine if a given application/version combination should use lbexec"""
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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LbProdRun
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: CLI for running LHCb applications from LHCbDIRAC
5
5
  Home-page: https://gitlab.cern.ch/lhcb-core/lbprodrun
6
6
  License: GPL-3.0-only
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