LbProdRun 1.12.2__tar.gz → 1.12.4__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.
Files changed (30) hide show
  1. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/PKG-INFO +1 -1
  2. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun/__init__.py +45 -7
  3. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/PKG-INFO +1 -1
  4. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/.gitattributes +0 -0
  5. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/.gitignore +0 -0
  6. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/.gitlab-ci.yml +0 -0
  7. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/.pre-commit-config.yaml +0 -0
  8. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/.pylintrc +0 -0
  9. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/CONTRIBUTING.md +0 -0
  10. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/LICENSE +0 -0
  11. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/README.md +0 -0
  12. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/pyproject.toml +0 -0
  13. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/setup.cfg +0 -0
  14. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun/__main__.py +0 -0
  15. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun/models.py +0 -0
  16. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/SOURCES.txt +0 -0
  17. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/dependency_links.txt +0 -0
  18. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/entry_points.txt +0 -0
  19. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/requires.txt +0 -0
  20. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/src/LbProdRun.egg-info/top_level.txt +0 -0
  21. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/conftest.py +0 -0
  22. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/examples/prodConf_Moore_00153508_00000001_2.json +0 -0
  23. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/examples/prodConf_Moore_00241952_00148016_1.json +0 -0
  24. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/expected_dumps/00153508_00000001_2_dump.py.zst +0 -0
  25. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/expected_dumps/00241952_00148016_1_dump.json.zst +0 -0
  26. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/test_cli.py +0 -0
  27. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/test_examples.py +0 -0
  28. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/test_franklin.py +0 -0
  29. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/test_gauss.py +0 -0
  30. {lbprodrun-1.12.2 → lbprodrun-1.12.4}/tests/test_options.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LbProdRun
3
- Version: 1.12.2
3
+ Version: 1.12.4
4
4
  Summary: CLI for running LHCb applications from LHCbDIRAC
5
5
  License: GPL-3.0-only
6
6
  Project-URL: Homepage, https://gitlab.cern.ch/lhcb-core/lbprodrun
@@ -66,20 +66,16 @@ def _write_prod_conf_options(job_spec, path: Path, verbose=False):
66
66
  "ProcessingPass": job_spec.options.processing_pass,
67
67
  }
68
68
  if job_spec.input.seeds:
69
- if not job_spec.application.name.lower() != "gauss":
69
+ if job_spec.application.name.lower() != "gauss":
70
70
  raise NotImplementedError(
71
71
  "ProdConf simulation seeds are only supported for Gauss applications"
72
72
  )
73
- if job_spec.input.seeds.max_n_events is None:
74
- raise ValueError(
75
- "Legacy simulation seeds must have max_n_events set for Gauss applications"
76
- )
73
+ max_n_events = job_spec.input.seeds.max_n_events or job_spec.input.n_of_events
77
74
  data["RunNumber"] = (
78
75
  job_spec.input.seeds.production_id * 100 + job_spec.input.seeds.prod_job_id
79
76
  )
80
77
  data["FirstEventNumber"] = (
81
- job_spec.input.seeds.max_n_events * (job_spec.input.seeds.prod_job_id - 1)
82
- + 1
78
+ max_n_events * (job_spec.input.seeds.prod_job_id - 1) + 1
83
79
  )
84
80
  if (
85
81
  job_spec.input.run_number is not None
@@ -243,6 +239,48 @@ def execute(
243
239
  typer.secho("#" * 80)
244
240
  typer.secho("Entering interactive mode, now run:", fg="green")
245
241
  typer.secho(shlex.join(inner_command))
242
+
243
+ # add some examples of useful commands like running valgrind
244
+ # perf, etc:
245
+ typer.secho("\nExamples of useful commands:", fg="green")
246
+ typer.secho("-" * 80)
247
+ typer.secho("Run the application normally:")
248
+ typer.secho(f" {shlex.join(inner_command)}")
249
+ typer.secho()
250
+ typer.secho("Run under valgrind:")
251
+ typer.secho(
252
+ " export VALGRIND_LIB=$(which valgrind | xargs dirname | xargs dirname)/libexec/valgrind"
253
+ )
254
+ typer.secho(
255
+ f" valgrind --tool=memcheck --trace-children=yes --leak-check=full --num-callers=250 --show-leak-kinds=all --track-origins=yes {shlex.join(inner_command)} 2>&1 | tee valgrind_{job_spec.output.prefix}.log"
256
+ )
257
+ typer.secho()
258
+
259
+ def lbconda_which(cmd):
260
+ try:
261
+ import subprocess
262
+
263
+ return (
264
+ subprocess.check_output(
265
+ f"lb-conda default which {cmd}", shell=True, text=True
266
+ )
267
+ .strip()
268
+ .splitlines()[0]
269
+ )
270
+ except Exception:
271
+ return None
272
+
273
+ heaptrack_found = lbconda_which("heaptrack")
274
+ if heaptrack_found:
275
+ typer.secho("Run with heaptrack:")
276
+ typer.secho(f" {shlex.join(inner_command)} &")
277
+ typer.secho(" ATTACH_TO_PID=$!; sleep 2;")
278
+ typer.secho(f" {heaptrack_found} -p $ATTACH_TO_PID")
279
+ typer.secho()
280
+ typer.secho("Run with perf:")
281
+ typer.secho(
282
+ f" perf record -o perf_interactive.data -F 99 -g --call-graph=dwarf,16384 -- {' '.join(inner_command)}"
283
+ )
246
284
  typer.secho("#" * 80)
247
285
  else:
248
286
  typer.secho("Executing command:", fg="green")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LbProdRun
3
- Version: 1.12.2
3
+ Version: 1.12.4
4
4
  Summary: CLI for running LHCb applications from LHCbDIRAC
5
5
  License: GPL-3.0-only
6
6
  Project-URL: Homepage, https://gitlab.cern.ch/lhcb-core/lbprodrun
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