![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
The common interface of all the schedulers. More...
#include <agrum/base/graphicalModels/inference/scheduler/scheduler.h>
Public Member Functions | |
Constructors / Destructors | |
| Scheduler (Size nb_threads=0, double max_megabyte_memory=0.0) | |
| default constructor | |
| virtual Scheduler * | clone () const =0 |
| virtual copy constructor | |
| virtual | ~Scheduler () |
| destructor | |
Accessors/Modifiers | |
| virtual void | setMaxMemory (double megabytes) |
| sets an upper bound on the memory consumption admissible | |
| virtual double | maxMemory () const |
| returns the Max memory (in megabytes) available for executing schedules | |
| virtual void | execute (Schedule &)=0 |
| execute all the operations of a given schedule | |
| virtual double | nbOperations (const Schedule &)=0 |
| returns an estimation of the number of elementary operations needed to perform a given schedule | |
| virtual std::pair< double, double > | memoryUsage (const Schedule &)=0 |
| returns the memory consumption used during the execution of a schedule | |
Accessors/Modifiers | |
| virtual void | setNumberOfThreads (Size nb) |
| sets the number max of threads to be used by the class containing this ThreadNumberManager | |
| virtual Size | getNumberOfThreads () const |
| returns the current max number of threads used by the class containing this ThreadNumberManager | |
| bool | isGumNumberOfThreadsOverriden () const |
| indicates whether the class containing this ThreadNumberManager set its own number of threads | |
Protected Member Functions | |
| Scheduler (const Scheduler &from) | |
| copy constructor | |
| Scheduler (Scheduler &&from) | |
| move constructor | |
| Scheduler & | operator= (const Scheduler &from) |
| copy operator | |
| Scheduler & | operator= (Scheduler &&from) |
| move operator | |
Protected Attributes | |
| double | _max_memory {0.0} |
| the max memory usage possible (in bytes) | |
Private Attributes | |
| Size | _nb_threads_ {0} |
| the max number of threads used by the class | |
The common interface of all the schedulers.
Definition at line 71 of file scheduler.h.
default constructor
By default, the number of threads used by the scheduler to execute schedules is aGrUM's number of threads (see file thread.h). The default max memory available is infinite.
| max_megabyte_memory | the maximum number of megabytes to use for executing the operations of a schedule. If non strictly positive, this means an infinite memory available (the default). |
| nb_threads | the number of threads to use to execute in parallel the operations of a schedule. 0 = use aGrUM's default. |
Referenced by Scheduler(), Scheduler(), clone(), operator=(), and operator=().
|
virtual |
destructor
|
protected |
|
protected |
|
pure virtual |
virtual copy constructor
Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.
References Scheduler().
|
pure virtual |
execute all the operations of a given schedule
Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.
|
virtualinherited |
returns the current max number of threads used by the class containing this ThreadNumberManager
Implements gum::IThreadNumberManager.
Referenced by gum::learning::IBNLearner::createParamEstimator_(), gum::learning::IBNLearner::createScore_(), gum::credal::InferenceEngine< GUM_SCALAR >::displatchMarginalsToThreads_(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::expFusion_(), gum::ScheduledInference::scheduler(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::verticesFusion_().
|
virtualinherited |
indicates whether the class containing this ThreadNumberManager set its own number of threads
Implements gum::IThreadNumberManager.
Referenced by gum::learning::IBNLearner::createParamEstimator_(), and gum::learning::IBNLearner::createScore_().
|
virtual |
returns the Max memory (in megabytes) available for executing schedules
Referenced by gum::ScheduledInference::operator=().
returns the memory consumption used during the execution of a schedule
Actually, this function does not return a precise account of the memory used to perform the schedule but a rough estimate based on the sizes of the tables involved in the schedule.
Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.
returns an estimation of the number of elementary operations needed to perform a given schedule
Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.
|
virtual |
sets an upper bound on the memory consumption admissible
| megabytes | the number of megabytes that can be used for the execution of the schedule. If this number is equal to 0, then no memory limit is applied. |
Reimplemented in gum::SchedulerParallel, and gum::SchedulerSequential.
|
virtualinherited |
sets the number max of threads to be used by the class containing this ThreadNumberManager
| nb | the number of threads to be used. If this number is set to 0, then it is defaulted to aGrUM's number of threads |
Implements gum::IThreadNumberManager.
Reimplemented in gum::learning::IBNLearner, gum::learning::RecordCounter, gum::ScheduledInference, and gum::SchedulerParallel.
Referenced by gum::learning::IBNLearner::setNumberOfThreads(), and gum::ScheduledInference::setNumberOfThreads().
|
protected |
|
privateinherited |
the max number of threads used by the class
Definition at line 126 of file threadNumberManager.h.