pelib  2.0.0
pelib::Task Class Reference

#include <Task.hpp>

List of all members.

Public Member Functions

 Task (const std::string &id, bool is_streaming=true)
 Task (const Task &)
virtual ~Task ()
virtual double getFrequency () const
virtual void setFrequency (double frequency)
virtual double getWidth () const
virtual void setWidth (double width)
virtual std::string getModule () const
virtual void setModule (const std::string &name)
virtual std::string getName () const
virtual std::string getEfficiencyString () const
virtual void setEfficiencyString (const std::string &efficiencyString)
virtual double getEfficiency (int p, double def=very_small) const
virtual double getWorkload () const
virtual void setWorkload (double workload)
virtual double getMaxWidth () const
virtual void setMaxWidth (double maxWidth)
virtual double getStartTime () const
virtual void setStartTime (double startTime)
virtual double runtime (double width=1, double frequency=1) const
virtual bool operator< (const Task &other) const
virtual const std::set< const
Link * > & 
getProducers () const
virtual const std::set< const
Link * > & 
getConsumers () const
virtual std::set< const Link * > & getProducers ()
virtual std::set< const Link * > & getConsumers ()
virtual bool operator== (const Task &other) const
bool isStreaming () const

Protected Attributes

double frequency
double width
double workload
double maxWidth
float start_time
bool streaming
std::string name
std::string module
std::string efficiencyString
std::set< const Link * > consumers
std::set< const Link * > producers

Static Protected Attributes

static const float very_small = 1e-6

Detailed Description

Models a moldable task of a streaming application

Definition at line 34 of file Task.hpp.


Constructor & Destructor Documentation

pelib::Task::Task ( const std::string id,
bool  is_streaming = true 
)

Constructor

Parameters:
idIdentifier of the task

Definition at line 42 of file Task.cpp.

pelib::Task::Task ( const Task task)

Copy constructor

Definition at line 55 of file Task.cpp.

pelib::Task::~Task ( ) [virtual]

Destructor

Definition at line 71 of file Task.cpp.


Member Function Documentation

const set< const Link * > & pelib::Task::getConsumers ( ) const [virtual]

Get the set of task that consume outputs from this task

Definition at line 419 of file Task.cpp.

set< const Link * > & pelib::Task::getConsumers ( ) [virtual]

Get the set of task that consume outputs from this task

Definition at line 431 of file Task.cpp.

double pelib::Task::getEfficiency ( int  p,
double  def = very_small 
) const [virtual]

Computes the efficiency of the task, given its efficiency formula

Parameters:
pGet efficiency of the task for p cores
defDefault efficiency if p is higher than the maximal width of the task

Definition at line 141 of file Task.cpp.

Gets the formula that defines the overhead of the parallelization of this task

Definition at line 114 of file Task.cpp.

double pelib::Task::getFrequency ( ) const [virtual]

Return the frequency, in KHz, the task runs at

Definition at line 77 of file Task.cpp.

double pelib::Task::getMaxWidth ( ) const [virtual]

Gets the maximum number of cores that can run this task in parallel in an efficient manner

Definition at line 197 of file Task.cpp.

std::string pelib::Task::getModule ( ) const [virtual]

Gets the name of the module containing the code run by this task

Definition at line 379 of file Task.cpp.

std::string pelib::Task::getName ( ) const [virtual]

Gets the name (identifier string) of the task

Definition at line 101 of file Task.cpp.

const set< const Link * > & pelib::Task::getProducers ( ) const [virtual]

Get the set of task that produce inputs for this task

Definition at line 413 of file Task.cpp.

set< const Link * > & pelib::Task::getProducers ( ) [virtual]

Get the set of task that produce inputs for this task

Definition at line 425 of file Task.cpp.

double pelib::Task::getStartTime ( ) const [virtual]

Gets the time at which this task begins to work, relative to the beginning of a pipeline round

Definition at line 391 of file Task.cpp.

double pelib::Task::getWidth ( ) const [virtual]

Get the number of processors that run this task

Definition at line 89 of file Task.cpp.

double pelib::Task::getWorkload ( ) const [virtual]

Gets the workload, in number of instructions, of the task

Definition at line 185 of file Task.cpp.

bool pelib::Task::isStreaming ( ) const

Definition at line 209 of file Task.cpp.

bool pelib::Task::operator< ( const Task other) const [virtual]

Allows the comparison of tasks. Used with ==, allows the test of difference

Definition at line 319 of file Task.cpp.

bool pelib::Task::operator== ( const Task other) const [virtual]

Allows the comparison of tasks. Used with <, allows the test of difference

Definition at line 373 of file Task.cpp.

double pelib::Task::runtime ( double  width = 1,
double  frequency = 1 
) const [virtual]

Computes and returns the global run time of this task assuming a given width and frequency

Parameters:
widthAssume the task run on that many cores
frequencyAssumes the task runs at this frequency

Definition at line 403 of file Task.cpp.

void pelib::Task::setEfficiencyString ( const std::string efficiencyString) [virtual]

Sets the formula that defines the overhead of the parallelization of this task

Definition at line 120 of file Task.cpp.

void pelib::Task::setFrequency ( double  frequency) [virtual]

Sets the frequency at which the task runs

Definition at line 83 of file Task.cpp.

void pelib::Task::setMaxWidth ( double  maxWidth) [virtual]

Sets the maximum number of cores that can run this task in parallel in an efficient manner

Definition at line 203 of file Task.cpp.

void pelib::Task::setModule ( const std::string name) [virtual]

Sets the name of the module containing the code run by this task

Definition at line 385 of file Task.cpp.

void pelib::Task::setStartTime ( double  startTime) [virtual]

Sets the time at which this task begins to work, relative to the beginning of a pipeline round

Definition at line 397 of file Task.cpp.

void pelib::Task::setWidth ( double  width) [virtual]

Set the number of processors that run this task

Definition at line 95 of file Task.cpp.

void pelib::Task::setWorkload ( double  workload) [virtual]

Sets the workload, in number of instructions, of the task

Definition at line 191 of file Task.cpp.


Member Data Documentation

std::set<const Link*> pelib::Task::consumers [protected]

Sets of producers and consumers linked to this task

Definition at line 159 of file Task.hpp.

Definition at line 157 of file Task.hpp.

double pelib::Task::frequency [protected]

Frequency and width allocated to this task

Definition at line 150 of file Task.hpp.

double pelib::Task::maxWidth [protected]

Definition at line 152 of file Task.hpp.

Definition at line 157 of file Task.hpp.

Name, source code module name and efficiency formula of the task

Definition at line 157 of file Task.hpp.

std::set<const Link*> pelib::Task::producers [protected]

Definition at line 159 of file Task.hpp.

Time at which this task starts

Definition at line 154 of file Task.hpp.

bool pelib::Task::streaming [protected]

Definition at line 155 of file Task.hpp.

const float pelib::Task::very_small = 1e-6 [static, protected]

Default efficiency value when computing efficiency for more cores that this task can support

Definition at line 162 of file Task.hpp.

double pelib::Task::width [protected]

Definition at line 150 of file Task.hpp.

double pelib::Task::workload [protected]

Workload in number of instructions and maximum number of cores able to run this task

Definition at line 152 of file Task.hpp.


The documentation for this class was generated from the following files: