ParallelModel.h
1 
10 #ifndef WRENCH_PARALLELMODEL_H
11 #define WRENCH_PARALLELMODEL_H
12 
13 #include <vector>
14 #include <memory>
15 #include <functional>
16 
17 namespace wrench {
18 
23  class ParallelModel {
24 
25  public:
26 
27  static std::shared_ptr<ParallelModel> AMDAHL(double alpha);
28  static std::shared_ptr<ParallelModel> CONSTANTEFFICIENCY(double efficiency);
29  static std::shared_ptr<ParallelModel> CUSTOM(std::function<std::vector<double>(double, long)> lambda);
30 
31  /***********************/
33  /***********************/
34 
44  virtual std::vector<double> getWorkPerThread(double total_work, unsigned long num_threads) = 0;
45  virtual ~ParallelModel() {};
46 
47  /***********************/
49  /***********************/
50 
51  private:
52 
53  };
54 
55 }
56 
57 #endif //WRENCH_PARALLELMODEL_H
static std::shared_ptr< ParallelModel > AMDAHL(double alpha)
Create an instance of an "Amdahl" parallel model.
Definition: ParallelModel.cpp:31
static std::shared_ptr< ParallelModel > CUSTOM(std::function< std::vector< double >(double, long)> lambda)
Create an instance of a "Custom" parallel model.
Definition: ParallelModel.cpp:52
Definition: Alarm.cpp:20
A virtual class (with convenient static methods) to define parallel task performance models.
Definition: ParallelModel.h:23
static std::shared_ptr< ParallelModel > CONSTANTEFFICIENCY(double efficiency)
Create an instance of a "Constant Efficiency" parallel model.
Definition: ParallelModel.cpp:41