Commit Graph

320 Commits

Author SHA1 Message Date
Alexey Rybalchenko
8cf1cbb930 Initialize shared memory only if it is used. 2017-02-23 06:47:09 +01:00
Alexey Rybalchenko
ac1da4db66 Require std::move when adding existing message to FairMQParts. 2017-02-23 06:47:09 +01:00
Alexey Rybalchenko
65c19f07bf Fix compatibility with ZeroMQ 4.2.1 2017-02-09 12:19:23 +01:00
Florian Uhlig
617042b3c6 For tests on MacOSX use new MacOSX version 10.11 and FairSoft version may16p1.
Run fairmq tests sequentialy.
2017-01-27 06:16:11 -08: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
6c3b01f09c AttachChannel must update the config after it's done, use boost::split 2016-12-14 08:52:05 +01:00
Alexey Rybalchenko
0fb49a0986 State machine update
- Fix regression from last commit (preventing static run from proper shutdown).
 - Guard state changes (for the internal transitions) (msm::process_event is not thread safe).
 - Remove unused transition from RUNNING to EXITING.
2016-11-24 22:35:46 +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
Alexey Rybalchenko
12f04c7237 Fix race condition in the state machine & channel. 2016-11-15 16:17:56 +01:00
mkrzewic
94a4d599eb Validate connection method per endpoint, not socket
this allows e.g. to ommit the socket method in config if all endpoints
specify the method modifier.
It still is fully backward compatible.
2016-11-13 14:22:51 +01:00
mkrzewic
892aa8008b Add missing #include <cstring> 2016-11-13 00:05:57 +01:00
mkrzewic
6bec8fc1db Simplify Tokenize(): nicer looking code = better code 2016-11-12 18:04:14 +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
Sebastien Binet
0a3f14c0e3 all: apply fer-json-fmt 2016-11-10 15:20:54 +01:00
Sebastien Binet
02f5e63784 all: use strict(er) and more regular JSON schema 2016-11-10 15:20:54 +01:00
Sebastien Binet
581e93968e fairmq/options: fix JSON example 2016-11-10 10:55:50 +01:00
Alexey Rybalchenko
79fba8ec4c Update JSON files & readme, use FairMQDevicePtr, cleanup. 2016-11-09 15:01:40 +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
winckler
e0a03242ac Simplify logger filtering options, fix log error double printing issue 2016-09-19 11:20:22 +02:00
winckler
9ceab6099c add a signal/slot mechanism. 2 APIs : one generic version, and one string API (commented) 2016-09-19 11:20:22 +02:00
Alexey Rybalchenko
5e5ddd5b7b Fix further effc++ and reorder warnings. 2016-09-19 11:10:46 +02:00
Alexey Rybalchenko
7c99bd77cc Fix unused variables, init order and effc++ warnings. 2016-09-06 10:19:23 +02:00
Florian Uhlig
827c8dcd45 Remove warnings about unused parameters. 2016-08-12 13:25:07 +02:00
winckler
bed58891ea merge MQ parameters in the variable_map container of FairMQProgramOptions class 2016-08-05 08:34:15 +02:00
Alexey Rybalchenko
2ed0c52ae8 Test nanomsg transport only when nanomsg library is found. 2016-08-05 07:47:20 +02:00
Alexey Rybalchenko
13a5cea1d7 fix parallel running tests failure 2016-07-11 10:58:30 +02:00
winckler
64f1fd2a3b - add test for serialization examples 1&2
- rename serialization files and scripts
- remove policy and host header files from fairmq installation
2016-07-01 13:05:37 +02:00
winckler
c57bbf58fa - Remove GenericSampler, GenericProcessor, and CRTP policy base classes
- Rename GenericFileSink to BaseMQFileSink, and move it to base/MQ/hosts directory
- Rename and clean files in the serialization examples
2016-06-29 12:24:13 +02:00
Florian Uhlig
75aad5676d Use Boost_ variables instead of hardcoded names. 2016-06-08 15:38:14 +02:00
Florian Uhlig
92944fe322 Correct shell scripts to work correctly with dash.
Add more dependencies for fairmq.

