aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::threadsOMP Namespace Reference

Classes

class  ThreadExecutor

Functions

unsigned int getNumberOfThreads ()
 returns the max number of threads used by default when entering the next parallel region
void setNumberOfThreads (unsigned int number)
 Set the number of threads to be used when entering the next parallel region.
bool hasOMPSupport ()
 Is OMP active ?
unsigned int getMaxNumberOfThreads ()
 Returns the maximum number of threads that should be used at any time.
unsigned int getNumberOfLogicalProcessors ()
 Get the number of logical processors.
unsigned int getThreadNumber ()
 Get the calling thread id.
unsigned int getNumberOfRunningThreads ()
 Get the current number of running threads.
void setNestedParallelism (bool value)
 Set nested parallelism (false bu default).
bool getNestedParallelism ()
 Get nested parallelism status.
void setDynamicThreadsNumber (bool value)
 Set the dynamic threads number (false by default).
bool getDynamicThreadsNumber ()
 Get the dynamic thread number adjustment status.

Variables

static unsigned int _nb_threads_ {getMaxNumberOfThreads()}

Function Documentation

◆ getNumberOfThreads()

unsigned int gum::threadsOMP::getNumberOfThreads ( )

returns the max number of threads used by default when entering the next parallel region

This is the number of threads launched in parallel regions. By default, this number is equal to getMaxNumberOfThreads() but if the user has changed it using method setNumberOfThreads, then this number is what the user required.

Returns
the number of threads used by default the next time we enter into a parallel region

Definition at line 66 of file threadsOMP.cpp.

66{ return _nb_threads_; }
static unsigned int _nb_threads_

References _nb_threads_.

Variable Documentation

◆ _nb_threads_

unsigned int gum::threadsOMP::_nb_threads_ {getMaxNumberOfThreads()}
static

Definition at line 62 of file threadsOMP.cpp.

unsigned int getMaxNumberOfThreads()
Returns the maximum number of threads that should be used at any time.

Referenced by getNumberOfThreads(), and setNumberOfThreads().