Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Config.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/tdas/Config.h"
25 
26 #include <utility>
27 
28 namespace ska {
29 namespace cheetah {
30 namespace tdas {
31 
32  cuda::Config _cuda_config;
33  AccListGenConfig _acc_gen_config;
34  std::size_t _dm_trials_per_task;
35  std::size_t _size;
36  std::size_t _minimum_size;
37  std::size_t _nharmonics;
38 
39 
40 Config::Config()
41  : utils::Config("tdas")
42  , _active(true)
43  , _dm_trials_per_task(50)
44  , _size(1<<19)
45  , _minimum_size(_size/2)
46  , _nharmonics(4)
47 {
48  add(_cuda_config);
49  add(_acc_gen_config);
50 }
51 
52 Config::~Config()
53 {
54 }
55 
56 void Config::add_options(OptionsDescriptionEasyInit& add_options)
57 {
58  add_options
59  ("dm_trials_per_task",boost::program_options::value<std::size_t>(&_dm_trials_per_task)->default_value(20),
60  "The number of DM trials to be processed by each asynchronous TDAS task.")
61  ("minimum_size",boost::program_options::value<std::size_t>(&_minimum_size)->default_value(1<<19),
62  "The minimum number of samples on which Tdas should run.")
63  ("size",boost::program_options::value<std::size_t>(&_size)->default_value(1<<23),
64  "The desired number of samples on which Tdas should run.")
65  ("nharmonics",boost::program_options::value<std::size_t>(&_nharmonics)->default_value(4),
66  "The number of harmonic folds to perform. Here a value of 4 "
67  "corresponds to 2^4 harmonics being summed in total. ")
68  ("active", boost::program_options::value<bool>(&_active)->default_value(true),
69  "Active flag for TDAS module.");
70 }
71 
73 {
74  return _cuda_config;
75 }
76 
78 {
79  return _cuda_config;
80 }
81 
83 {
84  return _acc_gen_config;
85 }
86 
88 {
89  return _acc_gen_config;
90 }
91 
92 std::size_t Config::dm_trials_per_task() const
93 {
94  return _dm_trials_per_task;
95 }
96 
97 void Config::dm_trials_per_task(std::size_t ntrials)
98 {
99  _dm_trials_per_task = ntrials;
100 }
101 
102 std::size_t Config::minimum_size() const
103 {
104  return _minimum_size;
105 }
106 
107 void Config::minimum_size(std::size_t minimum_size)
108 {
109  _minimum_size = minimum_size;
110 }
111 
112 std::size_t Config::size() const
113 {
114  return _size;
115 }
116 
117 void Config::size(std::size_t size)
118 {
119  _size = size;
120 }
121 
122 void Config::number_of_harmonic_sums(std::size_t nharmonics)
123 {
124  _nharmonics = nharmonics;
125 }
126 
127 std::size_t Config::number_of_harmonic_sums() const
128 {
129  return _nharmonics;
130 }
131 
132 bool Config::active() const
133 {
134  return _active;
135 }
136 
137 } // namespace tdas
138 } // namespace cheetah
139 } // namespace ska
AccListGenConfig const & acceleration_list_generator() const
Return acceleration list generator configuration.
Definition: Config.cpp:82
AccelerationListGen configuration parameters.
std::size_t size() const
The size for transform to use for the search.
Definition: Config.cpp:112
bool active() const
indicate if the algorithm is to be used
Definition: Config.cpp:129
cuda::Config const & cuda_config() const
Configuration details for the cuda based RFIM algorithm.
Definition: Config.cpp:72
std::size_t dm_trials_per_task() const
The number or DM trials to process in each Tdas async task.
Definition: Config.cpp:92
Some limits and constants for FLDO.
Definition: Brdz.h:35
std::size_t minimum_size() const
The minimum timeseries length that will be searched.
Definition: Config.cpp:102