Something does not work with rpath when using boost 1.61. The problem is only seen for opensuse.
2016-06-03 15:45:18 +02:00
Alexey Rybalchenko
f3bebe9321 Use different ports in tests to prevent parallel run fail 2016-06-01 11:49:33 +02:00
Alexey Rybalchenko
7062a3d280 Run FairMQ tests with both ZeroMQ and nanomsg 2016-05-31 10:42:06 +02:00
Alexey Rybalchenko
eb306a2c0d Remove color output from tests 2016-05-30 16:24:15 +02:00
Radoslaw Karabowicz
fd09321fd9 Modified runDDSCommandUI to accept command line argument.
If no arguments, it behaves like before.
Removed runDDSCommand and replaced calls to it in controlDDS.
2016-05-30 11:28:43 +02:00
Radoslaw Karabowicz
65ca151620 MQ/example9 Adapted to the new running scheme with DDS.
- removed the executables that are running only in DDS (ddsEx9Sampler.cxx,
ddsEx9TaskProcessor.cxx, ddsEx9FileSink.cxx, ddsParameterMQServer.cxx);
- adapted the executables to allow running within the DDS (setting channel names);
- changed the topology file to run the correct executables (ex9-dds-topology.xml);
- ex9-dds.json - changed the parameter channel name back to "data" (to be compatible with other examples);
- added a shell script to controlDDS.sh;

- added fairmq/fairmq-dds-command executable to send single commands to DDS;
- adapted parmq/parmq-server to run within DDS.
2016-05-30 11:28:42 +02:00
Alexey Rybalchenko
253604344f nanomsg: reset maximum receive msg size 2016-05-27 12:58:07 +02:00
Alexey Rybalchenko
cc88339791 Cleanup command line options
- Remove old cmd options --config-json-file and --config-xml-file.
   Now handled by --mq-config with file extension detection.
 - Fix --config-json-string and --config-xml-string
 - Move config-key to proper place (in --help)
2016-05-23 16:40:32 +02:00
Alexey Rybalchenko
4944d7ec41 Meaningful error on wrong channel name 2016-05-20 14:10:14 +02:00
Alexey Rybalchenko
a05dc80402 Refactor DDS example and tools to be able to run with/without DDS 2016-05-20 14:09:53 +02:00
Alexey Rybalchenko
af971c6ab1 Allow rate limiting in the Shared Memory example 2016-05-18 16:01:21 +02:00
Alexey Rybalchenko
1f09317cd0 Handle both single and multi part payloads in splitter/merger/proxy 2016-05-17 12:27:33 +02:00
Alexey Rybalchenko
e9f09143b2 Gracefully end the device also in the termination case (instead of abort). 2016-05-17 12:27:18 +02:00
Alexey Rybalchenko
ce42f36126 Remove redundant state change call and revert the termination handler. 2016-05-12 17:28:33 +02:00
Alexey Rybalchenko
28aa5e4caa Let ParseAll exit if unsuccessfull 2016-05-12 17:28:33 +02:00
Alexey Rybalchenko
31456e71ff Threads safe socket rate stats 2016-05-12 17:28:32 +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
Radoslaw Karabowicz
599d1b3e05 MQ/example9 Added testing of the static MQ execution.
- removed the obsolete startFairMQEx9.sh.in script
- added all *.root files in example9/macros/ to .gitignore;
- added run_digi.C to tests;
- added startFairMQEx9_Static.sh to tests;

- startFairMQEx9_Static.sh - script that will run the example non-interactively, statically;
- Pixel9MQConfig_Multipart.json - added acknowledgement channel to sampler and sink;
- runEx9Sampler.cxx and runEx9FileSink.cxx - added option to set the ack channel name;
- FairMQEx9FileSink - if ack channel name set, send acknowledgement of received message, save the tree and file at the end of Run;
- FairMQEx9Sampler - if ack channel name set, count acknowledgements and finish only if all events processed;
- FairMQEx9TaskProcessor - moved some printouts to debug.

General:
- fairmq/logger/logger.cxx - fixed colorless logger bug;
- parmq/runParameterMQServer.cxx - now using runStateMachine function (to enable static execution).
2016-05-06 14:46:17 +02:00
Alexey Rybalchenko
58754e03c7 Make sure logger is used before configuring it. 2016-04-28 10:28:18 +02:00
Alexey Rybalchenko
e039931098 Fix the logger conflict issue 2016-04-27 17:01:23 +02:00
Alexey Rybalchenko
5421922668 Add a cmd option to control state change mechanism 2016-04-27 15:04:29 +02:00
Alexey Rybalchenko
b9883d3b13 Configuration and DDS example/tools updates
- Update DDS example command UI and extract it from example.
 - Unify address handling via DDS properties for dynamic deployment.
 - Update DDS docs with the new approach.
 - Allow `--config-key` to be used to access common config in JSON.
 - Allow common channel properties to be specified for all sockets.
 - Update MQ examples and Tuto3 with new config options.
 - Add start scripts to MQ examples for easier use.
