Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • laolivei/Allen
  • pvfinder/inference-engine
  • rmatev/Allen
  • suali/Allen
  • mstahl/Allen
  • roneil/Allen
  • graemes/Allen
  • cburr/Allen
  • jonrob/Allen
  • bjashal/Allen-HIP
  • dcampora/MiniAllen
  • brij/Allen
  • raaij/cuda_hlt
  • bsm-fleet/cuda_hlt
  • abrearod/cuda_hlt
  • aalvesju/cuda_hlt
  • lhcb/Allen
17 results
Show changes
Commits on Source (10)
This diff is collapsed.
......@@ -4,7 +4,8 @@
from AllenCore.generator import make_algorithm
from AllenAlgorithms.algorithms import (
host_init_number_of_events_t, host_data_provider_t,
host_global_event_cut_t, layout_provider_t, check_pvs_t, low_occupancy_t)
host_global_event_cut_t, layout_provider_t, check_pvs_t, low_occupancy_t,
host_odin_error_filter_t)
from PyConf.tonic import configurable
from PyConf.control_flow import NodeLogic, CompositeNode
......@@ -18,14 +19,20 @@ def make_line_composite_node(name, algos):
@configurable
def line_maker(line_algorithm, prefilter=None):
if prefilter is None: node = line_algorithm
odin_filter = odin_error_filter("odin_error_filter")
#add odin error filter by default
if prefilter is None:
node = make_line_composite_node(
line_algorithm.name, algos=[odin_filter, line_algorithm])
else:
if isinstance(prefilter, list):
node = make_line_composite_node(
line_algorithm.name, algos=prefilter + [line_algorithm])
line_algorithm.name,
algos=prefilter + [odin_filter, line_algorithm])
else:
node = make_line_composite_node(
line_algorithm.name, algos=[prefilter, line_algorithm])
line_algorithm.name,
algos=[odin_filter, prefilter, line_algorithm])
return line_algorithm, node
......@@ -88,6 +95,13 @@ def gec(name="gec", min_scifi_ut_clusters=0, max_scifi_ut_clusters=9750):
return gec
def odin_error_filter(name="odin_error_filter"):
number_of_events = initialize_number_of_events()
odin_error_filter = make_algorithm(
host_odin_error_filter_t, name="odin_error_filter")
return odin_error_filter
def mep_layout():
layout = make_algorithm(layout_provider_t, name="mep_layout")
return {
......
......@@ -3,6 +3,7 @@
###############################################################################
add_subdirectory(data_provider)
add_subdirectory(global_event_cut)
add_subdirectory(error_banks_cut)
add_subdirectory(velo/clustering)
add_subdirectory(prefix_sum)
add_subdirectory(init_event_list)
......
###############################################################################
# (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration #
###############################################################################
file(GLOB host_error_bank "src/*cpp")
allen_add_host_library(HostErrorBanks STATIC
${host_error_bank}
)
target_link_libraries(HostErrorBanks PRIVATE HostEventModel EventModel Gear AllenCommon Backend)
target_include_directories(HostErrorBanks PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
/*****************************************************************************\
* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration *
\*****************************************************************************/
#pragma once
#include "Common.h"
#include "AlgorithmTypes.cuh"
#include <gsl/span>
#include "InputProvider.h"
namespace host_odin_error_filter {
struct Parameters {
HOST_OUTPUT(host_event_list_output_t, unsigned) host_event_list;
HOST_OUTPUT(host_number_of_events_t, unsigned) host_number_of_events;
HOST_OUTPUT(host_number_of_selected_events_t, unsigned) host_number_of_selected_events;
DEVICE_OUTPUT(dev_number_of_events_t, unsigned) dev_number_of_events;
MASK_OUTPUT(dev_event_list_output_t) dev_event_list;
};
// Algorithm
struct host_odin_error_filter_t : public HostAlgorithm, Parameters {
void set_arguments_size(
ArgumentReferences<Parameters> arguments,
const RuntimeOptions& runtime_options,
const Constants&,
const HostBuffers&) const;
void operator()(
const ArgumentReferences<Parameters>& arguments,
const RuntimeOptions& runtime_options,
const Constants&,
HostBuffers& host_buffers,
const Allen::Context& context) const;
};
} // namespace host_odin_error_filter
/*****************************************************************************\
* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration *
\*****************************************************************************/
#include "HostOdinErrorFilter.h"
INSTANTIATE_ALGORITHM(host_odin_error_filter::host_odin_error_filter_t)
void host_odin_error_filter::host_odin_error_filter_t::set_arguments_size(
ArgumentReferences<Parameters> arguments,
const RuntimeOptions& runtime_options,
const Constants&,
const HostBuffers&) const
{
const auto number_of_events =
std::get<1>(runtime_options.event_interval) - std::get<0>(runtime_options.event_interval);
set_size<host_number_of_selected_events_t>(arguments, 1);
set_size<host_number_of_events_t>(arguments, 1);
set_size<host_event_list_output_t>(arguments, number_of_events);
set_size<dev_number_of_events_t>(arguments, 1);
set_size<dev_event_list_output_t>(arguments, number_of_events);
}
void host_odin_error_filter::host_odin_error_filter_t::operator()(
const ArgumentReferences<Parameters>& arguments,
const RuntimeOptions& runtime_options,
const Constants&,
HostBuffers& host_buffers,
const Allen::Context& context) const
{
const auto event_start = std::get<0>(runtime_options.event_interval);
const auto event_end = std::get<1>(runtime_options.event_interval);
const auto number_of_events = event_end - event_start;
// Initialize number of events
data<host_number_of_events_t>(arguments)[0] = number_of_events;
auto event_mask_odin = runtime_options.input_provider->event_mask(runtime_options.slice_index);
unsigned size_of_list = 0;
for (unsigned event_index = 0; event_index < number_of_events; ++event_index) {
unsigned event_number = event_index;
if (event_mask_odin[event_number] == 1) {
data<host_event_list_output_t>(arguments)[size_of_list++] = event_number;
}
}
data<host_number_of_selected_events_t>(arguments)[0] = size_of_list;
// Reduce the size of the event lists to the selected events
reduce_size<host_event_list_output_t>(arguments, first<host_number_of_selected_events_t>(arguments));
reduce_size<dev_event_list_output_t>(arguments, first<host_number_of_selected_events_t>(arguments));
// Copy data to the device
Allen::copy_async<dev_number_of_events_t, host_number_of_events_t>(arguments, context);
Allen::copy_async<dev_event_list_output_t, host_event_list_output_t>(arguments, context);
host_buffers.host_number_of_selected_events = first<host_number_of_selected_events_t>(arguments);
}
......@@ -60,6 +60,15 @@ public:
std::optional<size_t> first = std::nullopt,
std::optional<size_t> last = std::nullopt) const = 0;
/**
* @brief Get event mask in a given slice (ODIN erro bank)
*
* @param slice index
*
* @return event mask
*/
virtual std::vector<char> event_mask(size_t slice_index) const = 0;
/**
* @brief Indicate a slice is free for filling
*
......
......@@ -264,6 +264,15 @@ public:
return {ids.begin() + (first ? *first : 0), ids.begin() + (last ? *last : ids.size())};
}
/**
* @brief Obtain event mask in a given slice (ODIN error)
*
* @param slice index
*
* @return event mask in given slice
*/
std::vector<char> event_mask(size_t slice_index) const override { return m_masks[slice_index]; }
/**
* @brief Obtain banks from a slice
*
......
......@@ -29,7 +29,13 @@ class TESProvider final : public InputProvider {
public:
TESProvider(size_t n_slices, size_t events_per_slice, std::optional<size_t> n_events) :
InputProvider {n_slices, events_per_slice, {}, IInputProvider::Layout::Allen, n_events}
{}
{
// setting here the event mask to be 1 for every event
m_masks.resize(n_slices);
for (auto& mask : m_masks) {
mask.resize(events_per_slice, 1);
}
}
/**
* @brief Get banks in the format they are stored in TES
......@@ -115,6 +121,15 @@ public:
return EventIDs {};
}
/**
* @brief Obtain event mask in a given slice (ODIN error)
*
* @param slice index
*
* @return event mask in given slice
*/
std::vector<char> event_mask(size_t slice_index) const override { return m_masks[slice_index]; }
void slice_free(size_t) override {};
std::tuple<bool, bool, bool, size_t, size_t, std::any> get_slice(std::optional<unsigned int> = {}) override
......@@ -136,4 +151,5 @@ private:
std::array<std::array<unsigned int, 2>, NBankTypes> m_offsets;
std::array<std::vector<unsigned>, NBankTypes> m_sizes;
std::array<std::vector<unsigned>, NBankTypes> m_types;
std::vector<std::vector<char>> m_masks;
};
......@@ -147,6 +147,7 @@ namespace LHCb {
DaqErrorSyncBXIDCorrupted, // 91
DaqErrorFragmentMissing, // 92
DaqErrorFragmentTruncated, // 93
DaqErrorIdleBXIDCorrupted, // 94
// Add new types here. Don't forget to update also RawBank.cpp
LastType, // LOOP Marker; add new bank types ONLY before!
......
......@@ -24,7 +24,8 @@ size_t Allen::add_raw_bank(
// pad to a multiple of 4 bytes
auto const padded_size = padded_bank_size(fragment.size());
std::memset(bank->begin<char>() + fragment.size(), 0, padded_size - fragment.size());
assert(static_cast<unsigned long>(bank->totalSize()) == bank->hdrSize() + padded_size);
if (static_cast<LHCb::RawBank::BankType>(type) < LHCb::RawBank::BankType::DaqErrorFragmentThrottled)
assert(static_cast<unsigned long>(bank->totalSize()) == bank->hdrSize() + padded_size);
return bank->totalSize();
}
......@@ -28,6 +28,7 @@ target_link_libraries(Stream
VertexFitter
SciFi
HostGEC
HostErrorBanks
Calo
Muon
Examples
......