Skip to content
6 changes: 6 additions & 0 deletions artdaq/Application/DataLoggerCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ bool artdaq::DataLoggerCore::initialize(fhicl::ParameterSet const& pset)
TLOG(50) << "In any case, if you are using multiple art analyzers, make sure to set \"shared_memory_ordering\" to false in the DataLogger configuration to avoid issues with events not being received by the art analyzers.";
}

if (!agg_pset.has_key("init_fragment_count"))
{
TLOG(TLVL_ERROR) << "ERROR: init_fragment_count must be set for the DataLogger to function properly. Please set `init_fragment_count: 0` in the DataLogger configuration. (Will be book-kept by DAQInterface)";
return false;
}

// initialize the MetricManager and the names of our metrics
fhicl::ParameterSet metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics", fhicl::ParameterSet());

Expand Down
5 changes: 5 additions & 0 deletions artdaq/Application/DispatcherCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ bool artdaq::DispatcherCore::initialize(fhicl::ParameterSet const& pset)
return false;
}

if (!agg_pset.has_key("init_fragment_count"))
{
TLOG(TLVL_ERROR) << "ERROR: init_fragment_count must be set for the Dispatcher to function properly. Please set `init_fragment_count: 0` in the Dispatcher configuration. (Will be book-kept by DAQInterface)";
return false;
}
broadcast_mode_ = agg_pset.get<bool>("broadcast_mode", true);
allow_label_overwrites_ = agg_pset.get<bool>("allow_label_overwrites", true);
if (broadcast_mode_ && !agg_pset.has_key("broadcast_mode"))
Expand Down
15 changes: 13 additions & 2 deletions artdaq/ArtModules/ArtdaqSharedMemoryService_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class ArtdaqSharedMemoryService : public ArtdaqSharedMemoryServiceInterface
private:
std::unique_ptr<artdaq::SharedMemoryEventReceiver> incoming_events_;
std::list<std::shared_ptr<ArtdaqEvent>> event_ordering_;
std::set<artdaq::Fragment::sequence_id_t> released_broadcast_sequence_ids_;
size_t read_timeout_;
size_t subrun_closure_threshold_{1};
double safety_valve_timeout_s_{10.0};
Expand Down Expand Up @@ -309,9 +310,19 @@ std::shared_ptr<ArtdaqEvent> ArtdaqSharedMemoryService::ReceiveEvent(bool broadc
{
// First Fragment is broadcast (begin/end run/subrun), but there's more in event ordering!
TLOG(TLVL_RECEIVEEVENT) << "Returning Broadcast Fragment due to subrun closure";
output_event = event_ordering_.front();

if (released_broadcast_sequence_ids_.count(event_ordering_.front()->header->sequence_id) == 0)
{
output_event = event_ordering_.front();
released_broadcast_sequence_ids_.insert(event_ordering_.front()->header->sequence_id);
while (released_broadcast_sequence_ids_.size() > 1000) { released_broadcast_sequence_ids_.erase(released_broadcast_sequence_ids_.begin()); }
}
else
{
TLOG(TLVL_WARNING) << "Discarding duplicate Broadcast with sequence ID " << event_ordering_.front()->header->sequence_id << " and count " << event_ordering_.front()->fragments.size();
}
event_ordering_.pop_front();
break; // while(output_event == nullptr)
continue; // while(output_event == nullptr)
}
}
else if (current_subrun_ != 0 && first_sr > current_subrun_ + 1)
Expand Down
2 changes: 1 addition & 1 deletion artdaq/DAQrate/SharedMemoryEventManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ void artdaq::SharedMemoryEventManager::send_init_frags_()
}
else if (init_fragment_count_ > 0 && init_fragment_map_size_() == 0)
{
TLOG(TLVL_WARNING) << "Cannot send Init Fragment(s) because I haven't yet received them! Set send_init_fragments to false or init_fragment_count to 0 if this process does not receive serialized art events to avoid potentially lengthy timeouts!";
TLOG(TLVL_INFO) << "Cannot send Init Fragment(s) because I haven't yet received any! Set send_init_fragments to false or init_fragment_count to 0 if this process does not receive serialized art events to avoid potentially lengthy timeouts!";
}
else if (init_fragment_count_ > 0)
{
Expand Down