HTGS  v2.0
The Hybrid Task Graph Scheduler
AnyTaskGraphConf.hpp
Go to the documentation of this file.
1 // NIST-developed software is provided by NIST as a public service. You may use, copy and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.
2 // NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE.
3 // You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software developed by NIST employees is not subject to copyright protection within the United States.
4 
13 #ifndef HTGS_ANYTASKGRAPHCONF_HPP
14 #define HTGS_ANYTASKGRAPHCONF_HPP
15 
16 #include <list>
17 #include <string>
18 #include <cstddef>
19 #include <fstream>
20 
22 #include <htgs/api/ITask.hpp>
23 #include <htgs/api/IRule.hpp>
26 #include <htgs/types/Types.hpp>
28 #ifdef WS_PROFILE
29 #include <htgs/core/graph/profile/ProfileData.hpp>
30 #endif
31 
32 namespace htgs {
33 
38 typedef std::map<AnyITask *, AnyTaskManager *> ITaskMap;
39 
44 typedef std::pair<AnyITask *, AnyTaskManager *> ITaskPair;
45 
50 typedef std::unordered_multimap<std::string, std::shared_ptr<AnyConnector>> TaskNameConnectorMap;
51 
56 typedef std::pair<std::string, std::shared_ptr<AnyConnector>> TaskNameConnectorPair;
57 
67  public:
68 
76  AnyTaskGraphConf(size_t pipelineId, size_t numPipelines, std::string baseAddress) :
77  pipelineId(pipelineId), numPipelines(numPipelines) {
78  this->graphCreationTimestamp = std::chrono::high_resolution_clock::now();
79  this->graphComputeTime = 0;
80  this->graphCreationTime = 0;
81 
82  if (baseAddress == "")
83  this->address = std::to_string(pipelineId);
84  else
85  this->address = baseAddress + ":" + std::to_string(this->pipelineId);
86  this->taskManagers = new std::list<AnyTaskManager *>();
87  this->taskCopyMap = new ITaskMap();
88  this->taskConnectorNameMap = new TaskNameConnectorMap();
89  this->numberOfSubGraphs = 0;
90  this->iRuleMap = new IRuleMap();
91  this->memAllocMap = new MemAllocMap();
92  }
93 
97 
101  virtual ~AnyTaskGraphConf() {
102  for (auto task : *taskManagers) {
103  if (task != nullptr) {
104  HTGS_DEBUG_VERBOSE("AnyTaskGraphConf: " << this << " Freeing memory for TaskManager: " << task);
105 
106  delete task;
107  task = nullptr;
108  }
109  }
110  delete taskManagers;
111 
112  delete taskCopyMap;
113  taskCopyMap = nullptr;
114 
115  delete taskConnectorNameMap;
116  taskConnectorNameMap = nullptr;
117 
118  delete iRuleMap;
119  iRuleMap = nullptr;
120 
121  delete memAllocMap;
122  memAllocMap = nullptr;
123  }
124 
129 // virtual AnyTaskManager *getGraphConsumerTaskManager() = 0;
130 
135 // virtual std::list<AnyTaskManager *> *getGraphProducerTaskManagers() = 0;
136 
141  virtual std::shared_ptr<AnyConnector> getInputConnector() = 0;
142 
147  virtual std::shared_ptr<AnyConnector> getOutputConnector() = 0;
148 
149  // TODO: Delete or Add #ifdef
150 // /**
151 // * Virtual function that initiates updating the task graph communicator.
152 // */
153 // virtual void updateCommunicator() = 0;
154 
155  // TODO: Delete or Add #ifdef
156 // /**
157 // * Virtual function that gets the task graph communicator.
158 // * @return
159 // */
160 // virtual TaskGraphCommunicator *getTaskGraphCommunicator() const = 0;
161 
162 #ifdef WS_PROFILE
163 
168  virtual void sendProfileData(std::shared_ptr<ProfileData> profileData) = 0;
169 #endif
170 
171 
175 
180  std::list<AnyTaskManager *> *getTaskManagers() {
181  return this->taskManagers;
182  }
183 
189  void gatherProfilingData(std::map<AnyTaskManager *, TaskManagerProfile *> *taskManagerProfiles) {
190  for (auto tMan : *taskManagers) {
191  tMan->gatherProfileData(taskManagerProfiles);
192  }
193  }
194 
202  template<class V, class W>
203  std::shared_ptr<IRule<V, W>> getIRule(IRule<V, W> *iRule) {
204  std::shared_ptr<IRule<V, W>> iRuleShr;
205  if (this->iRuleMap->find(iRule) != this->iRuleMap->end()) {
206  std::shared_ptr<AnyIRule> baseRulePtr = this->iRuleMap->find(iRule)->second;
207  iRuleShr = std::static_pointer_cast<IRule<V, W>>(baseRulePtr);
208  } else {
209  iRuleShr = std::shared_ptr<IRule<V, W>>(iRule);
210  this->iRuleMap->insert(IRulePair(iRule, iRuleShr));
211  }
212  return iRuleShr;
213  }
214 
221  template<class V>
222  std::shared_ptr<IMemoryAllocator<V>> getMemoryAllocator(IMemoryAllocator<V> *allocator) {
223  std::shared_ptr<IMemoryAllocator<V>> allocP;
224 
225  if (this->memAllocMap->find(allocator) == this->memAllocMap->end()) {
226  allocP = std::shared_ptr<IMemoryAllocator<V>>(allocator);
227  memAllocMap->insert(MemAllocPair(allocator, allocP));
228  } else {
229  allocP = std::static_pointer_cast<IMemoryAllocator<V>>(this->memAllocMap->at(allocator));
230  }
231 
232  return allocP;
233  }
234 
238  void initialize() {
239  // TODO: Delete or Add #ifdef
240 // this->getTaskGraphCommunicator()->setNumGraphsSpawned(this->getNumberOfSubGraphs());
241 
243 // this->updateCommunicator();
244 
245 
246 
247  auto endTime = std::chrono::high_resolution_clock::now();
248  this->graphCreationTime =
249  static_cast<unsigned long long int>(std::chrono::duration_cast<std::chrono::microseconds>(endTime - graphCreationTimestamp).count());
250 
251  this->graphExecutingTimestamp = std::chrono::high_resolution_clock::now();
252  }
253 
257  virtual void finishedSetup() { }
258 
262  void shutdown() {
263  auto endTime = std::chrono::high_resolution_clock::now();
264 
266  static_cast<unsigned long long int>(std::chrono::duration_cast<std::chrono::microseconds>(endTime - graphExecutingTimestamp).count());
267 
268  }
269 
276  std::unique_lock<std::mutex> lock(this->initializeMutex);
277  this->initializeCondition.wait(lock, [=]
278  {
279  bool ret = true;
280  for (AnyTaskManager *tm : *taskManagers)
281  {
282  if(!tm->isInitialized()) {
283  ret = false;
284  break;
285  }
286  }
287 
288  return ret;
289  });
290 
291  }
292 
297  std::condition_variable *getInitializationCondition() {
298  return &this->initializeCondition;
299  }
300 
305  std::mutex *getInitializationMutex() {
306  return &this->initializeMutex;
307  }
308 
313  TaskNameConnectorMap *getTaskConnectorNameMap() const {
314  return taskConnectorNameMap;
315  }
316 
326  template<class T, class U>
328  for (auto tCopy : *taskCopyMap) {
329  if (tCopy.first == orig) {
330  return (ITask<T, U> *) tCopy.second->getTaskFunction();
331  }
332  }
333 
334  return nullptr;
335  }
336 
345  for (auto tCopy : *taskCopyMap) {
346  if (tCopy.first == orig) {
347  return tCopy.second->getTaskFunction();
348  }
349  }
350 
351  return nullptr;
352  }
353 
361  template<class T, class U>
363 
364  TaskManager<T, U> *taskManager = nullptr;
365 
366  for (auto tSched : *taskManagers) {
367  if (tSched->getTaskFunction() == task) {
368  taskManager = (TaskManager<T, U> *) tSched;
369  break;
370  }
371  }
372 
373  if (taskManager == nullptr) {
374  taskManager = new TaskManager<T, U>(task,
375  task->getNumThreads(),
376  task->isStartTask(),
377  task->isPoll(),
378  task->getMicroTimeoutTime(),
379  pipelineId,
380  numPipelines,
381  address);
382  this->taskManagers->push_back(taskManager);
383 
384  // Increment number of graphs spawned from the task
385  this->numberOfSubGraphs += task->getNumGraphsSpawned();
386  }
387 
388  return taskManager;
389 
390  }
391 
396  void addTaskManager(AnyTaskManager *taskManager) {
397  for (auto tMan : *taskManagers) {
398  if (tMan == taskManager)
399  return;
400  }
401 
402  this->taskManagers->push_back(taskManager);
403  }
404 
408  void printProfile() {
409  for (auto tMan : *taskManagers) {
410  tMan->printProfile();
411  }
412  }
413 
418  size_t getPipelineId() { return this->pipelineId; }
419 
424  size_t getNumPipelines() { return this->numPipelines; }
425 
443  void writeDotToFile(std::string file, int flags = 0, std::string graphTitle = "", std::string customTitleText = "") {
444 
445  if ((flags & DOTGEN_FLAG_SHOW_CONNECTORS) == 0 && (flags & DOTGEN_FLAG_SHOW_CONNECTOR_VERBOSE) == 0) {
446 
447  if ((flags & DOTGEN_FLAG_SHOW_ALL_THREADING) != 0) {
448  std::cerr
449  << "DOT visualization without connectors does not support showing all threading. Adding DOTGEN_FLAG_SHOW_CONNECTORS flag."
450  << std::endl;
451  flags = flags | DOTGEN_FLAG_SHOW_CONNECTORS;
452 
453  }
454  }
455 
456  bool graphColored = false;
457 #ifdef PROFILE
458  if ((flags & DOTGEN_COLOR_COMP_TIME) != 0) {
459  std::string name = "color-compute-time-" + file;
460  std::ofstream f(name);
461  f << genDotGraph(flags, DOTGEN_COLOR_COMP_TIME, graphTitle, customTitleText);
462  f.flush();
463 
464  std::cout << "Writing dot file for task graph with compute time coloring to " << name << std::endl;
465 
466  graphColored = true;
467  }
468 
469  if ((flags & DOTGEN_COLOR_WAIT_TIME) != 0) {
470  std::string name = "color-wait-time-" + file;
471 
472  std::ofstream f(name);
473  f << genDotGraph(flags, DOTGEN_COLOR_WAIT_TIME, graphTitle, customTitleText);
474  f.flush();
475 
476  std::cout << "Writing dot file for task graph with wait time coloring to " << name << std::endl;
477 
478  graphColored = true;
479  }
480 
481  if ((flags & DOTGEN_COLOR_MAX_Q_SZ) != 0) {
482  std::string name = "color-max-q-sz-" + file;
483 
484  std::ofstream f(name);
485  f << genDotGraph(flags, DOTGEN_COLOR_MAX_Q_SZ, graphTitle, customTitleText);
486  f.flush();
487 
488  std::cout << "Writing dot file for task graph with max Q size coloring to " << name << std::endl;
489 
490  graphColored = true;
491  }
492 #endif
493 
494  if (!graphColored) {
495  std::ofstream f(file);
496  f << genDotGraph(flags, 0, graphTitle, customTitleText);
497  f.flush();
498 
499  std::cout << "Writing dot file for task graph to " << file << std::endl;
500  }
501  }
502 
509  virtual void updateTaskManagersAddressingAndPipelines() = 0;
510 
516  std::string getAddress() {
517  return this->address;
518  }
519 
528  size_t getNumberOfSubGraphs() const {
529  return numberOfSubGraphs;
530  }
531 
536  unsigned long long int getGraphComputeTime() const {
537  return graphComputeTime;
538  }
543  unsigned long long int getGraphCreationTime() const {
544  return graphCreationTime;
545  }
546 
550  std::string genDotGraphContent(int flags) {
551  std::ostringstream oss;
552 
553  for (AnyTaskManager *bTask : *taskManagers) {
554  oss << bTask->getDot(flags);
555  }
556 
557  return oss.str();
558  }
559 
564  virtual AnyTaskGraphConf *copy() = 0;
565 
569  virtual std::string genDotGraph(int flags, int colorFlag, std::string graphTitle = "", std::string customTitleText = "") = 0;
570 
576  void copyTasks(std::list<AnyTaskManager *> *tasks) {
577  for (auto task : *tasks) {
578  this->createCopy(task);
579  }
580  }
581 
588  for (auto tCopy : *taskCopyMap) {
589  if (tCopy.first == iTask) {
590  return tCopy.second;
591  }
592  }
593 
594  return nullptr;
595  }
596 
604  bool hasTask(AnyITask *task) {
605  for (auto taskSched : *taskManagers) {
606  if (taskSched->getTaskFunction() == task)
607  return true;
608  }
609 
610  return false;
611  }
612 
613  private:
614 
620  void createCopy(AnyTaskManager *taskManager) {
621  AnyITask *origITask = taskManager->getTaskFunction();
622 
623  // If the original ITask is not in the taskCopyMap, then add a new copy and map it to the original
624  if (this->taskCopyMap->find(origITask) == this->taskCopyMap->end()) {
625  AnyTaskManager *taskManagerCopy = taskManager->copy(false);
626  taskCopyMap->insert(ITaskPair(origITask, taskManagerCopy));
627  taskManagers->push_back(taskManagerCopy);
628  }
629  }
630 
631  ITaskMap *taskCopyMap;
632  std::list<AnyTaskManager *> *taskManagers;
633 
634  size_t pipelineId;
635  size_t numPipelines;
636 
637  std::string address;
638  TaskNameConnectorMap *taskConnectorNameMap;
639 
641 
644 
645 
646  std::chrono::time_point<std::chrono::high_resolution_clock> graphCreationTimestamp;
647  std::chrono::time_point<std::chrono::high_resolution_clock> graphExecutingTimestamp;
648  unsigned long long int graphComputeTime;
649  unsigned long long int graphCreationTime;
650 
651  std::condition_variable initializeCondition;
652  std::mutex initializeMutex;
653 
654  };
655 
656 }
657 
658 #endif //HTGS_ANYTASKGRAPHCONF_HPP
std::chrono::time_point< std::chrono::high_resolution_clock > graphExecutingTimestamp
Timestamp for how long the graph executed.
Definition: AnyTaskGraphConf.hpp:647
virtual AnyTaskManager * copy(bool deep)=0
Copies the TaskManager.
std::mutex initializeMutex
Mutex used to signal initializational.
Definition: AnyTaskGraphConf.hpp:652
size_t getNumThreads() const
Gets the number of threads associated with this TaskManager.
Definition: AnyTaskManager.hpp:298
Implements the parent ITask, which removes the template arguments of an ITask.
Definition: AnyITask.hpp:48
void addTaskManager(AnyTaskManager *taskManager)
Adds a task manager to the task graph.
Definition: AnyTaskGraphConf.hpp:396
unsigned long long int graphCreationTime
The total time to create the graph.
Definition: AnyTaskGraphConf.hpp:649
ITask< T, U > * getCopy(ITask< T, U > *orig)
Gets the copy for an ITask based on some original ITask reference.
Definition: AnyTaskGraphConf.hpp:327
unsigned long long int getGraphComputeTime() const
Gets the total time the graph was computing.
Definition: AnyTaskGraphConf.hpp:536
IRuleMap * iRuleMap
A mapping for each IRule pointer to the shared pointer for that IRule.
Definition: AnyTaskGraphConf.hpp:642
bool hasTask(AnyITask *task)
Checks whether an ITask is in the graph or not.
Definition: AnyTaskGraphConf.hpp:604
#define DOTGEN_COLOR_WAIT_TIME
Creates color map using wait time.
Definition: TaskGraphDotGenFlags.hpp:68
std::list< AnyTaskManager * > * taskManagers
The list of task managers for the task graph.
Definition: AnyTaskGraphConf.hpp:632
#define DOTGEN_COLOR_COMP_TIME
Creates color map using compute time.
Definition: TaskGraphDotGenFlags.hpp:56
void waitForInitialization()
Waits for all task managers to finish initializing.
Definition: AnyTaskGraphConf.hpp:275
void copyTasks(std::list< AnyTaskManager *> *tasks)
Creates a copy of each task from the list of AnyTaskManagers passed as a parameter.
Definition: AnyTaskGraphConf.hpp:576
std::unordered_multimap< std::string, std::shared_ptr< AnyConnector > > TaskNameConnectorMap
Defines multiple mappings between the task name and its connector.
Definition: AnyTaskGraphConf.hpp:50
std::string getAddress()
Gets the address for the task graph.
Definition: AnyTaskGraphConf.hpp:516
std::shared_ptr< IRule< V, W > > getIRule(IRule< V, W > *iRule)
Gets the shared_ptr reference for a particular IRule.
Definition: AnyTaskGraphConf.hpp:203
void gatherProfilingData(std::map< AnyTaskManager *, TaskManagerProfile *> *taskManagerProfiles)
Gathers profiling data for this task graph&#39;s task managers, which is added into the task manager prof...
Definition: AnyTaskGraphConf.hpp:189
unsigned long long int getGraphCreationTime() const
Gets the total time the graph was getting created.
Definition: AnyTaskGraphConf.hpp:543
void writeDotToFile(std::string file, int flags=0, std::string graphTitle="", std::string customTitleText="")
Writes the dot representation of the task graph to disk with additional options such as profiling...
Definition: AnyTaskGraphConf.hpp:443
void shutdown()
Called when all the threads in this graph have finished executing.
Definition: AnyTaskGraphConf.hpp:262
#define HTGS_DEBUG_VERBOSE(msg)
Prints a debug message to std:cerr with VERBOSE level.
Definition: debug_message.hpp:75
std::string address
The address for this task graph and its tasks.
Definition: AnyTaskGraphConf.hpp:637
std::pair< AnyITask *, AnyTaskManager * > ITaskPair
Defines a pair to be added into an ITaskMap.
Definition: AnyTaskGraphConf.hpp:44
virtual AnyITask * getTaskFunction()=0
Gets the ITask function associated with the TaskManager.
virtual ~AnyTaskGraphConf()
Destructor.
Definition: AnyTaskGraphConf.hpp:101
unsigned long long int graphComputeTime
The total time to execute the graph.
Definition: AnyTaskGraphConf.hpp:648
TaskNameConnectorMap * taskConnectorNameMap
Maps the tsak name to the task&#39;s connector.
Definition: AnyTaskGraphConf.hpp:638
Implements parent ITask, removing template arguments.
std::chrono::time_point< std::chrono::high_resolution_clock > graphCreationTimestamp
Timestamp when graph constructor was called.
Definition: AnyTaskGraphConf.hpp:646
void printProfile()
Prints profile data to console for all task managers.
Definition: AnyTaskGraphConf.hpp:408
Provides an interface to send data along RuleManager edges for processing state and dependencies...
Definition: ExecutionPipeline.hpp:34
std::map< AnyITask *, AnyTaskManager * > ITaskMap
Creates a mapping between an ITask and a task manager.
Definition: AnyTaskGraphConf.hpp:38
std::map< AnyIRule *, std::shared_ptr< AnyIRule > > IRuleMap
Defines a mapping between an IRule pointer and the shared pointer of that IRule.
Definition: Types.hpp:75
bool isPoll()
Gets whether the task manager is polling for data or not.
Definition: AnyTaskManager.hpp:351
void initialize()
Initializes the task graph just prior to spawning threads.
Definition: AnyTaskGraphConf.hpp:238
virtual std::shared_ptr< AnyConnector > getInputConnector()=0
Pure virtual function that gets the task manager that is consuming data from the graph&#39;s input...
TaskManager< T, U > * getTaskManager(ITask< T, U > *task)
Gets the task manager that is responsible for a particular ITask.
Definition: AnyTaskGraphConf.hpp:362
std::list< AnyTaskManager * > * getTaskManagers()
Virtual function that initiates updating the task graph communicator.
Definition: AnyTaskGraphConf.hpp:180
Provides an interface to send data along RuleManager edges for processing state and dependencies...
bool isStartTask()
Gets whether this task manager will begin executing immediately with nullptr data or not...
Definition: AnyTaskManager.hpp:343
virtual void finishedSetup()
Called when the task graph has finished setting up its tasks and launched all threads for the graph...
Definition: AnyTaskGraphConf.hpp:257
The parent class for a Task that removes the template arguments.
Definition: AnyTaskManager.hpp:45
std::string genDotGraphContent(int flags)
Generate the content only of the graph (excludes all graph definitions and attributes) ...
Definition: AnyTaskGraphConf.hpp:550
virtual void updateTaskManagersAddressingAndPipelines()=0
Updates the task managers addresses, pipelineIds and the number of pipelines for all tasks in the Tas...
ITaskMap * taskCopyMap
The ITask copy map that maps an original ITask to a task manager copy.
Definition: AnyTaskGraphConf.hpp:631
std::map< AnyMemoryAllocator *, std::shared_ptr< AnyMemoryAllocator > > MemAllocMap
Defines a mapping between a BaseMemoryAllocator and its shared_ptr.
Definition: Types.hpp:87
TaskNameConnectorMap * getTaskConnectorNameMap() const
Gets the task name connector map that maps the task name to its input connector.
Definition: AnyTaskGraphConf.hpp:313
An interface to process input data and forward results within a TaskGraph.
Definition: ITask.hpp:165
size_t numPipelines
The number of pipelines from this graph.
Definition: AnyTaskGraphConf.hpp:635
Defines common types used throughout the HTGS API and some of which that are used by users of HTGS su...
AnyTaskManager * getTaskManagerCopy(AnyITask *iTask)
Gets the task manager copy for a given ITask.
Definition: AnyTaskGraphConf.hpp:587
Abstract class that describes how memory is allocated and freed.
Definition: IMemoryAllocator.hpp:67
std::mutex * getInitializationMutex()
Gets the initialization mutex, used for signaling when initialization is done.
Definition: AnyTaskGraphConf.hpp:305
virtual std::string genDotGraph(int flags, int colorFlag, std::string graphTitle="", std::string customTitleText="")=0
Generates the dot graph as a string.
Encapsulates an ITask to interact with an ITask&#39;s functionality.
Definition: ITask.hpp:39
#define DOTGEN_COLOR_MAX_Q_SZ
Creates color map using maximum queue size.
Definition: TaskGraphDotGenFlags.hpp:62
size_t pipelineId
The pipelineId for the task graph.
Definition: AnyTaskGraphConf.hpp:634
Implements the base class for the TaskGraphConf class, removing the template arguments and providing ...
Definition: AnyTaskGraphConf.hpp:66
Implements the TaskManagerProfile class that is used to gather profile data for a task manager...
std::pair< AnyMemoryAllocator *, std::shared_ptr< AnyMemoryAllocator > > MemAllocPair
Defines a pair to be added to the MemAllocMap.
Definition: Types.hpp:93
size_t numberOfSubGraphs
The number of sub-graphs that will be spawned.
Definition: AnyTaskGraphConf.hpp:640
virtual AnyTaskGraphConf * copy()=0
Creates an exact copy of this task graph.
void createCopy(AnyTaskManager *taskManager)
Creates a copy of a task manager and adds the copy and a mapping between the task manager copy and th...
Definition: AnyTaskGraphConf.hpp:620
Implements a TaskManager that interacts with an ITask and holds the input and output Connector for th...
size_t getNumberOfSubGraphs() const
Gets the number of sub graphs within this task graph.
Definition: AnyTaskGraphConf.hpp:528
std::shared_ptr< IMemoryAllocator< V > > getMemoryAllocator(IMemoryAllocator< V > *allocator)
Gets the shared_ptr reference for a particular IMemoryAllocator.
Definition: AnyTaskGraphConf.hpp:222
std::pair< std::string, std::shared_ptr< AnyConnector > > TaskNameConnectorPair
Defines a pair to be added into a TaskNameConnectorMap.
Definition: AnyTaskGraphConf.hpp:56
Implements the edge descriptor interface to build edges for a task graph.
std::pair< AnyIRule *, std::shared_ptr< AnyIRule > > IRulePair
Defines a pair to be added to the IRuleMap.
Definition: Types.hpp:81
#define DOTGEN_FLAG_SHOW_ALL_THREADING
Shows all threading fully expanded during dot generation.
Definition: TaskGraphDotGenFlags.hpp:26
size_t getPipelineId()
Gets the pipeline ID for the task graph configuration.
Definition: AnyTaskGraphConf.hpp:418
MemAllocMap * memAllocMap
A mapping for each IMemoryAllocator to its associated shared_ptr.
Definition: AnyTaskGraphConf.hpp:643
std::condition_variable initializeCondition
The condition variable to signal to check if initialization has finished.
Definition: AnyTaskGraphConf.hpp:651
AnyTaskGraphConf(size_t pipelineId, size_t numPipelines, std::string baseAddress)
Constructs the AnyTaskGraphConf.
Definition: AnyTaskGraphConf.hpp:76
virtual std::shared_ptr< AnyConnector > getOutputConnector()=0
Virtual function that gets the connector used for graph output.
AnyITask * getCopy(AnyITask *orig)
Gets the copy for an AnyITask based on some original AnyITask reference.
Definition: AnyTaskGraphConf.hpp:344
An interface to process input data and forward results within a TaskGraph.
Definition: Bookkeeper.hpp:23
size_t getNumPipelines()
Gets the number of pipelines that exist for this task graph.
Definition: AnyTaskGraphConf.hpp:424
std::condition_variable * getInitializationCondition()
Notifies the task graph to check if all task managers have been initialized or not.
Definition: AnyTaskGraphConf.hpp:297
#define DOTGEN_FLAG_SHOW_CONNECTOR_VERBOSE
Shows verbose information within each connector in the graph.
Definition: TaskGraphDotGenFlags.hpp:92