GrPPI  0.2
Generic and Reusable Parallel Pattern Interface
Public Member Functions | Public Attributes | List of all members
grppi::parallel_execution_native Class Reference

Native parallel execution policy. This policy uses ISO C++ threads as implementation building block allowing usage in any ISO C++ compliant platform. More...

#include <parallel_execution_native.h>

Collaboration diagram for grppi::parallel_execution_native:
Collaboration graph
[legend]

Public Member Functions

 parallel_execution_native () noexcept
 Default construct a native parallel execution policy. More...
 
 parallel_execution_native (int concurrency_degree, bool ordering=true) noexcept
 Constructs a native parallel execution policy. More...
 
void set_concurrency_degree (int degree) noexcept
 Set number of grppi threads. More...
 
int concurrency_degree () const noexcept
 Get number of grppi trheads. More...
 
void enable_ordering () noexcept
 Enable ordering. More...
 
void disable_ordering () noexcept
 Disable ordering. More...
 
bool is_ordered () const noexcept
 Is execution ordered. More...
 
native_thread_manager thread_manager ()
 Get a manager object for registration/deregistration in the thread index table for current thread. More...
 
int get_thread_id () const noexcept
 Get index of current thread in the thread table. More...
 
void set_queue_attributes (int size, queue_mode mode) noexcept
 Sets the attributes for the queues built through make_queue<T>() More...
 
template<typename T >
mpmc_queue< T > make_queue () const
 Makes a communication queue for elements of type T. Constructs a queue using the attributes that can be set via set_queue_attributes(). The value is returned via move semantics. More...
 

Public Attributes

thread_pool pool
 Thread pool for lanching workers. More...
 

Detailed Description

Native parallel execution policy. This policy uses ISO C++ threads as implementation building block allowing usage in any ISO C++ compliant platform.

Constructor & Destructor Documentation

grppi::parallel_execution_native::parallel_execution_native ( )
inlinenoexcept

Default construct a native parallel execution policy.

Creates a parallel execution native object.

The concurrency degree is determined by the platform.

Note
The concurrency degree is fixed to 2 times the hardware concurrency degree.
grppi::parallel_execution_native::parallel_execution_native ( int  concurrency_degree,
bool  ordering = true 
)
inlinenoexcept

Constructs a native parallel execution policy.

Creates a parallel execution native object selecting the concurrency degree and ordering mode.

Parameters
concurrency_degreeNumber of threads used for parallel algorithms.
orderWhether ordered executions is enabled or disabled.

Member Function Documentation

int grppi::parallel_execution_native::concurrency_degree ( ) const
inlinenoexcept

Get number of grppi trheads.

void grppi::parallel_execution_native::disable_ordering ( )
inlinenoexcept

Disable ordering.

void grppi::parallel_execution_native::enable_ordering ( )
inlinenoexcept

Enable ordering.

int grppi::parallel_execution_native::get_thread_id ( ) const
inlinenoexcept

Get index of current thread in the thread table.

Precondition
The current thread is currently registered.
bool grppi::parallel_execution_native::is_ordered ( ) const
inlinenoexcept

Is execution ordered.

template<typename T >
mpmc_queue<T> grppi::parallel_execution_native::make_queue ( ) const
inline

Makes a communication queue for elements of type T. Constructs a queue using the attributes that can be set via set_queue_attributes(). The value is returned via move semantics.

void grppi::parallel_execution_native::set_concurrency_degree ( int  degree)
inlinenoexcept

Set number of grppi threads.

void grppi::parallel_execution_native::set_queue_attributes ( int  size,
queue_mode  mode 
)
inlinenoexcept

Sets the attributes for the queues built through make_queue<T>()

native_thread_manager grppi::parallel_execution_native::thread_manager ( )
inline

Get a manager object for registration/deregistration in the thread index table for current thread.

Member Data Documentation

thread_pool grppi::parallel_execution_native::pool

Thread pool for lanching workers.

Note
This member is temporary and is likely to be deprecated or even removed in a future version of GrPPI.

The documentation for this class was generated from the following file: