wrench::ParallelModel
-
class ParallelModel
A virtual class (with convenient static methods) to define parallel task performance models.
Subclassed by wrench::AmdahlParallelModel, wrench::ConstantEfficiencyParallelModel, wrench::CustomParallelModel
Public Functions
-
virtual double getParallelPerThreadWork(double total_work, unsigned long num_threads) = 0
A method that computes the amount of per-thread parallel work.
- Parameters
total_work – the total amount of work (in flops)
num_threads – the number of threads
- Returns
an amount of work (in flop)
-
virtual double getPurelySequentialWork(double total_work, unsigned long num_threads) = 0
A method that computes the amount of purely sequential work.
- Parameters
total_work – the total amount of work (in flops)
num_threads – the number of threads
- Returns
an amount of work (in flop)
Public Static Functions
-
static std::shared_ptr<ParallelModel> AMDAHL(double alpha)
Create an instance of an “Amdahl” parallel model.
- Parameters
alpha – the fraction (i.e., a number between 0.0 and 1.0) of the task’s work that is perfectly parallelizable. Setting this value to 0 means that the task is purely sequential, and setting it to 1 means that the task is perfectly parallelizable.
- Returns
a model instance
-
static std::shared_ptr<ParallelModel> CONSTANTEFFICIENCY(double efficiency)
Create an instance of a “Constant Efficiency” parallel model.
- Parameters
efficiency – the parallel efficiency (which does not depend on the number of threads/cores).
- Returns
a model instance
-
static std::shared_ptr<ParallelModel> CUSTOM(const std::function<double(double, long)> &lambda_sequential, const std::function<double(double, long)> &lambda_per_thread)
Create an instance of a “Custom” parallel model.
- Parameters
lambda_sequential – a function that, when given a total flop amount and a number of threads, returns the amount of purely sequential work, in flops
lambda_per_thread – a function that, when given a total flop amount and a number of threads, returns the amount of per-thread parallel work, in flops
- Returns
a model instance
-
virtual double getParallelPerThreadWork(double total_work, unsigned long num_threads) = 0