Skip to content
Snippets Groups Projects
Commit f647b301 authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves:
Browse files

Merge branch 'roneil-lbexec-ganga' into 'master'

Added lbexec ganga workaround to docs

See merge request !732
parents bda07a64 0681de9e
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!732Added lbexec ganga workaround to docs
Pipeline #4454532 passed
......@@ -48,8 +48,8 @@ Make a file named ``my_module.py`` that contains a function that takes an ``opti
Also make a file named ``options.yaml`` containing:
.. code-block:: yaml
.. code-block:: yaml
input_files:
- root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.dst
annsvc_config: root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2_passthrough_thor_lines.tck.json
......@@ -77,3 +77,44 @@ Options YAML
------------
The full schema with which the ``options.yaml`` file is parsed can be found in :class:`~DaVinci.Options`.
Running in Ganga
----------------
Ganga does not support ``lbexec``, yet! A workaround has been prepared, as follows:
1. Add this to the end of your DaVinci options file e.g. ``my_module.py``
.. code-block:: python
import sys
if sys.argv[0].endswith("gaudirun.py"):
import yaml
from DaVinci import Options
with open("options.yaml", "r") as f:
options = Options(**yaml.safe_loads(f))
print_decay_tree(options) # make sure to rename print_decay_tree to whatever your function is called
2. Add ``my_module.py`` to your ``GaudiExec`` application ``options`` list, and ``options.yaml`` to your ``job.inputfiles`` (input sandbox.)
.. code-block:: python
j = Job()
j.backend = Dirac() # as required
j.application = GaudiExec(
dir="DaVinci_v62r0",
platform="x86_64_v3-centos7-gcc11-opt+g"
)
j.application.options = ["my_module.py"]
j.inputdata = ... # as required
j.inputfiles = ["hlt2.tck.json", "options.yaml"] # change as required
j.outputfiles = [DiracFile("*.root"), LocalFile("stdout")] # change as required
# ... configure as required ...
j.submit()
3. Submit your jobs as usual. Note that in ``options.yaml``, ``input_files`` should be set to a dummy value, as it is overwritten later.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment