Components¶
Resources & Dependency-Description¶
Resource¶
-
group
AccessPolicy
- Description
An implementation of the concept AccessPolicy creates a new resource-type (
Resource<AccessPolicy>
) and should define the possible access modes / configurations for this resource-type (e.g. read/write)- Required public member functions
static bool is_serial(AccessPolicy, AccessPolicy)
check if the two accesses have to be in order. (e.g. two reads return false, an occuring write always true)static bool is_superset(AccessPolicy a, AccessPolicy b)
check if accessa
is a superset of accessb
(e.g. accessing [0,3] is a superset of accessing [1,2])
-
template<typename
AccessPolicy
= DefaultAccessPolicy>
classResource
: public redGrapes::ResourceBase¶ Represents a concrete resource. Copied objects represent the same resource.
- Template Parameters
AccessPolicy
: Defines the access-modes (e.g. read/write) that are possible with this resource. Required to implement the concept AccessPolicy
Subclassed by redGrapes::SharedResourceObject< T, AccessPolicy >
Public Functions
-
ResourceAccess
make_access
(AccessPolicy pol) const¶ Create an ResourceAccess, which represents an concrete access configuration associated with this resource.
- Return
ResourceAccess on this resource
- Parameters
pol
: AccessPolicy object, containing all access information
ResourceAccess¶
-
class
ResourceAccess
¶ Public Functions
-
bool
is_same_resource
(ResourceAccess const &a) const¶ Check if the associated resource is the same
- Return
true if
a
is associated with the same resource asthis
- Parameters
a
: another ResourceAccess
-
bool
Scheduler¶
Precedence Graph¶
-
template<typename
T
, typenameEnqueuePolicy
, template<class> typenameGraph
= DefaultGraph>
classQueuedPrecedenceGraph
: public redGrapes::PrecedenceGraph<T, Graph>¶ Precedence-graph generated from a queue using an enqueue-policy
Public Types
-
template<>
usingVertexID
= typename PrecedenceGraph::VertexID¶
-
template<>
Recursive Graph¶
-
template<typename
T
, template<class> typenameT_Graph
= DefaultGraph>
classRecursiveGraph
¶ Boost-Graph adaptor storing a tree of subgraphs which refine a node. Every vertex of a refinement has an edge to the refinements root node.
Public Types
-
template<>
usingGraph
= T_Graph<std::pair<T, std::shared_ptr<RecursiveGraph>>>¶
Public Functions
-
virtual
~RecursiveGraph
()¶
-
auto
unique_lock
()¶
-
Graph &
graph
(void)¶ get graph object
-
bool
empty
()¶
-
void
remove_vertex
(VertexID vertex)¶
-
template<typename
Result
>
voidcollect_vertices
(std::vector<Result> &collection, std::function<std::experimental::optional<Result>(T const&)> const &filter_map, size_t limit = std::numeric_limits<size_t>::max(), )¶
-
void
write_dot
(std::ostream &out, std::function<unsigned int(T const&)> const &id, std::function<std::string(T const&)> const &label, std::function<std::string(T const&)> const &color)¶
-
void
write_refinement_dot
(std::ostream &out, std::function<unsigned int(T const&)> const &id, std::function<std::string(T const&)> const &label, std::function<std::string(T const&)> const &color)¶
-
template<>
Building the Graph with Policies¶
Thread Pool¶
-
group
Thread
- Required public member functions
constructor:
Thread(Callable, Args&&...)
spawns a new thread which executes the callable with the given argumentsvoid join()
-
template<typename
Scheduler
, typenameThread
= std::thread>
classThreadDispatcher
¶ Manages a thread pool. Worker-threads request jobs from scheduler and execute them, until the ThreadDispatcher gets destroyed and all workers finished.
- Template Parameters
JobSelector
: must implementbool empty()
andvoid consume_job()
Thread
: must satisfy Thread