Commit Graph

49 Commits

Author SHA1 Message Date
Alexey Rybalchenko
65f1b96dc3 Add Version member to FairMQDevice, settable via constructor 2017-07-17 13:25:16 +02:00
Dennis Klein
a26925cbf5 FairMQ: Fix various errors from CI
* move Plugins::Version to fair::mq::tools
* fix Parser interface
* make device a shared pointer in main
* provide std::hash template specialization
* fix FairMQ.Plugins/FairMQ.PluginsStatic when run with ctest
* fix MQ/serialization example
* add --no-as-needed flag
* GCC 4 does not support member refs, move to pointer types
2017-07-04 07:05:11 +02:00
Dennis Klein
ad0f050c99 FairMQ: Implement PluginServices - Config 2017-07-04 07:05:11 +02:00
Dennis Klein
739460b2fe FairMQ: Implement PluginServices - Control 2017-07-04 07:05:11 +02:00
Dennis Klein
9b61b924b2 FairMQ: Integration of Plugins through PluginServices 2017-07-04 07:05:11 +02:00
Dennis Klein
60d929b0bd FairMQ: Add plugin mechanism (Plugin and PluginManager classes) 2017-07-04 07:05:11 +02:00
Alexey Rybalchenko
764514a35a Test devices without config & two in a process 2017-06-04 01:06:12 +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
89423eb737 enable shmem tests 2017-05-23 14:10:34 +02:00
Alexey Rybalchenko
9288a2c3d5 Add tests for poller. 2017-05-23 08:32:13 +02:00
Dennis Klein
eb614b6005 do not copy strings 2017-05-18 20:01:44 +02:00
Dennis Klein
b5dab60a82 add more single and multithreaded unit tests 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
Dennis Klein
c78541432f add missing link dependency 2017-05-10 06:43:55 +02:00
Dennis Klein
3dc5fd1d6e expose STL iterator interface for FairMQParts 2017-05-09 14:48:34 +02:00
Dennis Klein
f39b41d68c tweak startup and linger times 2017-04-21 09:21:57 +02:00
Dennis Klein
bbc8da54b4 clean redundant doxygen comments 2017-04-21 09:21:57 +02:00
Dennis Klein
91831ff701 print debug output immediately
This helps in the cases when get killed by the ctest timeout.
2017-04-21 09:21:57 +02:00
Dennis Klein
132ae69953 add startup and linger times for pubsub 2017-04-20 11:07:50 +02:00
Alexey Rybalchenko
ee0d2e0c55 add debug output to test devices 2017-04-20 11:07:50 +02:00
Dennis Klein
218af15bbb ensure that FairMQ.Protocols is not run in parallel
The testsuite uses hardcoded system resources (TCP ports)
and is consequently not thread-safe.
2017-04-20 11:07:50 +02:00
Dennis Klein
d866589be1 Two devices can't share device id 2017-04-20 11:07:50 +02:00
Dennis Klein
7e34f7042f refactor tests
* move to gtest
* add shmem tests
* cleanup cmake file (organize tests in suites)
2017-04-20 11:07:47 +02:00
Florian Uhlig
d1cf852c98 Fox Coverity issues
Fix CID 131712. In case parameter string does not fit in variable return a failure.
Fix CID 162913. Initialize missing data member.
Fix CID 58901.
Fix CID 149137.
Fix CID 149143.
Fix CIDs 149156, 149150, 149147, 149145, 149144, 149137. Don't use command line parameter argv directly.
2017-03-03 15:45:23 +01:00
Alexey Rybalchenko
eaa220e39e better tests output 2017-03-02 13:25:06 +01:00
Alexey Rybalchenko
c78b7e4cfa Fix nanomsg tests 2017-02-27 17:49:30 +01:00
Alexey Rybalchenko
7c1f7aa3f2 Fix Tuto3 double delete, cleanup test output, undeclared var in NN socket. 2017-02-27 13:09:16 +01:00
Dennis Klein
b43d4c142d refactor and integrate with aliBuild/alienv
* accept ZEROMQ_ROOT as env or cmake variable to hint at install
    location (used by aliBuild/alienv)
  * added more docs
  * fixed mismatch between module name ZeroMQ and prefix of
    generated variables ZMQ -> ZeroMQ is now the preferred prefix
    (old variables are still available and marked deprecated)
  * the aliBuild zeromq recipe does not install zmq.hpp header,
    so the module searches now for the zmq.h header
    (which is anyways the only one we use)
  * some cosmetic changes
  * add option ZeroMQ_NO_DEPRECATION to suppress deprecation warning
2017-02-23 19:42:15 +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
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
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
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
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
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
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
afda64a83d Simplify the handling of send/receive timeouts 2015-11-20 09:00:22 +01:00
Alexey Rybalchenko
4be6ba6e66 Check return values of Receive calls in the examples 2015-11-03 16:07:15 +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
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
Alexey Rybalchenko
f13bb5995d Add FairMQ tests (PUB-SUB, PUSH-PULL, REQ-REP). 2015-09-28 12:17:24 +02:00