2016-04-25 17:35:57 +02:00
Alexey Rybalchenko
151d3b5de8 Fix dereference before null check in example and formatting 2016-04-14 13:23:09 +02:00
Alexey Rybalchenko
a892a5a744 Update FairMQParts with doxygen comments and non-blocking send 2016-04-14 12:51:55 +02:00
Alexey Rybalchenko
82090c356c Fix identity setting for req/rep socket 2016-04-07 15:13:51 +02:00
winckler
e977dfb609 update generic sampler with new serialization api 2016-04-06 12:05:50 +02:00
winckler
3b985cd2cd encapsulate and use fairmq default xml and json parser if command line mq-config file.extension is called. The .xml and .json files are recognized internally. Remove explicit json parsing in runSimpleMQStateMAchine.h. Propagate the new commandline mq-config where the runstatemachine function is used 2016-04-05 17:52:10 +02:00
winckler
8df656a302 enable object array parsing in JSON parser for devices, channels, and sockets.
device, channel, and socket are parsed as before
2016-04-05 11:16:53 +02:00
winckler
819a21f46a remove obsolete documentation 2016-03-31 19:13:51 +02:00
winckler
e215049db9 remove alternative serialization API 2016-03-31 19:12:48 +02:00
winckler
835c88c6d2 change serialization API so that it takes a FairMQMessage reference 2016-03-31 19:12:48 +02:00
winckler
4c50409af5 add serialization API 2016-03-31 19:12:48 +02:00
Mohammad Al-Turany
9a340fb7f6 Use Variables for Boost libraries instead of explicit names
Use the vairables filled by FindBoost instead explicit names in the cmake files
2016-03-29 15:31:29 +02:00
Alexey Rybalchenko
732373faa2 Update multi-part features (nanomsg) and various fixes
- Implement nanomsg multipart with MessagePack.
 - Use the MessagePack from FairSoft and handle not found case.
 - Update splitter, merger and proxy devices to handle multi-part.
 - Let FairMQParts.At() return pointer reference (can be used for moving).
 - Add missing const specifier in the message interface.
 - Add transmit kernel size setting to channels (ZMQ_SNDBUF).
 - Remove FairMQBuffer device.
 - Remove old multi-part methods from Tutorial3 example (to be replaced with Parts API).
 - Make callback mandatory for newMsg(data, size, callback).
 - Add missing <vector> include in FairMQSocket.
2016-03-24 13:36:47 +01:00
Florian Uhlig
4ca66e33da Fix compiler warnings.
Switch of compiler warnings for part of the code.
The compiler flag -Weffc++ of the gcc compiler creates many warnings about non virtual destructor of base classes where the
base class is actually a class from boost or from stl. Switch of the compiler flag for the problematic parts of the code
using preprocessor statements. There are also such preprocessor guards for code which creates many warnings when
using clang.

Filter warnings comming from generated files.
When using CTest all warnings comming from generated code (Root Dictionaries, code generated by protoc) will be filtered
before sending the results to the CDash web server.

Remove unused variables or use them.
Initialize all data members in initializer lists.
Use in initializer list the same order of data members as defined in the class declaration.
Declare private copy constructors and assignment operators where needed.

