mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
# Generic Devices
|
||||
# Built-in devices
|
||||
|
||||
With FairMQ several generic devices are provided:
|
||||
This folder holds the devices that FairMQ installs as programs: `fairmq-bsampler`, `fairmq-sink`, `fairmq-merger`, `fairmq-splitter`, `fairmq-multiplier` and `fairmq-proxy`.
|
||||
|
||||
- **BenchmarkSampler**: generates random data of configurable size and at configurable rate and sends it out on an output channel.
|
||||
- **Sink**: receives messages on the input channel and simply discards them.
|
||||
- **Merger**: receives data from multiple input channels and forwards it to a single output channel.
|
||||
- **Splitter**: receives messages on a single input channels and round-robins them among multiple output channels (which can have different socket types).
|
||||
- **Multiplier**: receives data from a single input channel and multiplies (copies) it to two or more output channels.
|
||||
- **Proxy**: connects input channel to output channel, where both can have different socket types and multiple peers.
|
||||
* [Built-in devices](https://fairrootgroup.github.io/FairMQ/tools/builtin-devices/)
|
||||
* [Run a benchmark](https://fairrootgroup.github.io/FairMQ/guides/benchmark/)
|
||||
* [builtin-devices: a topology of built-in devices](https://fairrootgroup.github.io/FairMQ/examples/builtin-devices/)
|
||||
|
||||
@@ -1,67 +1,11 @@
|
||||
## Shared Memory transport
|
||||
# Shared memory transport
|
||||
|
||||
Shared memory transport for FairMQ. To try with existing devices, run the devices with `--transport shmem` option or configure channel transport in JSON (see examples/MQ/multiple-transports).
|
||||
This folder holds the `shmem` transport. The documentation explains it:
|
||||
|
||||
The transport manages shared memory via boost::interprocess library. The transfer of the meta data, required to locate the content in the shared memory, is done via ZeroMQ. The transport supports all communication patterns where a single message is received by a single receiver. For multiple receivers for the same message, the message has to be copied.
|
||||
|
||||
Devices track and cleanup shared memory on shutdown. For more information on the current shared memory segment and additional cleanup options, see following section.
|
||||
|
||||
## Shared Memory objects / files
|
||||
|
||||
FairMQ Shared Memory currently uses the following names to register shared memory on the system:
|
||||
|
||||
| name | info | created by | used by |
|
||||
| --------------------------- | ---------------------------------------------- | ------------------ | ------------------------------ |
|
||||
| `fmq_<shmId>_m_<segmentId>` | managed segment(s) (user data) | one of the devices | devices |
|
||||
| `fmq_<shmId>_mng` | management segment (management data) | one of the devices | devices |
|
||||
| `fmq_<shmId>_rg_<index>` | unmanaged region(s) | one of the devices | devices with unmanaged regions |
|
||||
| `fmq_<shmId>_rgq_<index>` | unmanaged region queue(s) | one of the devices | devices with unmanaged regions |
|
||||
| `fmq_<shmId>_rrc_<index>` | unmanaged region reference count pool(s) | one of the devices | devices with unmanaged regions |
|
||||
| `fmq_<shmId>_ms` | shmmonitor status | shmmonitor | devices, shmmonitor |
|
||||
|
||||
The shmId is generated out of session id and user id.
|
||||
|
||||
## Shared memory monitor
|
||||
|
||||
The shared memory monitor tool (`fairmq-shmmonitor`) can be used to monitor and cleanup the created shared memory.
|
||||
|
||||
Most commands act for the specified session, identified either via session id (`--session`,`-s`) or shmid (`--shmid`).
|
||||
|
||||
The monitor runs in one of the following modes:
|
||||
|
||||
| command | action |
|
||||
| --------------------------- | ---------------------------------------------- |
|
||||
| no args | Print segment info of the specified session/shm ID and exit. |
|
||||
| `--view`,`-v` | Print segment info of the specified session/shm ID and exit. |
|
||||
| `--interactive`,`-i` | Print segment info of the specified session/shm ID at a given interval (`--interval`), with some keyboard controls. Can be combined with `--view` for read-only access (and avoid receiving heartbeats). |
|
||||
| `--monitor`,`-m` | Monitor the session shm usage by receiving heartbeats from shmem users, cleaning it up if no heartbeats arrived within configured timeout (`--timeout`/`-t`). Only one heartbeat receiver per session is currently possible. If `--self-destruct`/`-x` is added, monitor will exit either when (a) no shm has been observed for interval * 2, (b) a cleanup due to reached timeout has been performed, or (c) shm has been observed, but is now cleaned up. |
|
||||
| `--cleanup`,`-c` | Cleanup the shm for the specified session and exit. |
|
||||
| `--debug`,`-b` | Print the list of messages in the current session and exit. Only availabe when FairMQ is compiled with `FAIRMQ_DEBUG_MODE=ON` (high performance impact). |
|
||||
| `--get-shmid` | Translate given session id and user id (`--user-id`) to a shmem id (uses current user id if none provided) and exit. |
|
||||
| `--list-all` | Print segment info for all sessions present on the system and exit. |
|
||||
|
||||
Additional cmd options:
|
||||
|
||||
| command | action |
|
||||
| --------------------------- | ---------------------------------------------- |
|
||||
| `--cleanup-on-exit` | Perform a cleanup on exit, when running in monitoring or interactive mode. |
|
||||
| `--daemonize`,`-d` | Can be combined with the monitoring mode to detach the process from the parent. |
|
||||
| `--verbose`,`-d` | When running as a daemon, store monitor output in `fairmq-shmmonitor_<timestamp>.log` |
|
||||
|
||||
For full option details, run with `-h`.
|
||||
|
||||
The Monitor class can also be used independently from the supplied executable, allowing integration on any level.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Bus Error (SIGBUS) can occur if the transport tries to access shared memory that is not accessible. One reason could be because the used memory in the segment exceeds the capacity or available memory of the shmem filesystem (capacity is by default set to half of RAM on Linux).
|
||||
|
||||
## Shared Memory cleanup
|
||||
|
||||
On a graceful shutdown of all devices, shared memory transport removes all created shared memory files. In case of a crash however, the cleanup cannot be guaranteed. Following possibilites are available to perform cleanup in case of crashes:
|
||||
|
||||
- For execution with Slurm a [job_container](https://slurm.schedmd.com/job_container.conf.html) can be used, which can isolate the shm and remove them upon job finish. This is currently the recommended approach.
|
||||
- a [trap](https://www.man7.org/linux/man-pages/man1/trap.1p.html) in an executing script on ERR/EXIT with a call to `fairmq-shmmonitor -c -s <sessionid>`. This would not work if the script is killed with -SIGKILL or similar fashion where it cannot call the trap.
|
||||
- [CTest cleanup fixture](https://cmake.org/cmake/help/latest/prop_test/FIXTURES_CLEANUP.html) with a call to `fairmq-shmmonitor -c -s <sessionid>`. This would work for an ongoing ctest run, but would not be called if a test run is interrupted, e.g. by SIGINT.
|
||||
- manual cleanup of the files listed [above](#shared-memory-objects--files).
|
||||
- Launch devices with `--shm-monitor true`. This will launch a daemon. The daemon will then listen for heartbeats from devices (every 100ms) and if none are received within 2000ms, will clean the memory. This is unreliable because the daemon can also be killed by a strict enough controller. But also if for some reason there are significant delays in the heartbeats, shmem could end up being cleaned before it should be.
|
||||
* [How shared memory works](https://fairrootgroup.github.io/FairMQ/shmem/how-it-works/)
|
||||
* [Sessions and segments](https://fairrootgroup.github.io/FairMQ/shmem/sessions/)
|
||||
* [Unmanaged regions](https://fairrootgroup.github.io/FairMQ/shmem/regions/)
|
||||
* [Out-of-band buffers](https://fairrootgroup.github.io/FairMQ/shmem/side-channel/)
|
||||
* [Monitor and clean up](https://fairrootgroup.github.io/FairMQ/shmem/monitor/)
|
||||
* [Tune and debug](https://fairrootgroup.github.io/FairMQ/shmem/tuning/)
|
||||
* [fairmq-shmmonitor](https://fairrootgroup.github.io/FairMQ/tools/shmmonitor/)
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
# FairMQ Tools
|
||||
# Tools
|
||||
|
||||
Contains common tools for use by FairMQ and/or users.
|
||||
This folder holds the helpers in `fair::mq::tools`. The documentation lists them:
|
||||
|
||||
## fair::mq::tools::getHostIPs
|
||||
|
||||
Fills a map with the network interfaces and their IP addresses available on the current host.
|
||||
|
||||
#### Example usage
|
||||
|
||||
```c++
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include <fairmq/Tools.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
std::map<string,string> IPs;
|
||||
|
||||
fair::mq::tools::getHostIPs(IPs);
|
||||
|
||||
for (std::map<string,string>::iterator it = IPs.begin(); it != IPs.end(); ++it)
|
||||
{
|
||||
std::cout << it->first << ": " << it->second << std::endl;
|
||||
}
|
||||
}
|
||||
```
|
||||
##### Example Output
|
||||
```
|
||||
eth0: 123.123.1.123
|
||||
ib0: 123.123.2.123
|
||||
lo: 127.0.0.1
|
||||
```
|
||||
* [Helpers in fair::mq::tools](https://fairrootgroup.github.io/FairMQ/reference/tools/)
|
||||
|
||||
Reference in New Issue
Block a user