Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
CheetahConfig.h
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 #ifndef SKA_CHEETAH_PIPELINE_CHEETAHCONFIG_H
25 #define SKA_CHEETAH_PIPELINE_CHEETAHCONFIG_H
26 
27 #include "cheetah/pipeline/MultiBeamConfig.h"
28 #include "cheetah/pipeline/AccelerationSearchAlgoConfig.h"
29 #include "cheetah/pipeline/EmptyConfig.h"
30 #include "cheetah/pipeline/ScanConfig.h"
31 #include "cheetah/channel_mask/ConfigurableChannelMaskConfig.h"
32 #include "cheetah/ddtr/Config.h"
33 #include "cheetah/fdas/Config.h"
34 #include "cheetah/fldo/Config.h"
35 #include "cheetah/psbc/Config.h"
36 #include "cheetah/rfim/Config.h"
37 #include "cheetah/sift/Config.h"
38 #include "cheetah/sps/Config.h"
39 #include "cheetah/spsift/Config.h"
40 #include "cheetah/sps_clustering/Config.h"
41 #include "cheetah/tdas/Config.h"
42 
43 #include "panda/ConfigModule.h"
44 #include "panda/PoolManagerConfig.h"
45 #include "panda/PoolSelector.h"
46 #include "panda/DataSwitchConfig.h"
47 
48 #include <boost/program_options.hpp>
49 
50 #include <cstdlib>
51 #include <string>
52 #include <vector>
53 
54 namespace ska {
55 namespace cheetah {
56 namespace pipeline {
57 
66 template<typename NumericalRep>
68 {
69  public:
70  typedef utils::Config::PoolManagerType PoolManagerType;
71 
72  public:
73  CheetahConfig(std::string const& app_name = "cheetah");
74  ~CheetahConfig();
75 
79  std::string version() const;
80 
84  std::string const& stream_name() const;
85 
89  bool time_handler_invocation() const;
90 
94  std::string const& pipeline_name() const;
95 
99  void set_pipeline_handlers(std::vector<std::string> const& handler_names);
100 
106 
111 
117 
121  fldo::ConfigType const& fldo_config() const;
122  fldo::ConfigType& fldo_config();
123 
127  psbc::Config const& psbc_config() const;
129 
133  rfim::ConfigType<PoolManagerType> const& rfim_config() const;
134 
138  sps::ConfigType<PoolManagerType> const& sps_config() const;
139  sps::ConfigType<PoolManagerType>& sps_config();
140 
141 
142  /*
143  * @brief return spsift module specific configuration parameters
144  */
145  spsift::Config const& spsift_config() const;
146 
147  /*
148  * @brief return sps_clustering module specific configuration parameters
149  */
150  sps_clustering::Config const& sps_clustering_config() const;
151 
152 
156  sift::ConfigType const& sift_config() const;
157  sift::ConfigType& sift_config();
158 
162  panda::DataSwitchConfig& switch_config() const;
163 
167  panda::PoolManagerConfig<utils::Config::SystemType> const& pool_manager_config() const;
168 
172  PoolManagerType const& pool_manager() const;
173  PoolManagerType& pool_manager();
174 
178  EmptyConfig const& empty_config() const;
179 
183  ScanConfig const& scan_config() const;
184 
190  int parse(int argc, char** argv);
191 
192  protected:
193  void add_options(OptionsDescriptionEasyInit& add_options) override;
194 
195  private:
196  boost::program_options::options_description _desc;
197  boost::program_options::options_description _all_desc;
198  boost::program_options::positional_options_description _options_pod;
199 
200  std::string _app_name;
201  utils::Config::SystemType& _system;
202  std::string _stream_name;
203  std::vector<std::string> _pipeline_handler_names;
204  std::string _pipeline_name;
205  bool _handler_timing;
206  mutable panda::DataSwitchConfig _switch_config; // contains the thread pools used by other objects
207  // so should be destroyed after MultiBeamConfig
208 
209  typedef panda::PoolManagerConfig<utils::Config::SystemType> PoolManagerConfigType;
210  PoolManagerConfigType _pool_manager_config;
211 
212  PoolManagerType _pool_manager;
213  ScanConfig _scan_config;
214  AccelerationSearchAlgoConfig _acceleration_search_config;
215  MultiBeamConfig<NumericalRep> _beam_config;
216 
218  fldo::ConfigType _fldo_config;
219  psbc::Config _psbc_config;
220  rfim::ConfigType<PoolManagerType> _rfim_config;
221  sift::ConfigType _sift_config;
222  sps::ConfigType<PoolManagerType> _sps_config;
223  spsift::Config _spsift_config;
224  sps_clustering::Config _sps_clustering_config;
225 
226  EmptyConfig _empty_config;
227 
228 };
229 
230 } // namespace pipeline
231 } // namespace cheetah
232 } // namespace ska
233 #include "cheetah/pipeline/detail/CheetahConfig.cpp"
234 
235 #endif // SKA_CHEETAH_PIPELINE_CHEETAHCONFIG_H
sift::ConfigType const & sift_config() const
return the sift module specific configuration parameters
Parse configuration parameters for a cheetah pipeline application.
Definition: CheetahConfig.h:67
MultiBeamConfig< NumericalRep > const & beams_config() const
return the configuration node with beam configurations
Base class for module configuration.
Definition: Config.h:42
bool time_handler_invocation() const
wether to activte timing between each invocation of the runtime computational pipeline ...
panda::DataSwitchConfig & switch_config() const
return the data switch configuration parameters
rfim::ConfigType< PoolManagerType > const & rfim_config() const
return the rfim module specific configuration parameters
Configuration for the Configurable ChannelMask module.
Configuration parameters for the available acceleration searches.
psbc::Config const & psbc_config() const
return the psbc module specific configuration parameters
int parse(int argc, char **argv)
parse the command line options/config file
Class of all common input parameters.
Definition: ScanConfig.h:42
AccelerationSearchAlgoConfig & acceleration_search_config()
return the templated acceleration search configuration
Some limits and constants for FLDO.
Definition: Brdz.h:35
panda::PoolManagerConfig< utils::Config::SystemType > const & pool_manager_config() const
return the data switch configuration parameters
PoolManagerType const & pool_manager() const
return the pool manager object
sps::ConfigType< PoolManagerType > const & sps_config() const
return the sps module specific configuration parameters
EmptyConfig const & empty_config() const
return the empty module specific configuration parameters
gloabl system definintion for the required device support in this project
Definition: System.h:39
fldo::ConfigType const & fldo_config() const
return the fldo module specific configuration parameters
std::string const & pipeline_name() const
return the selected pipeline name
std::string version() const
return the cheetah version as a string
void set_pipeline_handlers(std::vector< std::string > const &handler_names)
set the computational unit names available
std::string const & stream_name() const
return the selected stream name
Configuration for the data collection buffer.
Definition: Config.h:41
ScanConfig const & scan_config() const
return the empty module specific configuration parameters
channel_mask::ConfigurableChannelMaskConfig< NumericalRep > const & channel_mask_config() const
return the channel_mask configuration