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 access a is a superset of access b (e.g. accessing [0,3] is a superset of accessing [1,2])

template<typename AccessPolicy = DefaultAccessPolicy>
class Resource : 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 as this

Parameters

ResourceUser

class ResourceUser

Subclassed by redGrapes::ResourceProperty

Tasks

template<typename NullaryCallable>
class DelayedFunctor

Scheduler

Precedence Graph

template<typename T, typename EnqueuePolicy, template<class> typename Graph = DefaultGraph>
class QueuedPrecedenceGraph : public redGrapes::PrecedenceGraph<T, Graph>

Precedence-graph generated from a queue using an enqueue-policy

Public Types

template<>
using VertexID = typename PrecedenceGraph::VertexID

Public Functions

QueuedPrecedenceGraph()
QueuedPrecedenceGraph(std::weak_ptr<RecursiveGraph<T, Graph>> parent_graph, VertexID parent_vertex)
auto push(T a)
auto update_vertex(VertexID a)
void finish(VertexID vertex)

Recursive Graph

template<typename T, template<class> typename T_Graph = DefaultGraph>
class RecursiveGraph

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<>
using Graph = T_Graph<std::pair<T, std::shared_ptr<RecursiveGraph>>>
template<>
using VertexID = typename boost::graph_traits<Graph>::vertex_descriptor

Public Functions

virtual ~RecursiveGraph()
auto shared_lock()
auto unique_lock()
Graph &graph(void)

get graph object

bool empty()
void add_subgraph(VertexID vertex, std::shared_ptr<RecursiveGraph> subgraph)
void remove_vertex(VertexID vertex)
std::pair<Iterator, Iterator> vertices()
template<typename Result>
void collect_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)
struct Iterator

Public Functions

template<>
T const &operator*()
template<>
bool operator==(Iterator const &other)
template<>
bool operator!=(Iterator const &other)
template<>
void operator++()

Public Members

template<>
RecursiveGraph &r
template<>
boost::graph_traits<Graph>::vertex_iterator g_it
template<>
std::unique_ptr<std::pair<Iterator, Iterator>> sub
template<>
std::shared_lock<std::shared_mutex> lock

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 arguments

  • void join()

template<typename Scheduler, typename Thread = std::thread>
class ThreadDispatcher

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 implement bool empty() and void consume_job()

  • Thread: must satisfy Thread