![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
#include <schedulerSequential.h>
Classes | |
| struct | UnexecutedOperation |
| a structure to keep informations about operations that could not be executed due to memory usage limitations More... | |
Public Member Functions | |
Constructors / Destructors | |
| SchedulerSequential (Size max_nb_threads=0, double max_megabyte_memory=0.0) | |
| default constructor | |
| SchedulerSequential (const SchedulerSequential &from) | |
| copy constructor | |
| SchedulerSequential (SchedulerSequential &&from) | |
| move constructor | |
| SchedulerSequential * | clone () const final |
| virtual copy constructor | |
| virtual | ~SchedulerSequential () |
| destructor | |
Accessors/Modifiers | |
| 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 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 Attributes | |
| double | _max_memory {0.0} |
| the max memory usage possible (in bytes) | |
Private Member Functions | |
| void | _setSchedule_ (const Schedule &schedule) |
| sets a schedule and updates the set of operations if necessary | |
| Size | _addExecutableOps_ (std::vector< UnexecutedOperation > &unexecuted_deletions, std::vector< UnexecutedOperation > &unexecuted_operations, bool &unexecuted_deletions_sorted, bool &unexecuted_operations_sorted, double memory_used, double max_memory, List< NodeId > &available_nodes) const |
| add the currently executable deletions into the set of available operations | |
| void | _simulateDAGUpdate_ (DAG &dag, const NodeId node, std::vector< NodeId > &new_available_nodes) const |
| simulate the update of the schedule's DAG resulting from the execution of an operation | |
| void | _simulateExecuteOneOperation_ (const NodeId node, ScheduleOperator &op, DAG &dag, List< NodeId > &available_nodes, std::vector< NodeId > &new_available_nodes) |
| simulate the execution of one operation | |
| void | _simulateExecution_ () |
| simulate the execution of the whole schedule | |
Static Private Member Functions | |
| static bool | _cmp_ (const UnexecutedOperation &a, const UnexecutedOperation &b) |
| the comparison function used to sort unexecutable operations | |
Private Attributes | |
| Schedule * | _schedule_ {nullptr} |
| the schedule we wish to execute | |
| std::vector< NodeId > | _operations_ |
| the sequence of operations to perform | |
| std::pair< double, double > | _memory_usage_ {0.0, 0.0} |
| the memory usage for the sequence of operations; | |
| bool | _operations_up_to_date_ {false} |
| is the set of operations up to date | |
| Size | _nb_threads_ {0} |
| the max number of threads used by the class | |
Definition at line 60 of file schedulerSequential.h.
|
explicit |
default constructor
Referenced by SchedulerSequential(), SchedulerSequential(), ~SchedulerSequential(), and clone().
| gum::SchedulerSequential::SchedulerSequential | ( | const SchedulerSequential & | from | ) |
| gum::SchedulerSequential::SchedulerSequential | ( | SchedulerSequential && | from | ) |
|
virtual |
|
private |
add the currently executable deletions into the set of available operations
|
staticprivate |
the comparison function used to sort unexecutable operations
|
private |
sets a schedule and updates the set of operations if necessary
|
private |
simulate the update of the schedule's DAG resulting from the execution of an operation
|
private |
simulate the execution of one operation
|
private |
simulate the execution of the whole schedule
|
finalvirtual |
virtual copy constructor
Implements gum::Scheduler.
References SchedulerSequential().
|
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().
|
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().
|
protectedinherited |
the memory usage for the sequence of operations;
Definition at line 125 of file schedulerSequential.h.
|
privateinherited |
the max number of threads used by the class
Definition at line 126 of file threadNumberManager.h.
|
private |
the sequence of operations to perform
Definition at line 122 of file schedulerSequential.h.
|
private |
is the set of operations up to date
Definition at line 128 of file schedulerSequential.h.
|
private |