Fix format problems in printf statements.
Correctly cast the variables.
2016-03-17 21:33:40 +01:00
Florian Uhlig
fa7040fe65 Fix compiler warnings.
Initialize all data members in initializer lists.
Reorder data members in initializer list to have the same order as in the class declaration.
Comment or remove unused parameters and unused variables.
Convert all old style casts to the correct and explicit c++ cast like const_cast, static_cast,
dynamic_cast or reinterpret_cast. In most cases static_cast is used.
2016-03-14 13:37:55 +01:00
Alexey Rybalchenko
bb36147099 Allocate dynamic size flatbuffers structure on the heap 2016-03-10 13:08:00 +01:00
Alexey Rybalchenko
1ad58653e7 Fix return value of multipart send/receive methods 2016-03-03 15:46:27 +01:00
Mohammad Al-Turany
c564a3f066 Merge branch 'fix-uint' of https://github.com/rbx/FairRoot into rbx-fix-uint 2016-03-03 15:35:36 +01:00
Alexey Rybalchenko
10f997f680 Fix return value of multipart send/receive methods 2016-03-03 15:35:39 +01:00
Alexey Rybalchenko
c42b6ca4ae Include device ID in the zeromq socket identity.
For request sockets in ZeroMQ the socket identity must be unique, otherwise multiple clients will be rejected.
Update the tests to test this use case.
2016-03-03 13:10:56 +01:00
Alexey Rybalchenko
e1fef82657 FairMQ: Extend Multipart and messaging API
- Extend the multipart API to allow sending vectors of messages or helper
   thin wrapper FairMQParts. See example in examples/MQ/8-multipart.
 - NewMessage() can be used in devices instead of
   fTransportFactory->CreateMessage().
   Possible arguments remain unchanged (no args, size or data+size).
 - Send()/Receive() methods can be used in devices instead of
   fChannels.at("chan").at(i).Send()/Receive():
   Send(msg, "chan", i = 0), Receive(msg, "chan", i = 0).
 - Use the new methods in MQ examples and tests.
 - No breaking changes, but FAIRMQ_INTERFACE_VERSION is incremented to 3
   to allow to check for new methods.
2016-02-29 16:25:39 +01:00
Alexey Rybalchenko
82ab7670a9 Add FlatBuffers & MessagePack examples
- Add FlatBuffers serialization example to Tutorial 3
 - Add MessagePack serialization example to Tutorial 3
 - Performance improvements in Boost serialization example
 - Use `GetEntriesFast()` for FairTestDetectorRecoTask
 - Use `Clear()` instead of `Delete()` in MQ parts of Tutorial 3
 - Fix CMake variables from preventing compilation without nanomsg.
 - create macro/data directories in install directory
 - Get rid of data duplication in fill_parameters.C
 - Various cleanups and fixes
2016-02-22 13:06:37 +01:00
Alexey Rybalchenko
f1abb9ecdd Remove compile time transport interface switch
- Remove the compile time check of the transport implementation.
  The transport (zeromq/nanomsg) can be chosen at run time with:
  `device.SetTransport("zeromq"); // possible values are "zeromq" and "nanomsg"`.

  For devices that use FairMQProgOptions, the transport can be configured via cmd option:
  `--transport zeromq` or `--transport nanomsg`. Default values is "zeromq".
  The device receives the configured value with:
  `device.SetTransport(config.GetValue<std::string>("transport"));`

  Old method of setting transport still works. But the NANOMSG constant is not defined.

- Remove old `fairmq/prototest` directory. It was only used as a test for protobuf.
  The protobuf part of Tutorial3 does the same (with different values).

- Fix a bug in FairMQPollerNN, where the `revents` value was not initialized.
  This caused the `poller->CheckOutput()` to trigger when it should not.
2016-01-14 15:19:30 +01:00
Alexey Rybalchenko
0e1a1ad552 Allow to limit number of messages for the Benchmark sampler and sink 2016-01-14 14:19:03 +01:00
Alexey Rybalchenko
c10a6abeef Fix memory leaks in Tutorial3
- Fix small memory leaks in Processor and Sink of Tutorial 3.
 - Use FairFileSource for FairMQSampler of Tutorial 3.
2016-01-14 14:19:03 +01:00
Alexey Rybalchenko
e4fed2fa1b Fix copy constructor & assignment operator warning in FairMQChannel
Fix Weffc++ warnings

  - Add missing copy constructors and assignment operators .
  - Hide the warning from FairMQStateMachine.h where it is produced by boost and/or is intended.
  - Some code cleanup.
2016-01-14 14:19:03 +01:00
Alexey Rybalchenko
9a0a8c7516 Add a acknowledgement channel to Tutorial 3...
- ...to measure performance of the serialization libraries.
  - Rename `--log-color-format` cmd option to `--log-color`.
