Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JCF: update names as described in DUNE-DAQ/daq-release#376 and detail… #71

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ allows the WIB2 configuration options to be used.
`readoutmodules` provides several `DAQModule`s that are listed here:
* `DataLinkHandler`: Abstraction for one link of the DAQ. It receives input from a frontend as raw data and buffers it in memory. Data can be retrieved through a request/response mechanism (requests are of the type `DataRequest` and the response is a `Fragment`). Additionaly, data can be recorded for a specified amount of time and written to disk through a high performance mechanism. The module can handle different frontends and some support additional features. For example, for WIB, software tpg is available and can be enabled. For more details, consult the `readoutlibs` repo that defines and implements a `ReadoutModel`, which this module wraps.
* `FakeCardReader`: This module emulates a frontend that pushes raw data to a `DataLinkHandler` by reading raw data from a file and repeating it over and over, while updating the timestamps of the data. A slowdown factor can be set to run at a lower speed which makes it possible to run the whole DAQ on less powerful systems.
* `DataRecorder`: Receives data from an input queue and writes it to disk. It supports writing with `O_DIRECT`, making it more performant in some scenarios.
* `DataRecorderModule`: Receives data from an input queue and writes it to disk. It supports writing with `O_DIRECT`, making it more performant in some scenarios.
* `FragmentConsumer`: Consumes fragments and does some sanity checks of the data (for now just for WIB data) like checking the timestamps of the data against the requested window.
* `ErroredFrameConsumer`: Consumes error frames, this module is used as long as there is no other consumer for this information.
* `TimeSyncConsumer`: Consumes timesync messages (and nothing more). Can be used in the standalone readout app.
4 changes: 2 additions & 2 deletions include/readoutmodules/DataLinkHandlerBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "rcif/cmd/Nljs.hpp"

#include "appfwk/ModuleConfiguration.hpp"
#include "appmodel/ReadoutModule.hpp"
#include "appmodel/DataHandlerModule.hpp"

#include <chrono>
#include <memory>
Expand Down Expand Up @@ -50,7 +50,7 @@ class DataLinkHandlerBase
void get_info(opmonlib::InfoCollector& ci, int level);

virtual std::unique_ptr<dunedaq::readoutlibs::ReadoutConcept>
create_readout(const appmodel::ReadoutModule* modconf, std::atomic<bool>& run_marker) = 0;
create_readout(const appmodel::DataHandlerModule* modconf, std::atomic<bool>& run_marker) = 0;

// Commands
void do_conf(const nlohmann::json& /*args*/);
Expand Down
6 changes: 3 additions & 3 deletions include/readoutmodules/FakeCardReaderBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

#include "confmodel/DaqModule.hpp"
#include "confmodel/Connection.hpp"
#include "confmodel/QueueWithId.hpp"
#include "confmodel/QueueWithSourceId.hpp"
#include "confmodel/DetectorToDaqConnection.hpp"
#include "confmodel/DetDataSender.hpp"
#include "confmodel/DetectorStream.hpp"
#include "appmodel/DataReader.hpp"
#include "appmodel/DataReaderConf.hpp"
#include "appmodel/DataReceiverModule.hpp"
#include "appmodel/DataReceiverConf.hpp"

#include "appfwk/ModuleConfiguration.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/readoutmodules/ReadoutModulesIssues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ERS_DECLARE_ISSUE(readoutmodules,
((std::string)queueType)((std::string)moduleName))

ERS_DECLARE_ISSUE_BASE(readoutmodules,
DataRecorderResourceQueueError,
DataRecorderModuleResourceQueueError,
readoutmodules::DataRecorderConfigurationError,
" The " << queueType << " queue was not successfully created. ",
((std::string)name),
Expand Down
4 changes: 2 additions & 2 deletions include/readoutmodules/detail/DataLinkHandlerBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ DataLinkHandlerBase::init(std::shared_ptr<appfwk::ModuleConfiguration> cfg)
{

TLOG_DEBUG(dunedaq::readoutlibs::logging::TLVL_ENTER_EXIT_METHODS) << get_dlh_name() << ": Entering init() method";
const appmodel::ReadoutModule* modconf = cfg->module<appmodel::ReadoutModule>(get_dlh_name());
const appmodel::DataHandlerModule* modconf = cfg->module<appmodel::DataHandlerModule>(get_dlh_name());
if(modconf == nullptr) {
throw dunedaq::readoutmodules::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), "not a ReadoutModule");
throw dunedaq::readoutmodules::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), "not a DataHandlerModule");
}
m_readout_impl = create_readout(modconf, m_run_marker);
if (m_readout_impl == nullptr) {
Expand Down
8 changes: 4 additions & 4 deletions include/readoutmodules/detail/FakeCardReaderBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FakeCardReaderBase::init(std::shared_ptr<appfwk::ModuleConfiguration> cfg)
m_cfg = cfg;
TLOG_DEBUG(dunedaq::readoutlibs::logging::TLVL_ENTER_EXIT_METHODS) << get_fcr_name() << ": Entering init() method";
//auto ini = args.get<appfwk::app::ModInit>();
auto ini = cfg->module<appmodel::DataReader>(m_name);
auto ini = cfg->module<appmodel::DataReceiverModule>(m_name);
if (ini != nullptr && ini->get_configuration()->get_emulation_mode()) {

for (auto qi : ini->get_outputs()) {
Expand Down Expand Up @@ -62,7 +62,7 @@ FakeCardReaderBase::do_conf(const nlohmann::json& /*args*/)
if (m_configured) {
TLOG_DEBUG(dunedaq::readoutlibs::logging::TLVL_WORK_STEPS) << "This module is already configured!";
} else {
auto cfg = m_cfg->module<appmodel::DataReader>(get_fcr_name());
auto cfg = m_cfg->module<appmodel::DataReceiverModule>(get_fcr_name());

std::map<uint32_t, const confmodel::DetectorStream*> streams;
for (const auto & det_connections : cfg->get_connections()) {
Expand All @@ -81,9 +81,9 @@ FakeCardReaderBase::do_conf(const nlohmann::json& /*args*/)
}

for (const auto& qi : cfg->get_outputs()) {
auto q_with_id = qi->cast<confmodel::QueueWithId>();
auto q_with_id = qi->cast<confmodel::QueueWithSourceId>();
if (q_with_id == nullptr) {
throw readoutlibs::FailedFakeCardInitialization(ERS_HERE, get_fcr_name(), "Queue is not of type QueueWithId");
throw readoutlibs::FailedFakeCardInitialization(ERS_HERE, get_fcr_name(), "Queue is not of type QueueWithSourceId");
}
if (m_source_emus.find(q_with_id->UID()) == m_source_emus.end()) {
TLOG() << "Cannot find queue: " << q_with_id->UID() << std::endl;
Expand Down
Loading