TPIE

v1.1rc1-6-g0c97303
tpie::pipelining Namespace Reference

TPIE pipelining framework. More...

Classes

class  call_order_exception
 
class  delayed_buffer_t
 
class  factory_0
 Node factory for 0-argument generator. More...
 
class  factory_1
 Node factory for 1-argument generator. More...
 
class  factory_2
 Node factory for 2-argument generator. More...
 
class  factory_3
 Node factory for 3-argument generator. More...
 
class  factory_4
 Node factory for 4-argument generator. More...
 
class  factory_5
 Node factory for 5-argument generator. More...
 
class  factory_6
 Node factory for 6-argument generator. More...
 
class  factory_base
 
class  factory_init_hook
 
class  join
 Joins multiple push streams into one. More...
 
class  no_initiator_node
 
class  node
 Base class of all nodes. More...
 
class  node_token
 
class  non_authoritative_node_map
 
class  not_initiator_node
 
class  passive_buffer
 Plain old file_stream buffer. More...
 
class  passive_reverser
 
class  passive_sorter
 Pipelined sorter with push input and pull output. More...
 
class  pipe_begin
 
class  pipe_end
 
class  pipe_middle
 A pipe_middle class pushes input down the pipeline. More...
 
class  pipeline
 This class is used to avoid writing the template argument in the pipeline_impl type. More...
 
class  pullpipe_begin
 
class  pullpipe_end
 
class  pullpipe_middle
 
class  serialization_passive_sorter
 Pipelined sorter with push input and pull output. More...
 
class  tempfactory_0
 Node factory for 0-argument templated generator. More...
 
class  tempfactory_1
 Node factory for 1-argument templated generator. More...
 
class  tempfactory_2
 Node factory for 2-argument templated generator. More...
 
class  tempfactory_3
 Node factory for 3-argument templated generator. More...
 
class  tempfactory_4
 Node factory for 4-argument templated generator. More...
 
class  tempfactory_5
 Node factory for 5-argument templated generator. More...
 
class  tempfactory_6
 Node factory for 6-argument templated generator. More...
 
class  termfactory_0
 Node factory for 0-argument terminator. More...
 
class  termfactory_1
 Node factory for 1-argument terminator. More...
 
class  termfactory_2
 Node factory for 2-argument terminator. More...
 
class  termfactory_3
 Node factory for 3-argument terminator. More...
 
class  termfactory_4
 Node factory for 4-argument terminator. More...
 
class  termfactory_5
 Node factory for 5-argument terminator. More...
 
class  termfactory_6
 Node factory for 6-argument terminator. More...
 
class  virtual_chunk
 Virtual chunk that has input and output. More...
 
class  virtual_chunk_begin
 Virtual chunk that has no input (that is, virtual producer). More...
 
class  virtual_chunk_end
 Virtual chunk that has no output (that is, virtual consumer). More...
 
class  virtual_chunk_missing_begin
 
class  virtual_chunk_missing_end
 
class  virtual_chunk_missing_middle
 
class  virtual_chunk_not_ready
 
class  virtual_container
 Virtual base class for extra data to go with virtual chunks. More...
 

Typedefs

typedef int priority_type
 

Enumerations

enum  maintain_order_type { arbitrary_order = false, maintain_order = true }
 Type describing whether to maintain the order of items in parallel. More...
 

Functions

pipe_middle< factory_0
< delayed_buffer_t > > 
delayed_buffer ()
 
template<typename T >
pipe_begin< factory_1
< bits::input_t, file_stream
< T > & > > 
input (file_stream< T > &fs)
 
template<typename T >
pullpipe_begin< termfactory_1
< bits::pull_input_t< T >
, file_stream< T > & > > 
pull_input (file_stream< T > &fs)
 
template<typename T >
pipe_end< termfactory_1
< bits::output_t< T >
, file_stream< T > & > > 
output (file_stream< T > &fs)
 
template<typename T >
pullpipe_end< factory_1
< bits::pull_output_t,
file_stream< T > & > > 
pull_output (file_stream< T > &fs)
 
template<typename T >
pipe_middle< factory_1
< bits::tee_t< typename
T::item_type >::template type,
T & > > 
tee (T &fs)
 
pipe_middle< factory_1
< bits::ostream_logger_t,
std::ostream & > > 
cout_logger ()
 
pipe_middle< factory_0
< bits::identity_t > > 
identity ()
 
pullpipe_middle< factory_1
< bits::push_to_pull
< factory_0< bits::identity_t >
>::puller_t, factory_0
< bits::identity_t > > > 
pull_identity ()
 
pipe_middle< factory_1
< bits::pull_to_push
< factory_0
< bits::pull_identity_t >
>::pusher_t, factory_0
< bits::pull_identity_t >> > 
alt_identity ()
 
template<typename T >
pipe_end< termfactory_0
< bits::bitbucket_t< T > > > 
bitbucket (T)
 
