Skip to content

Commit

Permalink
Merge pull request #779 from krasznaa/ITkProcessingFixes-main-20241122
Browse files Browse the repository at this point in the history
ITk Processing Fixes, main branch (2024.11.22.)
  • Loading branch information
stephenswat authored Nov 22, 2024
2 parents dd918ac + 84e7f3e commit 6d98265
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 19 deletions.
2 changes: 1 addition & 1 deletion core/include/traccc/fitting/details/fit_tracks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ track_state_container_types::host fit_tracks(

// Make a vector of track states for this track.
vecmem::vector<track_state<typename fitter_t::algebra_type> >
input_states;
input_states{&mr};
input_states.reserve(track_candidates.get_items()[i].size());
for (auto& measurement : track_candidates.get_items()[i]) {
input_states.emplace_back(measurement);
Expand Down
4 changes: 3 additions & 1 deletion examples/run/alpaka/seq_example_alpaka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ int seq_run(const traccc::opts::detector& detector_opts,
traccc::performance::timer t("File reading (cpu)",
elapsedTimes);
// Read the cells from the relevant event file into host memory.
static constexpr bool DEDUPLICATE = true;
traccc::io::read_cells(cells_per_event, event,
input_opts.directory, &host_det_descr,
input_opts.format);
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
} // stop measuring file reading timer

n_cells += cells_per_event.size();
Expand Down
13 changes: 9 additions & 4 deletions examples/run/common/throughput_mt.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,22 @@ int throughput_mt(std::string_view description, int argc, char* argv[],
performance::timer t{"File reading", times};
// Set up the container for the input events.
input.reserve(input_opts.events);
for (std::size_t i = 0; i < input_opts.events; ++i) {
const std::size_t first_event = input_opts.skip;
const std::size_t last_event = input_opts.skip + input_opts.events;
for (std::size_t i = first_event; i < last_event; ++i) {
input.push_back({uncached_host_mr});
}
// Read the input cells into memory in parallel.
tbb::parallel_for(
tbb::blocked_range<std::size_t>{0u, input_opts.events},
tbb::blocked_range<std::size_t>{first_event, last_event},
[&](const tbb::blocked_range<std::size_t>& event_range) {
for (std::size_t event = event_range.begin();
event != event_range.end(); ++event) {
io::read_cells(input.at(event), event, input_opts.directory,
&det_descr, input_opts.format);
static constexpr bool DEDUPLICATE = true;
io::read_cells(input.at(event - input_opts.skip), event,
input_opts.directory, &det_descr,
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
}
});
}
Expand Down
7 changes: 5 additions & 2 deletions examples/run/common/throughput_st.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@ int throughput_st(std::string_view description, int argc, char* argv[],
performance::timer t{"File reading", times};
// Read the input cells into memory event-by-event.
input.reserve(input_opts.events);
for (std::size_t i = 0; i < input_opts.events; ++i) {
for (std::size_t i = input_opts.skip;
i < input_opts.skip + input_opts.events; ++i) {
input.push_back({uncached_host_mr});
static constexpr bool DEDUPLICATE = true;
io::read_cells(input.back(), i, input_opts.directory, &det_descr,
input_opts.format);
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
}
}

Expand Down
5 changes: 2 additions & 3 deletions examples/run/cpu/full_chain_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ full_chain_algorithm::output_type full_chain_algorithm::operator()(
*m_detector, m_field, measurements_view, track_params_view);

// Run the track fitting, and return its results.
const track_candidate_container_types::const_view
track_candidates_view = get_data(track_candidates);
return m_fitting(*m_detector, m_field, track_candidates_view);
const auto track_candidates_data = get_data(track_candidates);
return m_fitting(*m_detector, m_field, track_candidates_data);
}
// If not, just return an empty object.
else {
Expand Down
4 changes: 3 additions & 1 deletion examples/run/cpu/seq_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ int seq_run(const traccc::opts::input_data& input_opts,
{
traccc::performance::timer timer{"Read cells", elapsedTimes};
// Read the cells from the relevant event file
static constexpr bool DEDUPLICATE = true;
traccc::io::read_cells(cells_per_event, event,
input_opts.directory, &det_descr,
input_opts.format);
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
}

/*-------------------
Expand Down
6 changes: 4 additions & 2 deletions examples/run/cpu/throughput_mt.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2021-2022 CERN for the benefit of the ACTS project
* (c) 2021-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand All @@ -13,6 +13,8 @@
int main(int argc, char* argv[]) {

// Execute the throughput test.
static constexpr bool USE_HOST_CACHING = false;
return traccc::throughput_mt<traccc::full_chain_algorithm>(
"Multi-threaded host-only throughput tests", argc, argv);
"Multi-threaded host-only throughput tests", argc, argv,
USE_HOST_CACHING);
}
6 changes: 4 additions & 2 deletions examples/run/cpu/throughput_st.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2021-2022 CERN for the benefit of the ACTS project
* (c) 2021-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand All @@ -13,6 +13,8 @@
int main(int argc, char* argv[]) {

// Execute the throughput test.
static constexpr bool USE_HOST_CACHING = false;
return traccc::throughput_st<traccc::full_chain_algorithm>(
"Single-threaded host-only throughput tests", argc, argv);
"Single-threaded host-only throughput tests", argc, argv,
USE_HOST_CACHING);
}
4 changes: 3 additions & 1 deletion examples/run/cuda/seq_example_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ int seq_run(const traccc::opts::detector& detector_opts,
traccc::performance::timer t("File reading (cpu)",
elapsedTimes);
// Read the cells from the relevant event file into host memory.
static constexpr bool DEDUPLICATE = true;
traccc::io::read_cells(cells_per_event, event,
input_opts.directory, &host_det_descr,
input_opts.format);
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
} // stop measuring file reading timer

n_cells += cells_per_event.size();
Expand Down
4 changes: 3 additions & 1 deletion examples/run/openmp/par_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ int par_run(const traccc::opts::input_data& input_opts,

// Read the cells from the relevant event file
traccc::edm::silicon_cell_collection::host cells_per_event{resource};
static constexpr bool DEDUPLICATE = true;
traccc::io::read_cells(cells_per_event, event, input_opts.directory,
&det_descr, input_opts.format);
&det_descr, input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);

/*-------------------
Clusterization
Expand Down
4 changes: 3 additions & 1 deletion examples/run/sycl/seq_example_sycl.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ int seq_run(const traccc::opts::detector& detector_opts,
traccc::performance::timer t("File reading (cpu)",
elapsedTimes);
// Read the cells from the relevant event file into host memory.
static constexpr bool DEDUPLICATE = true;
traccc::io::read_cells(cells_per_event, event,
input_opts.directory, &host_det_descr,
input_opts.format);
input_opts.format, DEDUPLICATE,
input_opts.use_acts_geom_source);
} // stop measuring file reading timer

n_cells += cells_per_event.size();
Expand Down

0 comments on commit 6d98265

Please sign in to comment.