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>;
52 p_teca_data_request_queue new_teca_data_request_queue(MPI_Comm comm,
53 int n_threads,
int n_threads_per_device,
bool bind,
bool verbose);
70 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
71 TECA_SET_ALGORITHM_PROPERTIES()
76 void set_thread_pool_size(
int n_threads);
79 unsigned int get_thread_pool_size() const noexcept;
85 TECA_ALGORITHM_PROPERTY(
int, verbose)
94 TECA_ALGORITHM_PROPERTY(
int, bind_threads)
103 TECA_ALGORITHM_PROPERTY(
int, stream_size)
111 TECA_ALGORITHM_PROPERTY(
long long, poll_interval)
118 TECA_ALGORITHM_PROPERTY(
int, threads_per_cuda_device)
122 void set_data_request_queue(const p_teca_data_request_queue &queue);
132 const_p_teca_dataset execute(
unsigned int port,
133 const std::vector<const_p_teca_dataset> &input_data,
137 const_p_teca_dataset execute(
unsigned int port,
138 const std::vector<const_p_teca_dataset> &input_data,
144 const_p_teca_dataset request_data(teca_algorithm_output_port &port,
150 long long poll_interval;
151 int threads_per_cuda_device;
153 teca_threaded_algorithm_internals *internals;