1 #ifndef teca_threaded_algorithm_h
2 #define teca_threaded_algorithm_h
4 #include "teca_config.h"
5 #include "teca_algorithm.h"
6 #include "teca_dataset.h"
12 #if defined(TECA_HAS_CUDA)
13 template <
typename task_t,
typename data_t>
16 template <
typename task_t,
typename data_t>
21 class teca_threaded_algorithm_internals;
26 using teca_data_request_task = std::packaged_task<const_p_teca_dataset(
int)>;
28 class teca_data_request;
31 #if defined(TECA_HAS_CUDA)
40 using p_teca_data_request_queue = std::shared_ptr<teca_data_request_queue>;
54 p_teca_data_request_queue new_teca_data_request_queue(MPI_Comm comm,
55 int n_threads,
int threads_per_device,
int ranks_per_device,
bool bind,
80 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
81 TECA_SET_ALGORITHM_PROPERTIES()
86 void set_thread_pool_size(
int n_threads);
89 unsigned int get_thread_pool_size() const noexcept;
97 TECA_ALGORITHM_PROPERTY(
int, bind_threads)
106 TECA_ALGORITHM_PROPERTY(
int, stream_size)
114 TECA_ALGORITHM_PROPERTY(
long long, poll_interval)
122 TECA_ALGORITHM_PROPERTY(
int, threads_per_device)
130 TECA_ALGORITHM_PROPERTY(
int, ranks_per_device)
134 void set_data_request_queue(const p_teca_data_request_queue &queue);
141 TECA_ALGORITHM_PROPERTY(
int, propagate_device_assignment)
152 const_p_teca_dataset execute(
unsigned int port,
153 const std::vector<const_p_teca_dataset> &input_data,
157 const_p_teca_dataset execute(
unsigned int port,
158 const std::vector<const_p_teca_dataset> &input_data,
164 const_p_teca_dataset request_data(teca_algorithm_output_port &port,
170 long long poll_interval;
171 int threads_per_device;
172 int ranks_per_device;
173 int propagate_device_assignment;
175 teca_threaded_algorithm_internals *internals;
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:244
A class to manage a fixed size pool of threads that dispatch work.
Definition: teca_cpu_thread_pool.h:34
A class to manage a fixed size pool of threads that dispatch work.
Definition: teca_cuda_thread_pool.h:54
This is the base class defining a threaded algorithm.
Definition: teca_threaded_algorithm.h:71
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.