Commit Graph

82 Commits

Author SHA1 Message Date
Alexey Rybalchenko
a53ef79552 Run state handlers on the main thread (breaking change for control). 2018-08-08 16:13:41 +02:00
Alexey Rybalchenko
653e82cab4 Avoid copy (where possible) when switching transports 2018-06-08 13:10:06 +02:00
Alexey Rybalchenko
2894af803b Add getter for cmd line args & align channel names in log 2018-06-06 16:04:08 +02:00
Alexey Rybalchenko
d93dc2f7f7 Use enum transport types instead of strings in Channel/Device 2018-05-15 19:18:11 +02:00
Alexey Rybalchenko
7a4fd96b27 Fix namespaces in Transports.h and add conversion map 2018-05-15 19:18:11 +02:00
Alexey Rybalchenko
155618af57 Used cached default transport in FairMQDevice::Transport() 2018-05-15 19:18:11 +02:00
Alexey Rybalchenko
a5ff7d5a1e Add resolver for hostname -> ip, use it before bind/connect 2018-05-03 18:33:13 +02:00
Alexey Rybalchenko
bab7e13737 Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Alexey Rybalchenko
fed7601be4 replace cmd socket with transport specific unblock mechanism 2018-03-26 13:58:20 +02:00
Dennis Klein
e73fcbd595 FairMQ: Parameterize the command interface initializing with sub socket
! THIS PATCH BREAKS NANOMSG TRANSPORT !

The subscriber command socket was created using the transport factory of
the channel which might not implement sub sockets. This patch creates
the subscriber command sockets in the device initialization and passes
them down (move) to the command interface initialization.

This patch puts more focus on the GetSocket interface of FairMQSocket,
because all command sockets are now implemented with the default
transport - the channels use an internal poller which polls over sockets
of potentially different transports now (e.g. zeromq command socket and
nanomsg data socket). Basically, all transports need to return file
descriptors compatible to be used in a single poll set. THIS IS NOT THE CASE!

! THIS PATCH BREAKS NANOMSG TRANSPORT !
2018-03-26 13:58:20 +02:00
Dennis Klein
9b7841e89e FairMQ: Remove deprecated TransportFactory factory method 2018-03-26 13:58:20 +02:00
Alexey Rybalchenko
7b4976898a include FairMQProgOptions.h in FairMQDevice.h 2018-03-22 14:11:34 +01:00
Alexey Rybalchenko
a3393e600e convert log severities use to lowercase and remove use of MQLOG 2018-01-16 22:53:26 +01:00
Alexey Rybalchenko
58a312b730 FairMQ: Introduce callbacks for the FairMQUnmanagedRegion.
Callbacks are called when the data buffer of the message assiciated
with the corresponding region is no longer needed by the transport.
Example in examples/advanced/Region/
2017-11-29 09:06:17 +01:00
Matthias Richter
9b2b1cf9f1 Adding rate control for ConditionalRun function
Devices implementing the conditional run method are typically source
devices and a rate control can be desireable. New option '--rate' with
a float number argument in Hz can be used to configure rate control.
By default it is switched off.
2017-11-17 16:23:38 +01:00
Alexey Rybalchenko
0bb866ff36 FairMQ: shared memory unmanaged region updates:
- use same mapping for sender/receiver (created/remote) region.
 - rename FairMQRegion -> FairMQUnmanagedRegion.
2017-10-20 14:17:15 +02:00
Alexey Rybalchenko
179968db1e Remove FairMQConfigurable 2017-10-05 15:32:12 +02:00
Dennis Klein
44a59f25a7 FairMQ: Move --catch-signals logic to control plugin
* Add StealDeviceControl() API to plugin services
2017-10-05 15:32:12 +02:00
Dennis Klein
7dcd09692c FairMQ: Move static and interactive control modes to plugin (3) 2017-10-05 15:32:12 +02:00
Alexey Rybalchenko
01327426c3 Port DDS plugin to the new plugin system. 2017-10-05 15:32:12 +02:00
Alexey Rybalchenko
2db114bc5c Eliminate warnings in FairLink and FairMQ Plugins. 2017-10-05 15:32:12 +02:00
Alexey Rybalchenko
70e46a0b86 Cleanup base/MQ. 2017-10-05 15:32:12 +02:00
Alexey Rybalchenko
334b91785b FairMQ: Move static and interactive control modes to plugin (2) 2017-10-05 15:32:12 +02:00
Alexey Rybalchenko
6349438829 Run InitTask in the worker thread (same as all other state handlers). 2017-09-07 14:22:50 +02:00
Alexey Rybalchenko
9be5a20df6 Add doxygen comment about state handlers running in worker thread 2017-08-30 08:38:00 +02:00
Alexey Rybalchenko
221d2567f0 FairMQRegion and examples/advanced/Region 2017-08-08 14:18:10 +02:00
Alexey Rybalchenko
65f1b96dc3 Add Version member to FairMQDevice, settable via constructor 2017-07-17 13:25:16 +02:00
Alexey Rybalchenko
b47cc8b29c add callback on state change 2017-07-04 07:05:11 +02:00
Alexey Rybalchenko
035d5fb353 Provide accessors for device members that are part of publiv API 2017-06-23 11:45:46 +02:00
Alexey Rybalchenko
4bc54ad32b add --print-channels to print registered channels of the device 2017-06-23 11:45:46 +02:00
Alexey Rybalchenko
f4e5a74f23 Always have access to FairMQProgOptions from device. 2017-06-04 01:06:12 +02:00
Dennis Klein
7bb6a2eed9 add default subchannel index 2017-05-24 16:37:33 +02:00
Dennis Klein
8bc21675af Refactor TransportFactory to RAII
* Remove explicit Initialize and Terminate states,
    map them onto ctor/dtor
  * Remove no longer needed Shutdown state
  * Remove deprecated SetTransport()
2017-05-24 16:37:33 +02:00
Dennis Klein
9215c81362 Deprecate old TransportFactory factory 2017-05-23 08:37:52 +02:00
Alexey Rybalchenko
6b221d950c Add NewPoller() wrapper. 2017-05-23 08:32:13 +02:00
Dennis Klein
3205e0c378 refactor to more idiomatic RAII
* FairMQTransportFactoryZMQ: move the config invariant
    initialization to ctor
  * FairMQChannel: add new ctor that creates usable channel
  * FairMQSocket*: close sockets in dtor
  * FairMQTransportFactory*: terminate context in dtor
  * FairMQChannel: add Bind/Connect facades (for explicit control, e.g. timing)
2017-05-18 20:01:44 +02:00
Dennis Klein
87252edbe0 move New*Message apis to TransportFactory
* add facades to Device and Channel
  * add Transport() getter to Device
  * inline Transport() getter from Channel
2017-05-18 20:01:44 +02:00
Dennis Klein
97ca52aa0e move TransportFactory factory into FairMQTransportFactory namespace 2017-05-18 20:01:44 +02:00
Alexey Rybalchenko
459b42add2 FairMQ: MakeTransport to create stand-alone transport for tests. 2017-04-28 13:30:51 +02:00
Alexey Rybalchenko
5aaf27bf02 Refactor the transport interface
- give transport Initialize() method with access to device config.
 - avoid using global context in the transport.
 - simplify shutdown procedure (no need for extra thread).
2017-04-20 11:07:49 +02:00
Alexey Rybalchenko
b237b3f9d7 Remove unused code.
- Remove unused code in FairMQTools.
- Remove obsolete device options (now in device config).
2017-03-14 17:51:26 +01:00
Sandro Wenzel
9e477264c8 Better encapsulate Device config: Offer a getter method 2017-03-02 13:24:35 +01:00
Alexey Rybalchenko
c66fd6fe91 Adding multiple transports support & other fixes:
- Avoid polling when only one input channel is used.
 - Send only handles for shared memory transport.
 - Avoid waiting in the rate logger thread when nothing to log.
 - Hide warnings from generated files
 - Fix #483
2017-02-23 06:47:09 +01:00
Alexey Rybalchenko
62df0b609b disable feature not available on GCC < 5 2016-12-19 12:06:27 +01:00
Alexey Rybalchenko
a332d9fc83 First version of the shared memory transport.
Use via `--transport shmem` cmd option. No pub/sub.
2016-12-18 14:50:58 +01:00
Alexey Rybalchenko
b166cedb63 Convert factory methods to return smart ptrs
- Convert factory methods to return smart ptrs.
 - Refactor state machine to use same thread for user states.
 - Remove unused includes and dependencies, use std.
2016-11-18 14:19:16 +01:00
mkrzewic
c2d7c49cf5 Support multiple endpoints per socket
Sent messages will be scheduled among the endpoints according to socket
type: PUB will send the same data to all endpoints simultaneously, PUSH
will do round robin transfer.
Incoming data is fair queued between endpoints.

This is a feature of at least zeromq and nanomsg.

_____________
To use: in the device configuration, instead of specifying just one address,
specify a comma separated list e.g.

tcp://localhost:123,ipc:///tmp/socket

the connection method (bind/connect) applies to all endpoints in this case.
______________
Mixing binding and connecting endpoints is supported:
prefix "@" means "bind", "+" (or ">") means connect, e.g.

+tcp://localhost:123,@ipc:///tmp/socket,ipc:///tmp/asd

(in case of missing prefix, the default channel method is used for that
endpoint).
2016-11-11 16:58:55 +01:00
Alexey Rybalchenko
da3010b20c Move config & control DDS functionality into plugins. 2016-10-28 14:14:13 +02:00
Alexey Rybalchenko
16fd63cd5b Enable new callback API
- OnData() channel data handler.
 - ConditionalRun() for devices without incoming data.
 - Header file with common main(), to be extended with getDevice/addCustomOptions.
 - Update examples (MQ/Tutorial3) to use the new API and config.
 - NewSimpleMessage() for simpler creation of small messages (additional copy).
 - Replace SetProperty/GetProperty with fConfig access.
 - Runtime configurable channel names for common devices.
 - Configurable logging interval per channel.
 - FairMQMultiplier for distributing same data to multiple outputs.
 - Cleanup state machine messages.
 - Cmd option to toggle signal handling.
 - Simpler API for send/receive timeouts.
 - Enable --log-to-file.
 - Fix coverity issues, warnings.
 - Various code cleanup and minor tweaks.
2016-09-30 14:36:35 +02:00
Alexey Rybalchenko
3353e214a7 Add shared memory example
- Add shared memory example in examples/MQ/SharedMemory
 - Device/Task termination: try soft first, and abort if it fails
 - Interactive mode: prevent cin from blocking forever (poll)
2016-05-11 14:52:53 +02:00