template<typename fact_t >
pipe_middle< tempfactory_1
< bits::fork_t< fact_t >
, const fact_t & > > 
fork (const pipe_end< fact_t > &to)
 
template<typename T >
pipe_end< termfactory_0
< bits::null_sink_t< T > > > 
null_sink ()
 
template<template< typename dest_t > class Fact>
pipe_begin< factory_0< Fact > > make_pipe_begin_0 ()
 
template<template< typename dest_t > class Fact>
pipe_middle< factory_0< Fact > > make_pipe_middle_0 ()
 
template<typename Fact >
pipe_end< termfactory_0< Fact > > make_pipe_end_0 ()
 
template<template< typename dest_t > class Fact, typename T1 >
pipe_begin< factory_1< Fact, T1 > > make_pipe_begin_1 (T1 e1)
 
template<template< typename dest_t > class Fact, typename T1 >
pipe_middle< factory_1< Fact,
T1 > > 
make_pipe_middle_1 (T1 e1)
 
template<typename Fact , typename T1 >
pipe_end< termfactory_1< Fact,
T1 > > 
make_pipe_end_1 (T1 e1)
 
template<template< typename dest_t > class Fact, typename T1 , typename T2 >
pipe_begin< factory_2< Fact,
T1, T2 > > 
make_pipe_begin_2 (T1 e1, T2 e2)
 
template<template< typename dest_t > class Fact, typename T1 , typename T2 >
pipe_middle< factory_2< Fact,
T1, T2 > > 
make_pipe_middle_2 (T1 e1, T2 e2)
 
template<typename Fact , typename T1 , typename T2 >
pipe_end< termfactory_2< Fact,
T1, T2 > > 
make_pipe_end_2 (T1 e1, T2 e2)
 
template<typename IT >
pullpipe_begin< termfactory_2
< bits::pull_input_iterator_t
< IT >, IT, IT > > 
pull_input_iterator (IT begin, IT end)
 
template<typename IT >
pipe_begin< tempfactory_2
< bits::push_input_iterator_t
< IT >, IT, IT > > 
push_input_iterator (IT begin, IT end)
 
template<typename IT >
pipe_end< termfactory_1
< bits::push_output_iterator_t
< IT >, IT > > 
push_output_iterator (IT to)
 
template<typename Item , typename IT >
pipe_end< termfactory_1
< bits::push_output_iterator_t
< IT, Item >, IT > > 
typed_push_output_iterator (IT to)
 
template<typename IT >
pullpipe_end< tempfactory_1
< bits::pull_output_iterator_t
< IT >, IT > > 
pull_output_iterator (IT to)
 
template<typename pull_t >
pipe_middle< factory_1
< bits::merge_t< pull_t >
::template type, pull_t > > 
merge (const pullpipe_begin< pull_t > &with)
 
template<typename T >
pipe_middle< factory_2
< bits::linear_t, T, T > > 
linear (T factor, T term)
 
template<typename fact_t >
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. More...
 
template<typename fact_t >
pipe_middle
< parallel_bits::factory
< fact_t > > 
parallel (const pipe_middle< fact_t > &fact, maintain_order_type maintainOrder=arbitrary_order)
 Runs a pipeline in multiple threads, using the number of threads reported by tpie::default_worker_count. More...
 
template<typename fact_t >
pipe_middle
< parallel_bits::factory
< fact_t > > 
parallel (const pipe_middle< fact_t > &fact, bool maintainOrder, size_t numJobs, size_t bufSize=2048)
 
template<typename fact_t >
pipe_middle
< parallel_bits::factory
< fact_t > > 
parallel (const pipe_middle< fact_t > &fact, bool maintainOrder)
 
pipe_middle< factory_0
< bits::reverser_t > > 
reverser ()
 
pipe_begin
< serialization_bits::input_factory
serialization_input (serialization_reader &rd)
 
template<typename T >
pipe_end< typename
serialization_bits::output_factory
< T >::type > 
serialization_output (serialization_writer &wr)
 
pipe_middle
< serialization_bits::reverse_factory
serialization_reverser ()
 
pipe_middle
< serialization_bits::default_pred_sort_factory
serialization_pipesort ()
 Pipelining sorter using std::less. More...
 
template<typename pred_t >
pipe_middle
< serialization_bits::sort_factory
< pred_t > > 
serialization_pipesort (const pred_t &p)
 Pipelining sorter using the given predicate. More...
 
pipe_middle
< bits::default_pred_sort_factory
pipesort ()
 Pipelining sorter using std::less. More...
 
template<typename pred_t >
pipe_middle
< bits::sort_factory< pred_t > > 
pipesort (const pred_t &p)
 Pipelining sorter using the given predicate. More...
 
template<typename T >
pipe_begin< factory_1
< bits::input_vector_t, const
std::vector< T > & > > 
input_vector (const std::vector< T > &input)
 
template<typename T >
pipe_end< termfactory_1
< bits::output_vector_t< T >
, std::vector< T > & > > 
output_vector (std::vector< T > &output)
 
template<typename F >
pipe_middle< tempfactory_1
< bits::lambda_t< F >, F > > 
lambda (const F &f)
 
template<typename F >
pipe_middle< tempfactory_1
< bits::exclude_lambda_t< F >
, F > > 
exclude_lambda (const F &f)
 
pipe_begin< factory_0
< bits::scanf_ints_t > > 
scanf_ints ()
 
pipe_end< termfactory_0
< bits::printf_ints_t > > 
printf_ints ()
 
pipe_middle
< bits::pair_factory
< factory_0
< bits::count_consecutive_t >
, factory_0
< bits::extract_first_t > > > 
pipeuniq ()
 

Variables

const priority_type PRIORITY_NO_NAME = 0
 
const priority_type PRIORITY_INSIGNIFICANT = 5
 
const priority_type PRIORITY_SIGNIFICANT = 10
 
const priority_type PRIORITY_USER = 20
 

Detailed Description

TPIE pipelining framework.

Author
Mathias Rav

Enumeration Type Documentation

Type describing whether to maintain the order of items in parallel.

Enumerator
arbitrary_order 

Do not maintain order; push items as soon as a worker has processed them.

maintain_order 

Maintain order; push items in the same order that a single thread would have.

Definition at line 31 of file maintain_order_type.h.

31  {
34  arbitrary_order = false,
37  maintain_order = true
38 };
Do not maintain order; push items as soon as a worker has processed them.
Maintain order; push items in the same order that a single thread would have.

Function Documentation

template<typename fact_t >
pipe_middle<parallel_bits::factory<fact_t> > tpie::pipelining::parallel ( const pipe_middle< fact_t > &  fact,
maintain_order_type  maintainOrder,
size_t  numJobs,
size_t  bufSize = 2048 
)

Runs a pipeline in multiple threads.

Parameters
maintainOrderWhether to make sure that items are processed and output in the order they are input.
numJobsThe number of threads to utilize for parallel execution.
bufSizeThe number of items to store in the buffer sent between threads.

Definition at line 37 of file pipes.h.

References arbitrary_order, and maintain_order.

Referenced by parallel().

37  {
38  parallel_bits::options opts;
39  switch (maintainOrder) {
40  case arbitrary_order:
41  opts.maintainOrder = false;
42  break;
43  case maintain_order:
44  opts.maintainOrder = true;
45  break;
46  }
47  opts.numJobs = numJobs;
48  opts.bufSize = bufSize;
49  return pipe_middle<parallel_bits::factory<fact_t> >
50  (parallel_bits::factory<fact_t>
51  (fact.factory, opts));
52 }
Do not maintain order; push items as soon as a worker has processed them.
Maintain order; push items in the same order that a single thread would have.
template<typename fact_t >
pipe_middle<parallel_bits::factory<fact_t> > tpie::pipelining::parallel ( const pipe_middle< fact_t > &  fact,
maintain_order_type  maintainOrder = arbitrary_order 
)

Runs a pipeline in multiple threads, using the number of threads reported by tpie::default_worker_count.

Parameters
maintainOrderWhether to make sure that items are processed and output in the order they are input.
numJobsThe number of threads to utilize for parallel execution.
bufSizeThe number of items to store in the buffer sent between threads.

Definition at line 65 of file pipes.h.

References tpie::default_worker_count(), and parallel().

65  {
66  return parallel(fact, maintainOrder, default_worker_count());
67 }
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.
Definition: pipes.h:37
memory_size_type default_worker_count()
Return the number of job threads initialized by the job framework in init_job().
pipe_middle<bits::default_pred_sort_factory> tpie::pipelining::pipesort ( )
inline

Pipelining sorter using std::less.

Definition at line 399 of file sort.h.

399  {
400  typedef bits::default_pred_sort_factory fact;
401  return pipe_middle<fact>(fact()).name("Sort");
402 }
template<typename pred_t >
pipe_middle<bits::sort_factory<pred_t> > tpie::pipelining::pipesort ( const pred_t &  p)
inline

Pipelining sorter using the given predicate.

Definition at line 409 of file sort.h.

409  {
410  typedef bits::sort_factory<pred_t> fact;
411  return pipe_middle<fact>(fact(p)).name("Sort");
412 }
pipe_middle<serialization_bits::default_pred_sort_factory> tpie::pipelining::serialization_pipesort ( )
inline

Pipelining sorter using std::less.

Definition at line 392 of file serialization_sort.h.

392  {
393  typedef serialization_bits::default_pred_sort_factory fact;
394  return pipe_middle<fact>(fact()).name("Sort");
395 }
template<typename pred_t >
pipe_middle<serialization_bits::sort_factory<pred_t> > tpie::pipelining::serialization_pipesort ( const pred_t &  p)

Pipelining sorter using the given predicate.

Definition at line 402 of file serialization_sort.h.

402  {
403  typedef serialization_bits::sort_factory<pred_t> fact;
404  return pipe_middle<fact>(fact(p)).name("Sort");
405 }