From 93dfef1a749aa55929161c8fc643e56724e4052a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 00:17:42 +0000 Subject: [PATCH] docs: replace the Markdown docs with links to the site - Remove docs/*.md and docs/images/ - Rewrite README.md: description, install, first steps and links to the site - Replace the READMEs of the examples, fairmq/shmem, fairmq/devices and fairmq/tools with links to the site pages Co-Authored-By: Claude Opus 5.5 --- README.md | 178 ++++---------------- docs/Configuration.md | 147 ---------------- docs/Development.md | 58 ------- docs/Device.md | 53 ------ docs/Examples.md | 9 - docs/Logging.md | 103 ----------- docs/Plugins.md | 61 ------- docs/Transport.md | 94 ----------- docs/images/device_states.svg | 1 - docs/images/example_multiple_transports.png | Bin 10957 -> 0 bytes docs/images/example_topology.png | Bin 27853 -> 0 bytes docs/images/transport_interface.png | Bin 30732 -> 0 bytes examples/1-1/README.md | 12 +- examples/1-n-1/README.md | 14 +- examples/builtin-devices/README.md | 8 +- examples/copypush/README.md | 8 +- examples/dds/README.md | 124 +------------- examples/multipart/README.md | 14 +- examples/multiple-channels/README.md | 10 +- examples/multiple-transports/README.md | 14 +- examples/n-m/README.md | 8 +- examples/qc/README.md | 8 +- examples/readout/README.md | 29 +--- examples/region/README.md | 7 +- examples/req-rep/README.md | 8 +- fairmq/devices/README.md | 13 +- fairmq/shmem/README.md | 74 +------- fairmq/tools/README.md | 36 +--- 28 files changed, 108 insertions(+), 983 deletions(-) delete mode 100644 docs/Configuration.md delete mode 100644 docs/Development.md delete mode 100644 docs/Device.md delete mode 100644 docs/Examples.md delete mode 100644 docs/Logging.md delete mode 100644 docs/Plugins.md delete mode 100644 docs/Transport.md delete mode 100644 docs/images/device_states.svg delete mode 100644 docs/images/example_multiple_transports.png delete mode 100644 docs/images/example_topology.png delete mode 100644 docs/images/transport_interface.png diff --git a/README.md b/README.md index ab004b36..994c83e9 100644 --- a/README.md +++ b/README.md @@ -6,168 +6,58 @@ [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B%20%20%E2%97%8F%20%20%E2%97%8F-yellow)](https://github.com/FairRootGroup/FairMQ/actions/workflows/fair-software.yml) [![Spack package](https://repology.org/badge/version-for-repo/spack/fairmq.svg)](https://repology.org/project/fairmq/versions) -C++ Message Queuing Library and Framework +C++ message queuing library and framework for large-scale data processing. -Docs: [Book](https://github.com/FairRootGroup/FairMQ/blob/dev/README.md#documentation) +**Documentation: ** -Find all FairMQ releases [here](https://github.com/FairRootGroup/FairMQ/releases). +FairMQ helps to build data processing workflows of particle physics experiments +from many small processes. Each process is a *device* with a state machine. Devices +send messages to each other through *channels* with the socket patterns of ZeroMQ +(push/pull, pub/sub, req/rep, pair). Each channel uses a *transport*: -## Introduction +* `zeromq` sends the messages through ZeroMQ sockets, also to other hosts. +* `shmem` puts the payload into shared memory and sends only a small header, so + devices on one host exchange data without a copy. -FairMQ is designed to help implementing large-scale data processing workflows needed in next-generation Particle Physics experiments. FairMQ is written in C++ and aims to - * provide **an asynchronous message passing abstraction** of different data transport technologies, - * provide a reasonably **efficient data transport** service (zero-copy, high throughput), - * be **data format agnostic**, and - * provide **basic building blocks** that can be used to implement higher level data processing workflows. +Plugins configure and control the devices. FairMQ was developed in the context of +[FairRoot](https://github.com/FairRootGroup/FairRoot). -The core of FairMQ provides an abstract asynchronous message passing API with scalability protocols -inspired by [ZeroMQ](https://github.com/zeromq/libzmq) (e.g. PUSH/PULL, PUB/SUB). -FairMQ provides multiple implementations for its API (so-called "transports", -e.g. `zeromq` and `shmem` (latest release of the `ofi` transport in v1.4.56, removed since v1.5+)) to cover -a variety of use cases -(e.g. inter-thread, inter-process, inter-node communication) and machines (e.g. Ethernet, Infiniband). -In addition to this core functionality FairMQ provides a framework for creating "devices" - actors which -are communicating through message passing. FairMQ does not only allow the user to use different transport -but also to mix them; i.e: A Device can communicate using different transport on different channels at the -same time. Device execution is modelled as a simple state machine that shapes the integration points for -the user task. Devices also incorporate a plugin system for runtime configuration and control. -Next to the provided [devices](https://github.com/FairRootGroup/FairMQ/tree/master/fairmq/devices) and -[plugins](https://github.com/FairRootGroup/FairMQ/tree/master/fairmq/plugins) the user can extend FairMQ -by developing his own plugins to integrate his devices with external configuration and control services. +## Install -FairMQ has been developed in the context of its mother project [FairRoot](https://github.com/FairRootGroup/FairRoot) - -a simulation, reconstruction and analysis framework. +With [Spack](https://spack.readthedocs.io/en/latest/getting_started.html): -## Installation from Source +```bash +spack install fairmq +``` -Recommended: +From source: ```bash git clone https://github.com/FairRootGroup/FairMQ fairmq_source -cmake -S fairmq_source -B fairmq_build -GNinja -DCMAKE_BUILD_TYPE=Release [-DBUILD_TESTING=ON] +cmake -S fairmq_source -B fairmq_build -GNinja -DCMAKE_BUILD_TYPE=Release cmake --build fairmq_build -[ctest --test-dir fairmq_build --output-on-failure --schedule-random -j] # needs -DBUILD_TESTING=ON cmake --install fairmq_build --prefix $(pwd)/fairmq_install ``` -Please consult the [manpages of your CMake version](https://cmake.org/cmake/help/latest/manual/cmake.1.html) for more options. +The [install page](https://fairrootgroup.github.io/FairMQ/start/install/) lists the +dependencies, the build options and how to run the tests. -If dependencies are not installed in standard system directories, you can hint the installation location via -`-DCMAKE_PREFIX_PATH=...` or per dependency via `-D{DEPENDENCY}_ROOT=...` (`*_ROOT` variables can also be environment variables). +## Get started -## Installation via Spack +* [Your first device](https://fairrootgroup.github.io/FairMQ/start/first-device/): write, build and run a sampler and a sink. +* [Use FairMQ in a CMake project](https://fairrootgroup.github.io/FairMQ/start/cmake/): `find_package(FairMQ)` and the target `FairMQ::FairMQ`. +* [Examples](https://fairrootgroup.github.io/FairMQ/examples/1-1/): the programs in [`examples/`](examples), with their topologies. +* [API reference](https://fairrootgroup.github.io/FairMQ/api/) and [source browser](https://fairrootgroup.github.io/FairMQ/source/). -Prerequisite: [Spack](https://spack.readthedocs.io/en/latest/getting_started.html) +## Releases and support -```bash -spack info fairmq # inspect build options -spack install fairmq # build latest packaged version with default options -``` +Find all releases [on GitHub](https://github.com/FairRootGroup/FairMQ/releases) and the +changes in the [release notes](https://fairrootgroup.github.io/FairMQ/project/release-notes/). +Report bugs and ask questions in the [issues](https://github.com/FairRootGroup/FairMQ/issues). +Read [Contributing](https://fairrootgroup.github.io/FairMQ/project/contributing/) before you +open a pull request. -Build FairMQ's dependencies via Spack for development: -```bash -git clone -b dev https://github.com/FairRootGroup/FairMQ fairmq_source -spack --env fairmq_source install # installs deps declared in fairmq_source/spack.yaml -spack env activate fairmq_source # sets $CMAKE_PREFIX_PATH which is used by CMake to find FairMQ's deps -cmake -S fairmq_source -B fairmq_build -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -# develop, compile, test -spack env deactivate # at end of dev session, or simply close the shell -``` +## License -## Usage - -FairMQ ships as a CMake package, so in your `CMakeLists.txt` you can discover it like this: - -```cmake -find_package(FairCMakeModules 1.0 REQUIRED) -include(FairFindPackage2) -find_package2(FairMQ) -find_package2_implicit_dependencies() -``` - -The [`FairFindPackage2` module](https://fairrootgroup.github.io/FairCMakeModules/latest/module/FairFindPackage2.html) is part of the [`FairCMakeModules` package](https://fairrootgroup.github.io/FairCMakeModules). - -If FairMQ is not installed in system directories, you can hint the installation: - -```cmake -list(PREPEND CMAKE_PREFIX_PATH /path/to/fairmq_install) -``` - -## Dependencies - - * [Boost](https://www.boost.org/) - * [CMake](https://cmake.org/) - * [FairCMakeModules](https://github.com/FairRootGroup/FairCMakeModules) (optionally bundled) - * [FairLogger](https://github.com/FairRootGroup/FairLogger) - * [GTest](https://github.com/google/googletest) (optionally bundled) - * [ZeroMQ](http://zeromq.org/) - - Which dependencies are required depends on which components are built. - - Supported platform is Linux. macOS is supported on a best-effort basis. - -## CMake options - -On command line: - - * `-DDISABLE_COLOR=ON` disables coloured console output. - * `-DBUILD_TESTING=OFF` disables building of tests. - * `-DBUILD_EXAMPLES=OFF` disables building of examples. - * `-DFAIRMQ_CHANNEL_DEFAULT_AUTOBIND=OFF` disable channel `autoBind` by default - * You can hint non-system installations for dependent packages, see the #installation-from-source section above - -After the `find_package(FairMQ)` call the following CMake variables are defined: - -| Variable | Info | -| --- | --- | -| `${FairMQ_PACKAGE_DEPENDENCIES}` | the list of public package dependencies | -| `${FairMQ__VERSION}` | the minimum `` version FairMQ requires | -| `${FairMQ__COMPONENTS}` | the list of `` components FairMQ depends on | -| `${FairMQ_PACKAGE_COMPONENTS}` | the list of components FairMQ consists of | -| `${FairMQ_#COMPONENT#_FOUND}` | `TRUE` if this component was built | -| `${FairMQ_VERSION}` | the version in format `MAJOR.MINOR.PATCH` | -| `${FairMQ_GIT_VERSION}` | the version in the format returned by `git describe --tags --dirty --match "v*"` | -| `${FairMQ_PREFIX}` | the actual installation prefix | -| `${FairMQ_BINDIR}` | the installation bin directory | -| `${FairMQ_INCDIR}` | the installation include directory | -| `${FairMQ_LIBDIR}` | the installation lib directory | -| `${FairMQ_DATADIR}` | the installation data directory (`../share/fairmq`) | -| `${FairMQ_CMAKEMODDIR}` | the installation directory of shipped CMake find modules | -| `${FairMQ_BUILD_TYPE}` | the value of `CMAKE_BUILD_TYPE` at build-time | -| `${FairMQ_CXX_FLAGS}` | the values of `CMAKE_CXX_FLAGS` and `CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}` at build-time | - -## Documentation - -1. [Device](docs/Device.md#1-device) - 1. [Topology](docs/Device.md#11-topology) - 2. [Communication Patterns](docs/Device.md#12-communication-patterns) - 3. [State Machine](docs/Device.md#13-state-machine) - 4. [Multiple devices in the same process](docs/Device.md#15-multiple-devices-in-the-same-process) -2. [Transport Interface](docs/Transport.md#2-transport-interface) - 1. [Message](docs/Transport.md#21-message) - 1. [Ownership](docs/Transport.md#211-ownership) - 2. [Channel](docs/Transport.md#22-channel) - 3. [Poller](docs/Transport.md#23-poller) -3. [Configuration](docs/Configuration.md#3-configuration) - 1. [Device Configuration](docs/Configuration.md#31-device-configuration) - 2. [Communication Channels Configuration](docs/Configuration.md#32-communication-channels-configuration) - 1. [JSON Parser](docs/Configuration.md#321-json-parser) - 2. [SuboptParser](docs/Configuration.md#322-suboptparser) - 3. [Introspection](docs/Configuration.md#33-introspection) -4. [Development](docs/Development.md#4-development) - 1. [Testing](docs/Development.md#41-testing) - 2. [Static Analysis](docs/Development.md#42-static-analysis) - 1. [CMake Integration](docs/Development.md#421-cmake-integration) - 2. [Extra Compiler Arguments](docs/Development.md#422-extra-compiler-arguments) -5. [Logging](docs/Logging.md#5-logging) - 1. [Log severity](docs/Logging.md#51-log-severity) - 2. [Log verbosity](docs/Logging.md#52-log-verbosity) - 3. [Color for console output](docs/Logging.md#53-color) - 4. [File output](docs/Logging.md#54-file-output) - 5. [Custom sinks](docs/Logging.md#55-custom-sinks) -6. [Examples](docs/Examples.md#6-examples) -7. [Plugins](docs/Plugins.md#7-plugins) - 1. [Usage](docs/Plugins.md#71-usage) - 2. [Development](docs/Plugins.md#72-development) - 3. [Provided Plugins](docs/Plugins.md#73-provided-plugins) - 1. [PMIx](docs/Plugins.md#731-pmix) +FairMQ is free software under the [LGPL-3.0](LICENSE). See [COPYRIGHT](COPYRIGHT) and +[how to cite FairMQ](https://fairrootgroup.github.io/FairMQ/project/license/). diff --git a/docs/Configuration.md b/docs/Configuration.md deleted file mode 100644 index d1c56306..00000000 --- a/docs/Configuration.md +++ /dev/null @@ -1,147 +0,0 @@ -← [Back](../README.md) - -# 3. Configuration - -## 3.1 Device Configuration - -Device Configuration is stored in configuration object - `fair::mq::ProgOptions`. It is accessible by the device, plugins or from DeviceRunner/main: - -Plugins <---read/write---> ProgOptions <---read/write---> Device - -Whenever a configuration property is set, it is set in ProgOptions. Device/Channels/User code read this value and apply it as necessary at different stages: - - apply it immidiately - - apply it in device/channels during InitializingDevice/Binding/Connecting states - -Here is an overview of the device/channel options and when they are applied: - -| Property | Applied in | -| --- | --- | -| `severity` | immidiately (if `fair::mq::DeviceRunner` is used (also the case when using ``)) | -| `file-severity` | immidiately (if `fair::mq::DeviceRunner` is used (also the case when using ``)) | -| `verbosity` | immidiately (if `fair::mq::DeviceRunner` is used (also the case when using ``)) | -| `color` | immidiately (if `fair::mq::DeviceRunner` is used (also the case when using ``)) | -| `log-to-file` | immidiately (if `fair::mq::DeviceRunner` is used (also the case when using ``)) | -| `id` | at the end of `fair::mq::State::InitializingDevice` | -| `io-threads` | at the end of `fair::mq::State::InitializingDevice` | -| `transport` | at the end of `fair::mq::State::InitializingDevice` | -| `network-interface` | at the end of `fair::mq::State::InitializingDevice` | -| `init-timeout` | at the end of `fair::mq::State::InitializingDevice` | -| `shm-segment-size` | at the end of `fair::mq::State::InitializingDevice` | -| `shm-monitor` | at the end of `fair::mq::State::InitializingDevice` | -| `rate` | at the end of `fair::mq::State::InitializingDevice` | -| `session` | at the end of `fair::mq::State::InitializingDevice` | -| `chan.*` | at the end of `fair::mq::State::InitializingDevice` (channel addresses can be also applied during `fair::mq::State::Binding`/`fair::mq::State::Connecting`) | - -## 3.2 Configuration options - -## 3.2 Communication Channels Configuration - -The communication channels can be configured via configuration parsers. The parser system is extendable, so if provided parsers do not suit your style, you can write your own and plug them in the configuration system. - -The provided parsers are: - -### 3.2.1 JSON Parser - -This parser reads channel configuration from a JSON file. Example: - -```JSON -{ - "fairMQOptions": { - "devices": [ - { - "id": "sampler1", - "channels": [ - { - "name": "data", - "sockets": [ - { - "type": "push", - "method": "bind", - "address": "tcp://*:5555", - "sndBufSize": 1000, - "rcvBufSize": 1000, - "sndKernelSize" : 0, - "rcvKernelSize" : 0, - "transport": "shmem", - "linger": "500", - "portRangeMin": "22000", - "portRangeMax": "23000", - "autoBind": false, - "numSockets": 0, - "rateLogging": 1 - } - ] - } - ] - }, - { - "id": "sink1", - "channels": [ - { - "name": "data", - "sockets": [ - { - "type": "pull", - "method": "connect", - "address": "tcp://localhost:5555", - "transport": "shmem" - } - ] - } - ] - } - ] - } -} -``` - -The JSON file can contain configuration for multiple devices. - -- The mapping between device and configuration happens via the device ID (the `--id` parameter of the launched device and the `"id"` entry in the config). -- Instead of `"id"`, JSON file may contain device configurations under `"key"`, which allows launched devices to share configuration, e.g.: `my-device-executable --id --config-key `. -- Socket options must contain at least *type*, *method* and *address*, the rest of the values are optional and will get default values of the channel. -- If a channel has multiple sub-channels, common properties can be defined under channel directly, and will be shared by all sub-channels, e.g.: - -```JSON -"channels": [{ - "name": "data", - "type": "push", - "method": "bind", - "sockets": [{ - "address": "tcp://*:5555", - "address": "tcp://*:5556", - "address": "tcp://*:5557" - }] -}] -``` - -### 3.2.2 SuboptParser - -This parser configures channels directly from the command line. -The parser handles a comma separated key=value list format by using the getsubopt function of the standard library. -The option key `--channel-config` can be used with the list of key/value pairs, e.g.: - -``` ---channel-config name=output,type=push,method=bind,address=tcp://127.0.0.1:5555 -``` - -## 3.3 Introspection - -A compiled device executable repots its available configuration. Run the device with one of the following options to see the corresponding help: - -- `-h [ --help ]`: All available command line options with their descriptions and default values. - -- `--print-options`: All available command line options in a machine-readable format: `