Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:13

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2022-2025 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "traccc/options/threading.hpp"
0010 
0011 #include "traccc/examples/utils/printable.hpp"
0012 
0013 // System include(s).
0014 #include <stdexcept>
0015 
0016 namespace traccc::opts {
0017 
0018 threading::threading() : interface("Multi-Threading Options") {
0019   m_desc.add_options()(
0020       "cpu-threads",
0021       boost::program_options::value(&threads)->default_value(threads),
0022       "The number of CPU threads to use");
0023 }
0024 
0025 void threading::read(const boost::program_options::variables_map &) {
0026   if (threads == 0) {
0027     throw std::invalid_argument{"Must use threads>0"};
0028   }
0029 }
0030 
0031 std::unique_ptr<configuration_printable> threading::as_printable() const {
0032   auto cat = std::make_unique<configuration_category>(m_description);
0033 
0034   cat->add_child(std::make_unique<configuration_kv_pair>(
0035       "Number of CPU thread", std::to_string(threads)));
0036 
0037   return cat;
0038 }
0039 
0040 }  // namespace traccc::opts