aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::Scheduler Class Referenceabstract

The common interface of all the schedulers. More...

#include <agrum/base/graphicalModels/inference/scheduler/scheduler.h>

Inheritance diagram for gum::Scheduler:
Collaboration diagram for gum::Scheduler:

Public Member Functions

Constructors / Destructors
 Scheduler (Size nb_threads=0, double max_megabyte_memory=0.0)
 default constructor
virtual Schedulerclone () 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, doublememoryUsage (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
Scheduleroperator= (const Scheduler &from)
 copy operator
Scheduleroperator= (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

Detailed Description

The common interface of all the schedulers.

Definition at line 71 of file scheduler.h.

Constructor & Destructor Documentation

◆ Scheduler() [1/3]

gum::Scheduler::Scheduler ( Size nb_threads = 0,
double max_megabyte_memory = 0.0 )

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.

Parameters
max_megabyte_memorythe 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_threadsthe 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=().

Here is the caller graph for this function:

◆ ~Scheduler()

virtual gum::Scheduler::~Scheduler ( )
virtual

destructor

◆ Scheduler() [2/3]

gum::Scheduler::Scheduler ( const Scheduler & from)
protected

copy constructor

References Scheduler().

Here is the call graph for this function:

◆ Scheduler() [3/3]

gum::Scheduler::Scheduler ( Scheduler && from)
protected

move constructor

References Scheduler().

Here is the call graph for this function:

Member Function Documentation

◆ clone()

virtual Scheduler * gum::Scheduler::clone ( ) const
pure virtual

virtual copy constructor

Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.

References Scheduler().

Here is the call graph for this function:

◆ execute()

virtual void gum::Scheduler::execute ( Schedule & )
pure virtual

execute all the operations of a given schedule

Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.

◆ getNumberOfThreads()

virtual Size gum::ThreadNumberManager::getNumberOfThreads ( ) const
virtualinherited

◆ isGumNumberOfThreadsOverriden()

bool gum::ThreadNumberManager::isGumNumberOfThreadsOverriden ( ) const
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_().

Here is the caller graph for this function:

◆ maxMemory()

virtual double gum::Scheduler::maxMemory ( ) const
virtual

returns the Max memory (in megabytes) available for executing schedules

Returns
the Max memory (in megabytes) available for executing schedules. 0 means an unlimited amount of memory

Referenced by gum::ScheduledInference::operator=().

Here is the caller graph for this function:

◆ memoryUsage()

virtual std::pair< double, double > gum::Scheduler::memoryUsage ( const Schedule & )
pure virtual

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.

Returns
a pair of memory consumption: the first one is the maximum amount of memory used during the execution of the Schedule and the second one is the amount of memory still used at the end of the execution of the schedule

Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.

◆ nbOperations()

virtual double gum::Scheduler::nbOperations ( const Schedule & )
pure virtual

returns an estimation of the number of elementary operations needed to perform a given schedule

Implemented in gum::SchedulerParallel, and gum::SchedulerSequential.

◆ operator=() [1/2]

Scheduler & gum::Scheduler::operator= ( const Scheduler & from)
protected

copy operator

References Scheduler().

Here is the call graph for this function:

◆ operator=() [2/2]

Scheduler & gum::Scheduler::operator= ( Scheduler && from)
protected

move operator

References Scheduler().

Here is the call graph for this function:

◆ setMaxMemory()

virtual void gum::Scheduler::setMaxMemory ( double megabytes)
virtual

sets an upper bound on the memory consumption admissible

Parameters
megabytesthe 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.

◆ setNumberOfThreads()

virtual void gum::ThreadNumberManager::setNumberOfThreads ( Size nb)
virtualinherited

sets the number max of threads to be used by the class containing this ThreadNumberManager

Parameters
nbthe 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().

Here is the caller graph for this function:

Member Data Documentation

◆ _max_memory

double gum::Scheduler::_max_memory {0.0}
protected

the max memory usage possible (in bytes)

Definition at line 142 of file scheduler.h.

142{0.0};

◆ _nb_threads_

Size gum::ThreadNumberManager::_nb_threads_ {0}
privateinherited

the max number of threads used by the class

Definition at line 126 of file threadNumberManager.h.

126{0};

The documentation for this class was generated from the following file:
  • agrum/base/graphicalModels/inference/scheduler/scheduler.h