Class FlowThroughManager
Defined in File FlowThroughManager.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public ska::pst::common::ApplicationManager(Class ApplicationManager)
Class Documentation
-
class FlowThroughManager : public ska::pst::common::ApplicationManager
The FlowThroughManager combines instances of the DataBlockRead, FlowThroughProcessor (TBC) and FileStreamWriter (TBC) classes to provide the monitoring and control functions of the PST Flow Through processing mode.
This class extended the ska::pst::common::ApplicationManager, implementing the required commands to step through state model common to PST C++ applications. The class also utilises the DiskMonitor class, providing monitoring of the file system to which output data products are being written.
Public Types
-
typedef struct ska::pst::dsp::FlowThroughManager::stats stats_t
Statistics structure of the Flow Through app manager.
Public Functions
-
FlowThroughManager(const std::string &base_path, bool use_o_direct, bool create_files)
Construct a new Flow Through Manager object.
- Parameters
base_path – absolute path to the base directory where data products should be written.
use_o_direct – use the O_DIRECT option when writing data product files.
create_files – flag to control creation of data and weights files, useful for testing on slow file systems
-
~FlowThroughManager()
Destroy the Flow Through Manager object.
-
void configure_from_file(const std::string &config_file)
Configure beam and scan as described by the configuration file.
- Parameters
config_file – configuration file containing beam and scan configuration parameters
-
virtual void validate_configure_beam(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context) override
Validate the beam configuration parameters, reporting any errors found.
- Parameters
config – beam configuration parameters, that must contain the beam_config_keys.
context – A validation context where errors should be added.
-
virtual void validate_configure_scan(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context) override
Validate the scan configuration parameters, reporting any errors found.
- Parameters
config – scan configuration parameters, that must contain the scan_config_keys.
context – A validation context where errors should be added.
-
virtual void validate_start_scan(const ska::pst::common::AsciiHeader &config) override
Validate the start_scan configuration parameters, reporting any errors found.
- Parameters
config – Start Scan configuration parameters, that must contain the start_scan_config_keys.
- Throws
std::runtime_error – if the required parameters are not present in the start_scan_config_keys.
-
stats_t get_flow_through_stats()
Return the statistics of the Flow Through Manager.
- Returns
stats_t struct of the flow through manager statistics.
-
virtual ska::pst::common::AsciiHeader &get_beam_configuration() override
Get the beam configuration.
- Throws
std::runtime_exception – if the beam is not configured.
- Returns
const ska::pst::common::AsciiHeader& header containing beam configuration.
-
virtual ska::pst::common::AsciiHeader &get_scan_configuration() override
Get the scan configuration.
- Throws
std::runtime_exception – if the scan is not configured.
- Returns
const ska::pst::common::AsciiHeader& header containing scan configuration.
-
inline void set_timeout(int timeout_secs)
Set the timeout to use during connection to DataBlocks.
- Parameters
timeout_secs – timeout to wait in seconds during DataBlock connections.
-
inline std::pair<int32_t, int32_t> get_channels()
The indices of the first and last (inclusive) frequency channels that define the single contiguous range of frequency channels to be recorded.
-
inline uint32_t get_nchan() const
Return the number of channels being selected.
-
inline uint32_t get_npol() const
Return the number of polarisations being selected.
-
inline const std::string get_output_data_key()
helper function for getting the output data buffer key
-
inline const std::string get_output_weights_key()
helper function for getting the output weights buffer key
-
inline void assign_cuda_device(int _device_id)
pass the cuda device id to the LoadToQuantize pipeline
-
inline const std::map<std::string, std::string> &get_log_context() const
return mapped diagnostic context key/value pairs
-
inline bool is_pipeline_running() const
check if DSPSR pipeline is running or not
Returns true if the DSPSR pipeline running. The FlowThroughManager is considered scanning until this returns true.
-
std::string generate_output_key(const std::string &input_key_str)
Helper function that produces an output key based on an input key.
- Parameters
input_key_str – input key in a string format
- Returns
output key in a string format
-
const ::dsp::LoadToQuantize *get_dspsr_pipeline() const
Return the pointer to the LoadToQuantize pipeline.
-
inline ::dsp::LoadToQuantize::Config *get_dspsr_pipeline_config()
Return the pointer to the LoadToQuantize pipeline configuration.
-
dspsr_monitoring_stats_t get_current_stats()
Get the current pipeline monitoring stats.
-
inline bool can_monitor_pipeline() const
Return true if the pipeline can be monitored.
Public Static Attributes
-
static const std::vector<uint32_t> valid_nbit_out = {1, 2, 4, 8, 16, 32}
List of valid NBIT_OUT values.
-
static const std::vector<std::string> valid_polarisations = {"A", "B", "Both"}
List of valid NBIT_OUT values.
-
static const std::vector<std::string> required_beam_config_keys = {"DATA_KEY", "WEIGHTS_KEY"}
List of mandatory beam config keys.
-
static const std::vector<std::string> required_scan_config_keys = {"SCANLEN_MAX", "EB_ID", "NBIT_OUT", "POLN_FT", "CHAN_FT", "DIGITIZER_SCALE", "RESCALE_TIMESCALE"}
List of mandatory scan config keys.
-
static const std::vector<std::string> required_startscan_config_keys = {"SCAN_ID"}
List of mandatory start scan config keys.
-
struct stats
Statistics structure of the Flow Through app manager.
Public Members
-
uint64_t capacity
Size of the recording disk in bytes.
-
uint64_t bytes_written
Bytes recorded to disk.
-
double data_write_rate
Write rate to disk in bytes per second.
-
double expected_data_write_rate
Expected write rate to disk in bytes per second.
-
uint64_t available
Available space on the recording disk in bytes.
-
uint64_t capacity
-
typedef struct ska::pst::dsp::FlowThroughManager::stats stats_t