|
TECA
The Toolkit for Extreme Climate Analysis
|
The interface to TECA pipeline architecture. More...
#include <teca_algorithm.h>
Public Member Functions | |
| teca_algorithm (const teca_algorithm &src)=delete | |
| teca_algorithm (teca_algorithm &&src)=delete | |
| teca_algorithm & | operator= (const teca_algorithm &src)=delete |
| teca_algorithm & | operator= (teca_algorithm &&src)=delete |
| virtual const char * | get_class_name () const =0 |
| return the name of the class. More... | |
| void | set_communicator (MPI_Comm comm) |
| MPI_Comm | get_communicator () |
| get the active communicator More... | |
| virtual teca_algorithm_output_port | get_output_port (unsigned int port=0) |
| void | set_input_connection (const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | set_input_connection (unsigned int id, const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | remove_input_connection (unsigned int id) |
| remove input connections More... | |
| void | clear_input_connections () |
| remove all input connections More... | |
| const_p_teca_dataset | get_output_data (unsigned int port=0) |
| void | pop_cache (unsigned int port=0, int top=0) |
| void | set_cache_size (unsigned int n) |
| set the cache size. the default is 1. (threadsafe) More... | |
| virtual int | update () |
| execute the pipeline from this instance up. More... | |
| virtual int | update (unsigned int port) |
| execute the pipeline from this instance up. More... | |
| virtual teca_metadata | update_metadata (unsigned int port=0) |
| get meta data considering this instance up. More... | |
| void | set_executive (p_teca_algorithm_executive exe) |
| set the executive More... | |
| p_teca_algorithm_executive | get_executive () |
| get the executive More... | |
| virtual void | to_stream (std::ostream &s) const |
| virtual void | from_stream (std::istream &s) |
| deserialize from the stream. More... | |
verbose | |
if set to a non-zero value, rank 0 will send status information to the terminal. The default setting of zero results in no output. | |
| void | set_verbose (const int &v) |
| const int & | get_verbose () const |
Protected Member Functions | |
| void | set_number_of_input_connections (unsigned int n) |
| void | set_number_of_output_ports (unsigned int n) |
| virtual void | set_modified () |
| void | set_modified (unsigned int port) |
| an overload to set_modified by port More... | |
| virtual teca_metadata | get_output_metadata (unsigned int port, const std::vector< teca_metadata > &input_md) |
| virtual std::vector< teca_metadata > | get_upstream_request (unsigned int port, const std::vector< teca_metadata > &input_md, const teca_metadata &request) |
| virtual const_p_teca_dataset | execute (unsigned int port, const std::vector< const_p_teca_dataset > &input_data, const teca_metadata &request) |
| virtual teca_metadata | get_cache_key (unsigned int port, const teca_metadata &request) const |
| virtual teca_metadata | get_output_metadata (teca_algorithm_output_port ¤t) |
| virtual const_p_teca_dataset | request_data (teca_algorithm_output_port &port, const teca_metadata &request) |
| virtual int | validate_cache (teca_algorithm_output_port ¤t) |
| virtual void | clear_modified (teca_algorithm_output_port current) |
| const_p_teca_dataset | get_output_data (unsigned int port, const teca_metadata &request) |
| int | cache_output_data (unsigned int port, const teca_metadata &request, const_p_teca_dataset &data) |
| void | clear_cache (unsigned int port) |
| clear the cache on the given output port More... | |
| unsigned int | get_number_of_input_connections () |
| get the number of input connections More... | |
| teca_algorithm_output_port & | get_input_connection (unsigned int i) |
| void | clear_modified (unsigned int port) |
| clear the modified flag on the i'th output More... | |
| int | get_modified (unsigned int port) const |
| return the output port's modified flag value More... | |
Protected Attributes | |
| int | verbose |
Friends | |
| class | teca_threaded_algorithm |
| class | teca_data_request |
The interface to TECA pipeline architecture.
All sources/readers filters, sinks/writers will implement this interface.
|
protected |
add or update the given request , dataset pair in the cache. see also get_cache_key. (threadsafe)
|
protected |
clear the cache on the given output port
| void teca_algorithm::clear_input_connections | ( | ) |
remove all input connections
|
protectedvirtual |
driver function that clears the modified flag on the named port and all of it's upstream connections.
|
protected |
clear the modified flag on the i'th output
|
protectedvirtual |
implementations must override this method and produce the output dataset for the port named in the first argument. The second argument is a list of all of the input datasets. See also get_request. The third argument contains a request from the consumer which can specify information such as arrays, subset region, timestep etc. The implementation is free to handle the request as it sees fit.
Reimplemented in teca_threaded_algorithm, teca_vertical_reduction, and teca_cf_time_axis_reader.
|
virtual |
deserialize from the stream.
|
protectedvirtual |
implementations may choose to override this method to gain control of keys used in the cache. By default the passed in request is used as the key. This override gives implementor the chance to filter the passed in request.
|
pure virtual |
return the name of the class.
Implemented in teca_programmable_algorithm, teca_table_reader, teca_cf_reader, teca_cf_writer, teca_threaded_programmable_algorithm, teca_cartesian_mesh_source, teca_multi_cf_reader, teca_array_collection_reader, teca_wrf_reader, teca_threaded_algorithm, teca_elevation_mask, teca_tc_candidates, teca_2d_component_area, teca_connected_components, teca_programmable_reduce, teca_bayesian_ar_detect, teca_component_area_filter, teca_valid_value_mask, teca_normalize_coordinates, teca_apply_binary_mask, teca_tc_trajectory, teca_latitude_damper, teca_table_remove_rows, teca_cartesian_mesh_regrid, teca_evaluate_expression, teca_table_calendar, teca_dataset_diff, teca_time_axis_convolution, teca_unpack_data, teca_cartesian_mesh_reader, teca_cartesian_mesh_coordinate_transform, teca_integrated_vapor_transport, teca_table_writer, teca_integrated_water_vapor, teca_binary_segmentation, teca_tc_wind_radii, teca_cartesian_mesh_subset, teca_table_region_mask, teca_tc_classify, teca_indexed_dataset_cache, teca_table_reduce, teca_vertical_reduction, teca_dataset_capture, teca_cartesian_mesh_writer, teca_mask, teca_simple_moving_average, teca_dataset_source, teca_cf_time_axis_data_reduce, teca_descriptive_statistics, teca_shape_file_mask, teca_cf_time_axis_reader, teca_table_sort, teca_table_to_stream, teca_component_statistics, teca_face_to_cell_centering, teca_l2_norm, teca_laplacian, teca_rename_variables, teca_vertical_coordinate_transform, teca_vorticity, and teca_bayesian_ar_detect_parameters.
| MPI_Comm teca_algorithm::get_communicator | ( | ) |
get the active communicator
| p_teca_algorithm_executive teca_algorithm::get_executive | ( | ) |
get the executive
|
protected |
get the output port associated with this algorithm's i'th input connection.
|
protected |
return the output port's modified flag value
|
protected |
get the number of input connections
|
protected |
search the given port's cache for the dataset associated with the given request. see also get_cache_key. (threadsafe)
| const_p_teca_dataset teca_algorithm::get_output_data | ( | unsigned int | port = 0 | ) |
access the cached data produced by this algorithm. when no request is specified the dataset on the top(most recent) of the cache is returned. When a request is specified it may optionally be filtered by the implementations cache key filter. see also get_cache_key (threadsafe)
|
protectedvirtual |
driver function that manage meta data reporting phase of pipeline execution.
|
protectedvirtual |
implementations must override this method to provide information to downstream consumers about what data will be produced on each output port. The port to provide information about is named in the first argument the second argument contains a list of the metadata describing data on all of the inputs.
Reimplemented in teca_index_reduce, teca_vertical_reduction, and teca_cf_time_axis_reader.
|
virtual |
get an output port from the algorithm. to be used during pipeline building
|
protectedvirtual |
implementations must override this method and generate a set of requests describing the data required on the inputs to produce data for the named output port, given the upstream meta data and request. If no data is needed on an input then the list should contain a null request.
Reimplemented in teca_index_reduce, and teca_vertical_reduction.
|
inline |
Get the value of the verbose algorithm property
| void teca_algorithm::pop_cache | ( | unsigned int | port = 0, |
| int | top = 0 |
||
| ) |
remove a dataset from the top/bottom of the cache. the top of the cache has the most recently created dataset. top or bottom is selected via the boolean argument. (threadsafe)
|
virtual |
remove input connections
| void teca_algorithm::set_cache_size | ( | unsigned int | n | ) |
set the cache size. the default is 1. (threadsafe)
| void teca_algorithm::set_communicator | ( | MPI_Comm | comm | ) |
set the communicator to use at this stage of the pipeline this has no influence on other stages. We duplicate the passed in communicator providing an isolated communication space for subsequent operations. By default the communicator is initialized to MPI_COMM_WORLD, here it is not duplicated. Thus to put an algorithm into a unique communication space one should explicitly set a communicator. When an algorithm should not use MPI, for instance when it is in a nested pipeline, one may set the communicator to MPI_COMM_SELF.
| void teca_algorithm::set_executive | ( | p_teca_algorithm_executive | exe | ) |
set the executive
|
inline |
set an input to this algorithm
|
virtual |
set an input to this algorithm
Reimplemented in teca_tc_wind_radii, and teca_bayesian_ar_detect.
|
protectedvirtual |
set the modified flag on the given output port's cache. should be called when user modifies properties on the object that require the output to be regenerated.
Reimplemented in teca_cartesian_mesh_coordinate_transform, teca_shape_file_mask, and teca_cf_time_axis_reader.
|
protected |
an overload to set_modified by port
|
protected |
Set the number of input connections. implementations should call this from their constructors to setup the internal caches and data structures required for execution.
|
protected |
Set the number of output ports. implementations should call this from their constructors to setup the internal caches and data structures required for execution.
|
inline |
Set the value of the verbose algorithm property
|
virtual |
serialize the configuration to a stream. this should store the public user modifiable properties so that runtime configuration may be saved and restored.
Reimplemented in teca_tc_candidates.
|
virtual |
execute the pipeline from this instance up.
|
virtual |
execute the pipeline from this instance up.
|
virtual |
get meta data considering this instance up.
|
protectedvirtual |
driver function that clears the output data cache where modified flag has been set from the current port upstream.