forked from acts-project/traccc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclusterization.cpp
74 lines (63 loc) · 2.66 KB
/
clusterization.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
// Local include(s).
#include "traccc/options/clusterization.hpp"
#include "traccc/clusterization/clusterization_algorithm.hpp"
#include "traccc/examples/utils/printable.hpp"
// System include(s).
#include <iostream>
namespace traccc::opts {
clusterization::clusterization() : interface("Clusterization Options") {
m_desc.add_options()(
"threads-per-partition",
boost::program_options::value(&m_config.threads_per_partition)
->default_value(m_config.threads_per_partition),
"The number of threads per partition");
m_desc.add_options()(
"max-cells-per-thread",
boost::program_options::value(&m_config.max_cells_per_thread)
->default_value(m_config.max_cells_per_thread),
"The maximum number of cells per thread");
m_desc.add_options()(
"target-cells-per-thread",
boost::program_options::value(&m_config.target_cells_per_thread)
->default_value(m_config.target_cells_per_thread),
"The target number of cells per thread");
m_desc.add_options()(
"backup-size-multiplier",
boost::program_options::value(&m_config.backup_size_multiplier)
->default_value(m_config.backup_size_multiplier),
"The size multiplier of the backup scratch space");
}
clusterization::operator clustering_config() const {
return m_config;
}
clusterization::operator host::clusterization_algorithm::config_type() const {
return {};
}
std::unique_ptr<configuration_printable> clusterization::as_printable() const {
std::unique_ptr<configuration_printable> cat =
std::make_unique<configuration_category>("Clustering options");
dynamic_cast<configuration_category &>(*cat).add_child(
std::make_unique<configuration_kv_pair>(
"Threads per partition",
std::to_string(m_config.threads_per_partition)));
dynamic_cast<configuration_category &>(*cat).add_child(
std::make_unique<configuration_kv_pair>(
"Target cells per thread",
std::to_string(m_config.target_cells_per_thread)));
dynamic_cast<configuration_category &>(*cat).add_child(
std::make_unique<configuration_kv_pair>(
"Max cells per thread",
std::to_string(m_config.max_cells_per_thread)));
dynamic_cast<configuration_category &>(*cat).add_child(
std::make_unique<configuration_kv_pair>(
"Scratch space multiplier",
std::to_string(m_config.backup_size_multiplier)));
return cat;
}
} // namespace traccc::opts