6 #ifndef MYRAMATH_JOBGRAPH_JOBGRAPH_H 7 #define MYRAMATH_JOBGRAPH_JOBGRAPH_H 14 #include <myramath/utility/detail/LIBPUBLIC.h> 38 virtual uint64_t
n_work()
const {
return 0; }
41 virtual std::string
name()
const {
return "JobGraph"; }
44 virtual void begins(
JobIDs& output)
const {
throw eprintf(
"JobGraphBase::begins(JobIDs&) not implemented for %s", this->name().c_str()); }
47 virtual void ends(
JobIDs& output)
const {
throw eprintf(
"JobGraphBase::ends(JobIDs&) not implemented for %s", this->name().c_str()); }
50 virtual Job*
create(
JobID j) {
throw eprintf(
"JobGraphBase::create(JobID) not implemented for %s", this->name().c_str()); }
53 virtual std::vector<Job*> create();
56 virtual uint64_t
size()
const {
throw eprintf(
"JobGraphBase::size() not implemented for %s", this->name().c_str()); }
91 uint64_t n_work()
const;
94 std::string name()
const;
97 void begins(
JobIDs& output)
const;
100 void ends(
JobIDs& output)
const;
106 std::vector<Job*> create()
const;
109 uint64_t size()
const;
Abstraction to represent one node of a JobGraph.
Definition: Job.h:25
virtual uint64_t n_work() const
Total "work" over all Job's of this JobGraph.
Definition: JobGraph.h:38
virtual uint64_t size() const
Returns maximum JobID.
Definition: JobGraph.h:56
Returns a std::runtime_error() whose message has been populated using printf()-style formatting...
virtual std::string name() const
Returns a printable name for this JobGraph, for debugging.
Definition: JobGraph.h:41
virtual Job * create(JobID j)
Constructs the Job corresponding to the given JobID.
Definition: JobGraph.h:50
virtual void begins(JobIDs &output) const
Enumerates the JobIDs of Job's that have no parents (where execution begins)
Definition: JobGraph.h:44
virtual void ends(JobIDs &output) const
Enumerates the JobIDs of Job's that have no children (where execution ends)
Definition: JobGraph.h:47
Type erasure class that wraps JobGraphBase, gives it value semantics.
Definition: JobGraph.h:64
Base/contract class for all other JobGraph's.
Definition: JobGraph.h:30
Key type used to identify the Job's of a JobGraph.
Key type used to identify the Job's of a JobGraph.
Definition: JobID.h:60
std::vector< JobID > JobIDs
Useful typedef.
Definition: JobID.h:118