Class ExecutionPolicy
Policy to select runtime execution mode for algorithms.

All Subcl's WavefrontExecutionPolicy
Defined in <seqan/parallel.h>
Signature template<typename TThreadingMode, typename TVectorizationMode> struct ExecutionPolicy;

Template Parameters

TThreadingMode Type specifying the threading model. Can be Parallel or Serial (default).
TVectorizationMode Type specifying the vectorization model. Can be Vectorial or Serial (default).

Interface Function Overview

Interface Metafunction Overview

Member Variable Overview

Detailed Description

The ExecutionPolicy class is used to select different execution models for certain algorithms. Depending on the specialization of the template parameters 4 different modes are possible: sequential, parallel, vectorized and parallel+vectorized. The number of threads for the parallel execution modes can be configured via a member variable.

Interface Functions Detail

auto numThreads(exec);

Getter function for the thread number.

Parameters

exec The ExecutionPolicy to get the number of threads for.

Returns

auto The number of threads.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

void setNumThreads(exec, n);

Setter function for the thread number.

Parameters

exec The ExecutionPolicy to set the number of threads for.
n The number of threads used for the parallel execution.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

Interface Metafunctions Detail

IsExecutionPolicy<T>::VALUE

Checks if a given type is an ExecutionPolicy.

Template Parameters

T The type to check.

Returns

bool true if the T is an ExecutionPolicy type, otherwise false.

IsParallel<TExecPolicy>::VALUE

Evaluates to True if the execution policy is specialized with Parallel.

Template Parameters

TTExecPolicy The ExecutionPolicy to check.

Returns

bool true if ExecutionPolicy is Parallel, otherwise false.

IsVectorized<TExecPolicy>::VALUE

Evaluates to True if the execution policy is specialized with Vectorial.

Template Parameters

TTExecPolicy The ExecutionPolicy to check.

Returns

bool true if ExecutionPolicy is Vectorial, otherwise false.

Member Variables Detail

size_t ExecutionPolicy::numThreads

The number of threads to use for the parallel execution. Defaults to 1.