2016-01-14 14:19:03 +01:00
Florian Uhlig
d254efb91f Fix compiler warnings. Mostly unused parameters have been removed. 2016-01-14 14:19:02 +01:00
NicolasWinckler
2060f0b1d7 FairMQLogger : remove pragma command and use CMake include SYSTEM command instead 2015-11-25 08:59:19 +01:00
Alexey Rybalchenko
2afa0652f4 Extend DDS Example to use command interface 2015-11-25 08:59:19 +01:00
NicolasWinckler
35c64c67a2 add a command line to enable/disable the color format in the fairmq log console output 2015-11-20 15:26:20 +01:00
NicolasWinckler
10d6482716 remove unfinished doc 2015-11-20 09:03:34 +01:00
NicolasWinckler
8f32579984 add a pointer data type serializer function in the boost serializer add the zmq and nanomsg directories in cmaklists that use the runSimpleMQStateMachine 2015-11-20 09:03:34 +01:00
Alexey Rybalchenko
afda64a83d Simplify the handling of send/receive timeouts 2015-11-20 09:00:22 +01:00
Florian Uhlig
0894900f52 Add missing link dependencies. 2015-11-19 15:51:44 +01:00
NicolasWinckler
89d57db5ea - create 3 test scripts for bin, boost, and root serialization format
- print message at the end of the data generator of GenericDevices tutorial
2015-11-12 11:25:14 +01:00
NicolasWinckler
76626b4f4b add test dir to examples/MQ/GenericDevices + change policy typedef in generic device from private to protected 2015-11-12 11:24:07 +01:00
NicolasWinckler
1467360f75 access channel map with at 2015-11-12 11:24:07 +01:00
Alexey Rybalchenko
383a220333 Update device configuration
- Move general config files out of example directory to fairmq/run.
 - Use FairMQProgOptions for MQ example 5.
 - Add SendPartAsync() for non-blocking send of a message part.
2015-11-11 11:09:42 +01:00
NicolasWinckler
837490cc38 add FairProgOptionsHelper.h in header list to be installed of fairmq/CMakeLists.txt 2015-11-09 14:17:44 +01:00
NicolasWinckler
819a8df952 add function helpers for FairProgOptions which simplify FairProgOptions.cxx 2015-11-09 14:08:27 +01:00
NicolasWinckler
13d3729fec enable/disable multipart functionnality for sending header if source policy has the proper signature
add comment to sendHeader
2015-11-09 14:08:27 +01:00
NicolasWinckler
6ce6887212 formatting, change and clean generic_sampler and SimpleTreeReader 2015-11-09 14:08:27 +01:00
Alexey Rybalchenko
d0c20d3729 Rename /example to /examples and move MQ examples in it 2015-11-09 10:36:24 +01:00
Alexey Rybalchenko
307d698736 Add example for sending multipart messages 2015-11-06 14:46:15 +01:00
Alexey Rybalchenko
2e789e4439 Add ParameterMQServer and example of its use 2015-11-06 14:46:15 +01:00
NicolasWinckler
19b3347ade - rename tutorial7 and move it to example/MQ/GenericDevices
- rename functions of MQ examples and change directory structures
- move FairMQUnpacker.h from example/MQ/LmdSampler to base/MQ/devices
- add runSimpleMQStateMachine.h helper function in fairmq/tools
2015-11-05 15:10:11 +01:00
NicolasWinckler
93b82767eb correct some coverity issues and add empty string to the logger if boost version = 1,59.0 2015-11-04 11:04:11 +01:00
NicolasWinckler
3a7175f8e8 add lmd sampler-unpacker-sink chain in example/MQ/lmdSampler 2015-11-04 11:03:11 +01:00
NicolasWinckler
323033c9eb Add CRTP base class for the policies of the generic device 2015-11-04 11:02:32 +01:00
NicolasWinckler
559c7babca add doc for the generic devices 2015-11-04 11:02:11 +01:00
NicolasWinckler
fe91aa1634 add typedef for policies in host class, and make the sampler task container optional. 2015-11-04 11:02:10 +01:00
NicolasWinckler
946f1c9d00 add doc for the tutorial7 and the generic device 2015-11-04 11:01:40 +01:00
Alexey Rybalchenko
daba1771fa Fix return values of nanomsg send/receive calls 2015-11-03 16:07:15 +01:00
Alexey Rybalchenko
4be6ba6e66 Check return values of Receive calls in the examples 2015-11-03 16:07:15 +01:00
Alexey Rybalchenko
6dc4dc84b3 Add proper return value in set timeout 2015-11-03 16:07:15 +01:00
Alexey Rybalchenko
ada23500be Return if an unknown exception has been cought in Channel 2015-11-03 16:07:15 +01:00
Mohammad Al-Turany
d52d7d4ebc Merge branch 'sink-io-threads' of https://github.com/rbx/FairRoot into rbx-sink-io-threads 2015-11-02 19:54:36 +01:00
Giulio Eulisse
7ee479084c Add missing return statement 2015-11-02 16:56:28 +01:00
Alexey Rybalchenko
6000e86e74 Remove redundant io-threads cmd option from Sink 2015-11-02 09:27:12 +01:00
Florian Uhlig
af70d03ab0 Add missing include directories for ZeroMQ and NanoMsg. They have been found by chance when the packages are in SIMPATH. They are not found if they are in another path. 2015-10-21 17:12:04 +02:00
Alexey Rybalchenko
8f59db1283 Add methods to set timeout on blocking Send/Receive 2015-10-19 09:52:53 +02:00
Alexey Rybalchenko
91d3f013c0 Fix setting of ZeroMQ I/O Threads (setting was not propagated before) 2015-10-12 13:51:09 +02:00
Alexey Rybalchenko
023d88d0ef Add FairMQ Example 6 - Working with multiple channels 2015-10-07 16:46:10 +02:00
Alexey Rybalchenko
0b11ad9274 Fix the type mismatch in the multi-channel poller 2015-10-07 16:46:09 +02:00
Alexey Rybalchenko
19afacb504 FairMQ Examples cleanup
- Rename Tutorial3 MQ files for uniform naming.
  - Add search for dylib in FindDDS.cmake (OSX).
  - Add more detail to the DDS example readme.
  - MQ Example 3 (DDS): choose network interface via command line option.
  - Give FairMQ examples their own CMakeLists.txt for clarity.
  - Remove C++11 checks in Tutorial3 from the code (they are now in CMake).
  - Add Serializer for device properties (FairMQDevice::ListProperties()).
