![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A scheduler that executes available operators in parallel. More...
#include <agrum/base/graphicalModels/inference/scheduler/schedulerParallel.h>
Public Member Functions | |
Constructors / Destructors | |
| SchedulerParallel (Size max_nb_threads=0, double max_megabyte_memory=0.0) | |
| default constructor | |
| SchedulerParallel (const SchedulerParallel &from) | |
| copy constructor | |
| SchedulerParallel (SchedulerParallel &&from) | |
| move constructor | |
| SchedulerParallel * | clone () const final |
| virtual copy constructor | |
| virtual | ~SchedulerParallel () |
| destructor | |
Accessors/Modifiers | |
| void | setNumberOfThreads (Size nb) final |
| sets the number of threads that can be used by the scheduler | |
| void | setMaxMemory (double megabytes) final |
| sets an upper bound on the memory consumption admissible | |
| void | execute (Schedule &) final |
| execute all the operations of a given schedule | |
| double | nbOperations (const Schedule &) final |
| returns an estimation of the number of elementary operations needed to perform a given schedule | |
| std::pair< double, double > | memoryUsage (const Schedule &) final |
| returns the memory consumption used during the execution of a schedule | |
Accessors/Modifiers | |
| virtual double | maxMemory () const |
| returns the Max memory (in megabytes) available for executing schedules | |
Accessors/Modifiers | |
| 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 Attributes | |
| double | _max_memory {0.0} |
| the max memory usage possible (in bytes) | |
Private Attributes | |
| SchedulerSequential | _sequential_scheduler_ |
| a scheduler used for computing the number of operations and memory usage | |
| Size | _nb_threads_ {0} |
| the max number of threads used by the class | |
A scheduler that executes available operators in parallel.
Definition at line 74 of file schedulerParallel.h.
|
explicit |
default constructor
Referenced by SchedulerParallel(), SchedulerParallel(), ~SchedulerParallel(), and clone().
| gum::SchedulerParallel::SchedulerParallel | ( | const SchedulerParallel & | from | ) |
| gum::SchedulerParallel::SchedulerParallel | ( | SchedulerParallel && | from | ) |
|
virtual |
|
finalvirtual |
virtual copy constructor
Implements gum::Scheduler.
References SchedulerParallel().
|
finalvirtual |
execute all the operations of a given schedule
Implements gum::Scheduler.
References execute().
Referenced by execute().
|
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_().
|
virtualinherited |
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.
Implements gum::Scheduler.
References memoryUsage().
Referenced by memoryUsage().
returns an estimation of the number of elementary operations needed to perform a given schedule
Implements gum::Scheduler.
References nbOperations().
Referenced by nbOperations().
|
finalvirtual |
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 from gum::Scheduler.
References setMaxMemory().
Referenced by setMaxMemory().
|
finalvirtual |
sets the number of threads that can be used by the scheduler
| nb | the number of threads used for executing schedules. If this number is set to 0, then it is defaulted to aGrUM's number of threads |
Reimplemented from gum::ThreadNumberManager.
References setNumberOfThreads().
Referenced by setNumberOfThreads().
|
protectedinherited |
|
privateinherited |
the max number of threads used by the class
Definition at line 126 of file threadNumberManager.h.
|
private |
a scheduler used for computing the number of operations and memory usage
Definition at line 140 of file schedulerParallel.h.