Skip to content

Commit

Permalink
Added k4run documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Aug 4, 2023
1 parent 4d39c78 commit 45ffd45
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# k4FWCore (key4hep FrameWork Core)

k4FWCore is a Gaudi package that provides the PodioDataService, that allows to
k4FWCore is a Gaudi package that provides the PodioDataService, which allows to
use podio-based event data models like EDM4hep in Gaudi workflows.

k4FWCore also provides the `k4run` script used to run Gaudi steering files.

## Components

### Basic I/O
Expand All @@ -13,12 +15,38 @@ Component wrapping the PodioDataService to handle PODIO types and collections.

#### PodioInput

Algorithm to read data from input file(s) on disk.
Algorithm to read data from one or multiple input file(s) on disk.

#### PodioOutput

Algorithm to write data to output file on disk.
Algorithm to write data to an output file on disk.

## k4run
```bash
$ k4run --help
usage: k4run [-h] [--dry-run] [-v] [-n NUM_EVENTS] [-l] [--gdb] [--ncpus NCPUS] [config_files ...]

Run job in the Key4HEP framework

positional arguments:
config_files Gaudi config (python) files describing the job

options:
-h, --help show this help message and exit
--dry-run Do not actually run the job, just parse the config files
-v, --verbose Run job with verbose output
-n NUM_EVENTS, --num-events NUM_EVENTS
Number of events to run
-l, --list Print all the configurable components available in the framework and exit
--gdb Attach gdb debugger
--ncpus NCPUS Start Gaudi in parallel mode using NCPUS processes. 0 => serial mode (default), -1 => use all CPUs
```
When supplied with a Gaudi steering file `k4run --help file.py` also shows the settable properties of the Gaudi algorithms used in the file. Additionally, it is possible to add further arguments and use them in the steering file by using the python `argparse.ArgumentParser` shared by `k4run`.
```python
parser.add_argument("-f", "--foo", type=int, help="hello world")
my_opts = parser.parse_known_args()
print(my_opts[0].foo)
```

## Dependencies

Expand All @@ -30,7 +58,7 @@ Algorithm to write data to output file on disk.

## Installation and downstream usage.

k4FWCore is a cmake project. After setting up the dependencies (use for example `source /cvmfs/sw.hsf.org/key4hep/setup.sh`)
k4FWCore is a CMake project. After setting up the dependencies (use for example `source /cvmfs/sw.hsf.org/key4hep/setup.sh`)


```
Expand Down

0 comments on commit 45ffd45

Please sign in to comment.