WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | Static Public Member Functions | List of all members
wrench::ParallelModel Class Referenceabstract

A virtual class (with convenient static methods) to define parallel task performance models. More...

#include <ParallelModel.h>

Inheritance diagram for wrench::ParallelModel:
wrench::AmdahlParallelModel wrench::ConstantEfficiencyParallelModel wrench::CustomParallelModel

Public Member Functions

virtual std::vector< double > getWorkPerThread (double total_work, unsigned long num_threads)=0
 A method the, for this parallel model, computes how much work each thread that is part of a parallel task should do. More...
 

Static Public Member Functions

static std::shared_ptr< ParallelModelAMDAHL (double alpha)
 Create an instance of an "Amdahl" parallel model. More...
 
static std::shared_ptr< ParallelModelCONSTANTEFFICIENCY (double efficiency)
 Create an instance of a "Constant Efficiency" parallel model. More...
 
static std::shared_ptr< ParallelModelCUSTOM (std::function< std::vector< double >(double, long)> lambda)
 Create an instance of a "Custom" parallel model. More...
 

Detailed Description

A virtual class (with convenient static methods) to define parallel task performance models.

Member Function Documentation

◆ AMDAHL()

std::shared_ptr< ParallelModel > wrench::ParallelModel::AMDAHL ( double  alpha)
static

Create an instance of an "Amdahl" parallel model.

Parameters
alphathe 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

◆ CONSTANTEFFICIENCY()

std::shared_ptr< ParallelModel > wrench::ParallelModel::CONSTANTEFFICIENCY ( double  efficiency)
static

Create an instance of a "Constant Efficiency" parallel model.

Parameters
efficiencythe parallel efficiency (which does not depend on the number of threads/cores).
Returns
a model instance

◆ CUSTOM()

std::shared_ptr< ParallelModel > wrench::ParallelModel::CUSTOM ( std::function< std::vector< double >(double, long)>  lambda)
static

Create an instance of a "Custom" parallel model.

Parameters
lambdaa function that, when given a total flop amount and a number of threads, returns a vector of per-thread work amounts
Returns
a model instance

◆ getWorkPerThread()

virtual std::vector<double> wrench::ParallelModel::getWorkPerThread ( double  total_work,
unsigned long  num_threads 
)
pure virtual

A method the, for this parallel model, computes how much work each thread that is part of a parallel task should do.

Parameters
total_workthe total amount of work (in flops)
num_threadsthe number of threads
Returns
an amount of work (in flop) per thread

Implemented in wrench::AmdahlParallelModel, wrench::ConstantEfficiencyParallelModel, and wrench::CustomParallelModel.


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