Skip to content

Framework-R-D/phlex-examples

Repository files navigation

Phlex examples

This repository contains examples of the use of the Phlex framework.

Building this repository

To use the code in this repository, first install it:

git clone https://github.com/Framework-R-D/phlex-examples.git

Now create a build directory:

mkdir build-phlex-examples
cd build-phlex-examples

The repository can now be easily built by activating the environment you created when installing Phlex:

spack env activate my-phlex-environment
spack load cmake
cmake ../phlex-example
make -j

Running the code

You should now be able to run a simple phlex job:

Job with C++ algorithms

$ phlex -c ~/phlex-examples/test-cpp-workflow.jsonnet
Using configuration file: /.../phlex-examples/test-cpp-workflow.jsonnet
[2025-12-22 13:17:51.496] [info] Number of worker threads: 24
Registering FORM output module...
Configuration:
  output_file: output.root
  technology: ROOT_TTREE
FormOutputModule initialized

[2025-12-22 13:17:51.760] [info]
Processed layers:

  job

   └ spill: 10

[2025-12-22 13:17:51.760] [info] CPU time: 0.21204s  Real time: 0.26498s  CPU efficiency:  80.02%
[2025-12-22 13:17:51.760] [info] Max. RSS: 268.848 MB

Job with Python algorithms

To run a job that uses a Python algorithm, the PYTHONPATH environment variable must be adjusted to include the directory with the Python module:

$ PYTHONPATH=$(realpath ~/phlex-examples):$PYTHONPATH
$ phlex -c ~/phlex-examples/test-py-workflow.jsonnet
Using configuration file: /home/knoepfel/phlex-examples/test-py-workflow.jsonnet
[2025-12-22 13:50:07.999] [info] Number of worker threads: 24
[2025-12-22 13:50:08.013] [info]
Processed layers:

  job

[2025-12-22 13:50:08.013] [info] CPU time: 0.01022s  Real time: 0.01483s  CPU efficiency:  68.91%
[2025-12-22 13:50:08.013] [info] Max. RSS: 29.628 MB

Note

For Phlex 0.1.0, Python data products:

  • Cannot be written to output files
  • Must belong to the "job" data layer

About

Examples for the use of the Phlex framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published