mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 16:27:14 +02:00
receive multimodule (#65)
* add config files for multimodule receiving * read subfiles with unordered and missing frames * save work debugging * Revert "save work debugging" This reverts commite791992a05
. * Revert "read subfiles with unordered and missing frames" This reverts commit1177fd129d
. * throw when two frames have different frame numbers * write single part RawFile (working beta) * correct total number of frames in master file * add new mythen file with syncd frames * save work * save work for receive multimodule multimodule config results in too much packet loss. needs more debugging. * setup Task Distributiosn/ parallelization programming model * read frames with same frame number * clang-tidy fixes, formatting, add tests * added second receiver * Synchronize between zmq streams and merge frames * improve readability in loop * fix failing tests * add simple test for merge frames --------- Co-authored-by: Bechir <bechir.brahem420@gmail.com> Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
This commit is contained in:
35
examples/zmq_worker.cpp
Normal file
35
examples/zmq_worker.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
#include "aare/network_io/ZmqSink.hpp"
|
||||
#include "aare/network_io/ZmqSocketReceiver.hpp"
|
||||
#include "aare/network_io/ZmqVentilator.hpp"
|
||||
#include "aare/network_io/ZmqWorker.hpp"
|
||||
|
||||
#include "zmq.h"
|
||||
#include <boost/program_options.hpp>
|
||||
#include <cassert>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
using namespace aare;
|
||||
namespace po = boost::program_options;
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
logger::set_verbosity(logger::DEBUG);
|
||||
// 1. connect to ventilator and sink
|
||||
ZmqWorker worker("tcp://127.0.0.1:4321", "tcp://127.0.0.1:4322");
|
||||
|
||||
while (true) {
|
||||
// 2. receive Task from ventilator
|
||||
Task *ventilator_task = worker.pull();
|
||||
logger::info("Received Task, id=", ventilator_task->id, " data_size=", ventilator_task->data_size);
|
||||
|
||||
Task *sink_task = Task::init(nullptr, 0);
|
||||
sink_task->id = ventilator_task->id;
|
||||
sink_task->opcode = (size_t)Task::Operation::COUNT;
|
||||
worker.push(sink_task);
|
||||
|
||||
Task::destroy(sink_task);
|
||||
Task::destroy(ventilator_task);
|
||||
}
|
||||
// read the command line arguments
|
||||
}
|
Reference in New Issue
Block a user