1 #ifndef teca_threaded_algorithm_h
2 #define teca_threaded_algorithm_h
4 #include "teca_algorithm.h"
5 #include "teca_threaded_algorithm_fwd.h"
6 #include "teca_algorithm_output_port.h"
7 #include "teca_dataset.h"
9 template <
typename task_t,
typename data_t>
19 using teca_data_request_task = std::packaged_task<const_p_teca_dataset()>;
25 using p_teca_data_request_queue = std::shared_ptr<teca_data_request_queue>;
27 p_teca_data_request_queue new_teca_data_request_queue(MPI_Comm comm,
28 int n,
bool bind,
bool verbose);
43 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
44 TECA_SET_ALGORITHM_PROPERTIES()
49 void set_thread_pool_size(
int n_threads);
50 unsigned int get_thread_pool_size()
const noexcept;
53 TECA_ALGORITHM_PROPERTY(
int, verbose);
58 TECA_ALGORITHM_PROPERTY(
int, bind_threads);
64 TECA_ALGORITHM_PROPERTY(
int, stream_size);
68 TECA_ALGORITHM_PROPERTY(
long long, poll_interval);
71 void set_data_request_queue(
const p_teca_data_request_queue &queue);
81 const_p_teca_dataset execute(
unsigned int port,
82 const std::vector<const_p_teca_dataset> &input_data,
86 const_p_teca_dataset execute(
unsigned int port,
87 const std::vector<const_p_teca_dataset> &input_data,
93 const_p_teca_dataset request_data(teca_algorithm_output_port &port,
99 long long poll_interval;