2015-10-05 18:06:55 +02:00
winckler
a75486f3ec * split log console output sink into two sinks, one for cout and one for cerr.
* remove logger_oldboost_version files and add ifdef boost version in logger.cxx instead

* change default logger level in FairMqProgOptions
2015-09-29 17:51:14 +02:00
Alexey Rybalchenko
54e1777c00 Small adjustments for the new logger.
Both FairMQLogger and FairMQStateMachine use Boost Fusion internaly.
Because the state machine needs FUSION_MAX_VECTOR_SIZE 20 defined,
same value has to be defined in the logger, otherwise Fusion is not
properly compiled.
2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
5136c88d3a Simplify Tutorial3 structure.
Use same executable for bin/boost/protobuf/root data format,
configured now via `--data-format <binary/boost/protobuf/tmessage>`
command line parameter.
2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
8b71e4d20b Use FairMQDevice::CatchSignals for Tutorial7 2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
dc6fb4698c Fix bug in nanomsg implementation of poller check. 2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
35ff6c8fc8 Fix a bug in nanomsg implementation when sending empty messages. 2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
f13bb5995d Add FairMQ tests (PUB-SUB, PUSH-PULL, REQ-REP). 2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
fbf7dbf2ba Add orthogonal OK/ERROR states.
Replace state check mutex with atomic.

