1 #ifndef teca_index_reduce_h
2 #define teca_index_reduce_h
4 #include "teca_config.h"
5 #include "teca_dataset.h"
6 #include "teca_metadata.h"
8 #include "teca_threaded_algorithm.h"
42 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
43 TECA_SET_ALGORITHM_PROPERTIES()
50 TECA_ALGORITHM_PROPERTY(
long, start_index)
59 TECA_ALGORITHM_PROPERTY(
long, end_index)
77 virtual p_teca_dataset reduce(
int device_id,
78 const const_p_teca_dataset &
left,
79 const const_p_teca_dataset &right) = 0;
93 virtual p_teca_dataset finalize(
int device_id,
94 const const_p_teca_dataset &ds)
97 return std::const_pointer_cast<teca_dataset>(ds);
105 virtual std::vector<teca_metadata> initialize_upstream_request(
106 unsigned int port,
const std::vector<teca_metadata> &input_md,
113 virtual teca_metadata initialize_output_metadata(
unsigned int port,
114 const std::vector<teca_metadata> &input_md) = 0;
121 using teca_threaded_algorithm::execute;
126 std::vector<teca_metadata> get_upstream_request(
127 unsigned int port,
const std::vector<teca_metadata> &input_md,
135 const_p_teca_dataset execute(
unsigned int port,
136 const std::vector<const_p_teca_dataset> &input_data,
141 const std::vector<teca_metadata> &input_md)
override;
147 const_p_teca_dataset reduce_local(
int device_id,
148 std::vector<const_p_teca_dataset> local_data);
153 const_p_teca_dataset reduce_remote(
int device_id,
154 const_p_teca_dataset local_data);