Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fab07db
Add DataflowStatusModule configuration objects. oks-format schema file
eflumerf Jun 29, 2026
29197f2
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Jun 29, 2026
832772c
Add more attributes to DataflowStatusModuleConf
eflumerf Jul 6, 2026
dd856ba
Remove trigger_record_output from TRBModule configuration
eflumerf Jul 13, 2026
5dfc5f7
Add more timeout and reallocation configuration to DFOConf. Remove de…
eflumerf Jul 14, 2026
d0bac4b
Update DFApplication and DFOApplication to correctly generate
eflumerf Jul 15, 2026
ed1c9a9
Fix direction for requests, add check on DataflowStatus in DFO
eflumerf Jul 16, 2026
5eae642
Make DFOApplication a Resource so it can be disabled in Sessions
eflumerf Jul 16, 2026
085e2f1
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Aug 3, 2026
926c452
Update schema header
eflumerf Aug 3, 2026
fa82b25
Label DFO TriggerDecision input with application name. Pass all Trigg…
eflumerf Aug 4, 2026
9a35857
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Aug 19, 2026
77ea6a0
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Aug 20, 2026
bc34065
Linting updates
eflumerf Aug 28, 2026
3d191b8
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Sep 1, 2026
d392531
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Sep 10, 2026
b1aa184
Update DFOApplication excludability
eflumerf Sep 10, 2026
032b833
Apply clang-format and lint suggestions
eflumerf Sep 24, 2026
686b6ac
Merge remote-tracking branch 'origin/prep-release/fddaq-v5.7.0' into …
eflumerf Sep 24, 2026
70f8bb3
Merge remote-tracking branch 'origin/develop' into eflumerf/Linting
eflumerf Sep 30, 2026
5ea05b2
Merge remote-tracking branch 'origin/develop' into eflumerf/DFOProtoc…
eflumerf Oct 1, 2026
2b70cf7
Apply dbt-clang-format
eflumerf Oct 1, 2026
0ad06fb
Run dbt-clang-format again
eflumerf Oct 1, 2026
af0da61
Merge remote-tracking branch 'origin/eflumerf/Linting' into eflumerf/…
eflumerf Oct 2, 2026
5e388ff
Linting fixes
eflumerf Oct 2, 2026
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
24 changes: 10 additions & 14 deletions include/appmodel/ConfigurationHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/
#ifndef APPMODEL_INCLUDE_CONFIGURATIONHELPER_HPP_
#define APPMODEL_INCLUDE_CONFIGURATIONHELPER_HPP_
#ifndef APPMODEL_INCLUDE_APPMODEL_CONFIGURATIONHELPER_HPP_
#define APPMODEL_INCLUDE_APPMODEL_CONFIGURATIONHELPER_HPP_

#include "appmodel/NetworkConnectionDescriptor.hpp"
#include "appmodel/SourceIDConf.hpp"
#include "conffwk/DalObject.hpp"
#include "confmodel/Service.hpp"
#include "confmodel/Session.hpp"

#include <cstdint>
#include <map>
#include <string>
#include <utility>
#include <vector>

namespace dunedaq::confmodel {
class Session;
class Service;
} // namespace dunedaq::confmodel
namespace dunedaq::conffwk {
class DalObject;
} // namespace dunedaq::conffwk

namespace dunedaq::appmodel {
class NetworkConnectionDescriptor;
class SourceIDConf;

/// Helper class to extract information from Session object without
/// exposing the Session to user code
Expand Down Expand Up @@ -68,7 +64,7 @@ class ConfigurationHelper
///
/// @returns A map of application uids to vectors of streams that
/// they contain
std::map<std::string, std::vector<uint32_t>> get_stream_source_ids();
std::map<std::string, std::vector<uint32_t>> get_stream_source_ids(); // NOLINT(build/unsigned)

/// @brief Get the source ids of all the TP streams in all
/// ReadoutApplications and TriggerApplications
Expand Down Expand Up @@ -134,4 +130,4 @@ class ConfigurationHelper

} // namespace dunedaq::appmodel

#endif // APPMODEL_INCLUDE_CONFIGURATIONHELPER_HPP_
#endif // APPMODEL_INCLUDE_APPMODEL_CONFIGURATIONHELPER_HPP_
18 changes: 14 additions & 4 deletions include/appmodel/appmodelIssues.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@