Update DDS example documentation.
2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
a7ab33a10e Add new Send/Receive methods with smart pointers and no flag checks. 2015-09-28 12:17:24 +02:00
Alexey Rybalchenko
105e734808 Add DDS and Copy+Push examples. 2015-09-28 12:17:24 +02:00
winckler
96cd2afac7 fix missing header issue in fairmq/logger 2015-09-28 12:17:24 +02:00
winckler
5212dd4ce1 move back the empty deleter in the logger.cxx 2015-09-28 12:17:23 +02:00
winckler
a0388c084e remove boost and tutorial7 -Wshadow warnings and install null deleter file in FairRoot installation 2015-09-28 12:17:23 +02:00
winckler
ca7a76110d add an other fairmq logger implementation in case boost version < 1.56 for backward compability 2015-09-28 12:17:23 +02:00
Alexey Rybalchenko
74f7c5873a Fix the logger installation 2015-09-28 12:17:23 +02:00
winckler
e0ca1f62b3 - Replace the fairmq logger with one based on Boost.Log
- Adapt FairProgOptions to the new logger
2015-09-28 12:17:23 +02:00
Florian Uhlig
bea05ea6c1 Add missing include statement. 2015-09-28 12:17:22 +02:00
Alexey Rybalchenko
1302e77a16 Several FairMQ fixes and improvements:
- FairMQ: add possibility to poll on multiple channels.
- FairMQ: include command channel when polling on blocking calls (for unblocking without termination).
- FairMQ: move signal handler inside of FairMQDevice class (call FairMQDevice::CatchSignals() in the main function).
- FairMQ: add 'bool CheckCurrentState(statename)' (instead of 'GetCurrentState() == statename' that cannot be thread safe).
- FairMQDevice: add 'InteractiveStateLoop()' method that can be used to change states from the command line.
- FairMQDevice: add automatic transition to IDLE state if Run() exits without an external event.
- FairMQDevice: implement device reset.
- FairMQDevice: use unordered_map for device channels.
- FairMQChannel: improve address validation for channels.
- FairMQChannel: add ExpectsAnotherPart() method to check if another msg part is expected (old approach still works).
- FairMQ: remove invalid transition from the run files.
- FairMQFileSink: disable ROOT termination signal handler.
- Tutorial3: spawn xterm windows from start scripts without overlapping for better visibility.
- FairMQ Examples: update protobuf test and move its files to a common directory.
- FairMQStateMachine: improve feedback on invalid transitions (more readable).
2015-09-28 12:17:22 +02:00
winckler
d1bba61939 - FairMQ options:
a) move the XML parser into the FairMQ/options/FairMQParser.h
b) add a routine in FairMQProgOption to check whether the necessary XML or JSON input files are there, and send an error message if not there

- Policy based devices:
a) rename GenericSampler to base_GenericSampler and use an alias template named GenericSampler
b) in base_GenericSampler, rename template parameter to simple variables <T,U,… > and use typedef for clarity
c) introduce an anonymous function container in the base_GenericSampler host class with a register task template member function and an Executetasks()
d) add two new template parameters in base_GenericSampler for the anonymous function container map. parameter is K for the key type (default=int) and L for the value type (default=std::function<void()>)

- Tutorial7:
a) use FairMQProgOption to configure devices in tutorial7
b) introduce several template functions helper in tutorial7 to reduce code redundancy
c) show examples in tutorial7 of task registration with callback and lambda expression for the sampler devices
d) separate the executable build of the tutorial7 data generator to remove the Roofit banner when executing the MQdevices
2015-09-28 12:17:21 +02:00
Alexey Rybalchenko
6ed9cc3da1 Fixed a typo in example config 2015-06-30 16:48:36 +02:00
winckler
b855f77060 - fix coverity issues
- clean code and typo in comments
2015-06-26 18:04:10 +02:00
Alexey Rybalchenko
4db91a52eb Fix Coverity issues 2015-06-26 18:01:40 +02:00
Alexey Rybalchenko
2656d8098c Add first two simple FairMQ examples
fairmq/examples/1-sampler-sink
fairmq/examples/2-sampler-processor-sink
2015-06-22 16:35:00 +02:00
Alexey Rybalchenko
5f20a28b04 Correct mistake in channel validation 2015-06-19 14:49:32 +02:00
Alexey Rybalchenko
252acf41c8 Add WaitForInitialValidation() 2015-06-19 12:33:10 +02:00
Alexey Rybalchenko
e5313d03fe Fix uncaught exceptions 2015-06-19 12:33:06 +02:00
Alexey Rybalchenko
d6a413534a Thread safe initialization of the channels 2015-06-19 12:32:56 +02:00
Alexey Rybalchenko
295d9bba57 add WaitForEndOfStateForMs(state, duration) 2015-06-17 16:01:11 +02:00
Mohammad Al-Turany
6cd1e53b13 Add missing license information 2015-06-16 15:31:23 +02:00
Alexey Rybalchenko
a3d919b763 Use FairMQProgOptions for Sink and BenchmarkSampler 2015-06-16 12:43:23 +02:00
Alexey Rybalchenko
7fda980710 Update FairMQStateMachine & introduce FairMQChannels
Organize sockets as a map of vectors of FairMQChannels.

Update FairMQStateMachine by removing SETTINGINPUT, SETTINGOUTPUT,
BIND and CONNECT states and by adding INITIALIZING_TASK, RESETTING_TASK
and RESETTING_DEVICE states. Run states functions in their own thread.
2015-06-16 09:29:53 +02:00
winckler
a2ebbbe450 move fairmq json parser to fairmq/options 2015-06-15 15:59:12 +02:00