20 #ifndef __TPIE_PIPELINING_PARALLEL_PIPES_H__
21 #define __TPIE_PIPELINING_PARALLEL_PIPES_H__
25 namespace pipelining {
35 template <
typename fact_t>
36 pipe_middle<parallel_bits::factory<fact_t> >
39 switch (maintainOrder) {
41 opts.maintainOrder =
false;
44 opts.maintainOrder =
true;
47 opts.numJobs = numJobs;
48 opts.bufSize = bufSize;
51 (fact.factory, opts));
63 template <
typename fact_t>
64 pipe_middle<parallel_bits::factory<fact_t> >
69 template <
typename fact_t>
70 pipe_middle<parallel_bits::factory<fact_t> >
71 parallel(
const pipe_middle<fact_t> & fact,
bool maintainOrder,
size_t numJobs,
size_t bufSize = 2048) {
72 log_fatal() <<
"The second argument to tpie::pipelining::parallel has changed.\n"
73 <<
"Use maintain_order instead of true and arbitrary_order instead of false."
78 template <
typename fact_t>
79 pipe_middle<parallel_bits::factory<fact_t> >
80 parallel(
const pipe_middle<fact_t> & fact,
bool maintainOrder) {
81 log_fatal() <<
"The second argument to tpie::pipelining::parallel has changed.\n"
82 <<
"Use maintain_order instead of true and arbitrary_order instead of false."
91 #endif // __TPIE_PIPELINING_PARALLEL_PIPES_H__
Factory instantiating a parallel multithreaded pipeline.
Do not maintain order; push items as soon as a worker has processed them.
pipe_middle< parallel_bits::factory< fact_t > > parallel(const pipe_middle< fact_t > &fact, maintain_order_type maintainOrder, size_t numJobs, size_t bufSize=2048)
Runs a pipeline in multiple threads.
logstream & log_fatal()
Return logstream for writing fatal log messages.
memory_size_type default_worker_count()
Return the number of job threads initialized by the job framework in init_job().
Maintain order; push items in the same order that a single thread would have.
User-supplied options to the parallelism framework.
A pipe_middle class pushes input down the pipeline.
maintain_order_type
Type describing whether to maintain the order of items in parallel.