#ifndef APPDALISSUES_HPP
#define APPDALISSUES_HPP
/**
* @file appmodelIssues.hpp
*
* Define common ERS issues for the appmodel package
*
* This is part of the DUNE DAQ Software Suite, copyright 2023.
* Licensing/copyright details are in the COPYING file that you should have
* received with this code.
*/
#ifndef APPMODEL_INCLUDE_APPMODEL_APPMODELISSUES_HPP_
#define APPMODEL_INCLUDE_APPMODEL_APPMODELISSUES_HPP_

#include "ers/Issue.hpp"
#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.

#include <string>

namespace dunedaq {
ERS_DECLARE_ISSUE(appmodel, BadConf, what, ((std::string)what))
ERS_DECLARE_ISSUE(appmodel,
Expand All @@ -30,4 +40,4 @@ ERS_DECLARE_ISSUE(appmodel, BadD2d, "Contained object is not a DetectorToDaqConn

} // namespace dunedaq

#endif // APPDALISSUES_HPP
#endif // APPMODEL_INCLUDE_APPMODEL_APPMODELISSUES_HPP_
9 changes: 6 additions & 3 deletions pybindsrc/dal_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

#include "appmodel/SmartDaqApplication.hpp"

#include <memory>
#include <sstream>
#include <string>
#include <vector>

namespace py = pybind11;

Expand All @@ -37,14 +40,14 @@ smart_daq_application_generate_modules(const conffwk::Configuration& confdb,
const std::string& app_id,
const std::string& session_id)
{
auto app = const_cast<conffwk::Configuration&>(confdb).get<appmodel::SmartDaqApplication>(app_id);
auto session = const_cast<conffwk::Configuration&>(confdb).get<confmodel::Session>(session_id);
auto app = const_cast<conffwk::Configuration&>(confdb).get<appmodel::SmartDaqApplication>(app_id); // NOLINT
auto session = const_cast<conffwk::Configuration&>(confdb).get<confmodel::Session>(session_id); // NOLINT

auto helper = std::make_shared<ConfigurationHelper>(session);
app->generate_modules(helper);
std::vector<ObjectLocator> mods;
for (auto mod : app->get_modules()) {
mods.push_back({ mod->UID(), mod->class_name() });
mods.emplace_back(mod->UID(), mod->class_name());
}
return mods;
}
Expand Down
33 changes: 27 additions & 6 deletions schema/appmodel/application.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<oks-schema>

<info name="" type="" num-of-items="72" oks-format="schema" oks-version="862f2957270" created-by="gjc" created-on="thinkpad" creation-time="20230616T091343" last-modified-by="biery" last-modified-on="daq.fnal.gov" last-modification-time="20260709T155231"/>
<info name="" type="" num-of-items="74" oks-format="schema" oks-version="862f2957270" created-by="gjc" created-on="thinkpad" creation-time="20230616T091343" last-modified-by="eflumerf" last-modified-on="ironvirt9.mshome.net" last-modification-time="20260803T200908"/>

<include>
<file path="schema/confmodel/dunedaq.schema.xml"/>
Expand All @@ -105,6 +105,7 @@
<class name="DFApplication">
<superclass name="SmartDaqApplication"/>
<superclass name="ExcludableEntity"/>
<relationship name="dfs" description="Configuration of the DataflowSTatusModule to be generated by get_modules()" class-type="DataflowStatusModuleConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="trb" description="Configuration of the TRB to be generated my get_modules()" class-type="TRBConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="data_writers" class-type="DataWriterConf" low-cc="one" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="uses" class-type="DFHWConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
Expand All @@ -119,18 +120,22 @@

<class name="DFOApplication">
<superclass name="SmartDaqApplication"/>
<superclass name="ExcludableEntity"/>
<relationship name="dfo" class-type="DFOConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<method name="generate_modules" description="Generate DaqModule dal objects for streams of the application on the fly">
<method-implementation language="c++" prototype="void generate_modules(std::shared_ptr&lt;appmodel::ConfigurationHelper&gt;) const override" body="BEGIN_HEADER_PROLOGUE&#xA;#include &quot;appmodel/ConfigurationHelper.hpp&quot;&#xA;END_HEADER_PROLOGUE"/>
</method>
</class>

<class name="DFOConf">
<attribute name="general_queue_timeout_ms" type="u32" is-not-null="yes"/>
<attribute name="stop_timeout_ms" type="u32" is-not-null="yes"/>
<attribute name="general_queue_timeout_ms" type="u32" init-value="100" is-not-null="yes"/>
<attribute name="stop_timeout_ms" type="u32" init-value="1000" is-not-null="yes"/>
<attribute name="request_reply_wait_ms" type="u32" init-value="100" is-not-null="yes"/>
<attribute name="td_send_retries" type="s32" init-value="5"/>
<attribute name="busy_threshold" type="s32" init-value="10"/>
<attribute name="free_threshold" type="s32" init-value="5"/>
<attribute name="reallocate_building_triggers_on_timeout" type="bool" init-value="false" is-not-null="yes"/>
<attribute name="reallocate_writing_triggers_on_timeout" type="bool" init-value="false" is-not-null="yes"/>
<attribute name="status_watchdog_interval_ms" type="u32" init-value="1000" is-not-null="yes"/>
<attribute name="dataflow_status_timeout_ms" type="u32" init-value="5000" is-not-null="yes"/>
</class>

<class name="DFOModule">
Expand Down Expand Up @@ -239,6 +244,22 @@
<relationship name="configuration" class-type="DataWriterConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="DataflowStatusModule">
<superclass name="DaqModule"/>
<relationship name="configuration" class-type="DataflowStatusModuleConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="DataflowStatusModuleConf">
<attribute name="trigger_type_mask" type="u64" is-not-null="yes"/>
<attribute name="busy_threshold" type="s32" init-value="10"/>
<attribute name="free_threshold" type="s32" init-value="5"/>
<attribute name="heartbeat_interval_ms" type="u32" init-value="100" is-not-null="yes"/>
<attribute name="stop_timeout_ms" type="u32" init-value="1000" is-not-null="yes"/>
<attribute name="td_queue_timeout_ms" type="u32" init-value="1000" is-not-null="yes"/>
<attribute name="snapshot_history_size" type="u32" init-value="100" is-not-null="yes"/>
<attribute name="completed_trigger_history_size" type="u32" init-value="100" is-not-null="yes"/>
</class>

<class name="DetectorFrameBuilderConf">
<attribute name="template_for" description="OKS class of the DetectorFrameBuilderModule that this config is a template for" type="class" init-value="DetectorFrameBuilderModule" is-not-null="yes"/>
</class>
Expand Down Expand Up @@ -591,6 +612,7 @@
<attribute name="tr_queue_timeout" type="u32" init-value="0" is-not-null="yes"/>
<attribute name="request_queue_timeout" type="u32" init-value="0" is-not-null="yes"/>
<attribute name="trigger_record_timeout_ms" type="u32" init-value="0" is-not-null="yes"/>
<attribute name="trb_complete_timeout" type="u32" init-value="1000"/>
<attribute name="max_sequence_length_ticks" type="s64" init-value="0" is-not-null="yes"/>
<attribute name="source_id" type="u32" is-not-null="yes"/>
<attribute name="maximum_open_trigger_records" type="u32" init-value="100" is-not-null="yes"/>
Expand All @@ -599,7 +621,6 @@
<class name="TRBModule">
<superclass name="DaqModule"/>
<relationship name="configuration" class-type="TRBConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="trigger_record_output" class-type="Connection" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="request_connections" class-type="SourceIDToNetworkConnection" low-cc="zero" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

Expand Down
12 changes: 6 additions & 6 deletions src/CIBApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <bitset>
#include <fmt/core.h>
#include <iostream>
#include <memory>
#include <set>
#include <string>
#include <vector>
Expand Down Expand Up @@ -106,14 +107,14 @@ CIBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
// Process special Network rules!
// Looking for Fragment rules from DFAppplications in current Session
std::vector<conffwk::ConfigObject> fragOutObjs;
for (auto [uid, descriptor] : helper->get_netdescriptors("Fragment", "DFApplication")) {
for (auto const& [uid, descriptor] : helper->get_netdescriptors("Fragment", "DFApplication")) {
fragOutObjs.emplace_back(obj_fac.create_net_obj(descriptor, uid));
}

// start building the list of outputs
std::vector<const conffwk::ConfigObject*> fh_output_objs;
for (auto& fNet : fragOutObjs) {
fh_output_objs.push_back(&fNet);
fh_output_objs.push_back(&fNet); // NOLINT(performance-inefficient-vector-operation)
}

std::vector<conffwk::ConfigObject> CIB_module_outputs;
Expand All @@ -124,8 +125,7 @@ CIBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
// ----------------------------
// create DLH
// ----------------------------
int det_id = 1; // TODO Eric Flumerfelt <eflumerf@fnal.gov>, 08-Feb-2024: This is a magic number corresponding to kDAQ
// // NOLINT(readability/todo)
int det_id = 1; // This is a magic number corresponding to kDAQ
TLOG() << "creating OKS configuration object for CIB Data Link Handler class " << dlhClass << ", id " << id;
std::string uid("DLH-CIB");
conffwk::ConfigObject dlhObj = obj_fac.create(dlhClass, uid);
Expand Down Expand Up @@ -171,7 +171,7 @@ CIBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>

std::vector<const conffwk::ConfigObject*> CIB_module_output_ptrs;
for (const auto& o : CIB_module_outputs) {
CIB_module_output_ptrs.push_back(&o);
CIB_module_output_ptrs.push_back(&o); // NOLINT(performance-inefficient-vector-operation)
}

module_obj.set_objs("outputs", CIB_module_output_ptrs);
Expand All @@ -187,7 +187,7 @@ CIBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
nlohmann::json
CIBoardConf::get_cib_json(const dunedaq::confmodel::Session& session,
std::optional<std::string> socket_host,
std::optional<uint16_t> socket_port) const
std::optional<uint16_t> socket_port) const // NOLINT(build/unsigned)
{

// shut up compiler!
Expand Down
22 changes: 12 additions & 10 deletions src/CTBApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include <bitset>
#include <fmt/core.h>
#include <iostream>
#include <list>
#include <memory>
#include <set>
#include <string>
#include <vector>
Expand All @@ -60,7 +62,7 @@ std::vector<const confmodel::ExcludableEntity*>
CTBApplication::contained_excludable_entities() const
{
std::vector<const confmodel::ExcludableEntity*> resources;
resources.push_back(dynamic_cast<const confmodel::ExcludableEntity*>(get_board()));
resources.push_back(dynamic_cast<const confmodel::ExcludableEntity*>(get_board())); // NOLINT(runtime/rtti)
return resources;
}

Expand Down Expand Up @@ -122,14 +124,15 @@ CTBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
// Process special Network rules!
// Looking for Fragment rules from DFAppplications in current Session
std::vector<conffwk::ConfigObject> fragOutObjs;
for (auto [uid, descriptor] : helper->get_netdescriptors("Fragment", "DFApplication")) {
fragOutObjs.emplace_back(obj_fac.create_net_obj(descriptor, uid));
for (auto const& [uid, descriptor] : helper->get_netdescriptors("Fragment", "DFApplication")) {
fragOutObjs.emplace_back(
obj_fac.create_net_obj(descriptor, uid)); // NOLINT(performance-inefficient-vector-operation)
}

// start building the list of outputs
std::vector<const conffwk::ConfigObject*> fh_output_objs;
for (auto& fNet : fragOutObjs) {
fh_output_objs.push_back(&fNet);
fh_output_objs.push_back(&fNet); // NOLINT(performance-inefficient-vector-operation)
}

std::vector<conffwk::ConfigObject> ctb_module_outputs;
Expand All @@ -144,14 +147,13 @@ CTBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
// ----------------------------
// create DLH
// ----------------------------
auto det_id =
1; // TODO Eric Flumerfelt <eflumerf@fnal.gov>, 08-Feb-2024: This is a magic number corresponding to kDAQ
auto det_id = 1; // This is a magic number corresponding to kDAQ
TLOG() << "creating OKS configuration object for " + s.first + " Data Link Handler class " << dlhClass << ", id "
<< id;
std::string uid("DLH-" + s.first);
conffwk::ConfigObject dlhObj = obj_fac.create(dlhClass, uid);
dlhObj.set_by_val<uint32_t>("source_id", id);
dlhObj.set_by_val<uint32_t>("detector_id", det_id);
dlhObj.set_by_val<uint32_t>("source_id", id); // NOLINT(build/unsigned)
dlhObj.set_by_val<uint32_t>("detector_id", det_id); // NOLINT(build/unsigned)
dlhObj.set_by_val<bool>("post_processing_enabled", false);
dlhObj.set_obj("module_configuration", &dlhConf->config_object());

Expand Down Expand Up @@ -193,7 +195,7 @@ CTBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>

std::vector<const conffwk::ConfigObject*> ctb_module_output_ptrs;
for (const auto& o : ctb_module_outputs) {
ctb_module_output_ptrs.push_back(&o);
ctb_module_output_ptrs.push_back(&o); // NOLINT(performance-inefficient-vector-operation)
}

module_obj.set_objs("outputs", ctb_module_output_ptrs);
Expand All @@ -203,7 +205,7 @@ CTBApplication::generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>
modules.push_back(module);

obj_fac.update_modules(modules);
}
} // NOLINT(readability/fn_size)

std::vector<const confmodel::ExcludableEntity*>
CTBoardConf::contained_excludable_entities() const
Expand Down
Loading
Loading