aGrUM  0.16.0
OMPThreads.h
Go to the documentation of this file.
1 
29 #ifndef GUM_OPEM_MP_THREADS_H
30 #define GUM_OPEM_MP_THREADS_H
31 
32 #ifdef _OPENMP
33 # include <omp.h>
34 #endif
35 
36 namespace gum {
37 
43  bool isOMP();
44 
53  void setNumberOfThreads(unsigned int number);
54 
68  unsigned int getMaxNumberOfThreads();
69 
77  unsigned int getThreadNumber();
78 
86  unsigned int getNumberOfRunningThreads();
87 
93  unsigned int getNumberOfLogicalProcessors();
94 
107  void setNestedParallelism(bool value);
108 
114  bool getNestedParallelism();
115 
128  void setDynamicThreadsNumber(bool value);
129 
137 } // namespace gum
138 
139 // include the inlined functions if necessary
140 #ifndef GUM_NO_INLINE
141 # include <agrum/core/OMPThreads_inl.h>
142 #endif /* GUM_NO_INLINE */
143 
144 #endif // GUM_OPEM_MP_THREADS_H
bool isOMP()
Is OMP active ?
unsigned int getNumberOfLogicalProcessors()
Get the number of logical processors.
unsigned int getNumberOfRunningThreads()
Get the current number of running threads.
unsigned int getThreadNumber()
Get the calling thread id.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool getDynamicThreadsNumber()
Get the dynamic thread number adjustment status.
void setNestedParallelism(bool value)
Set nested parallelism (false bu default).
unsigned int getMaxNumberOfThreads()
Returns the maximum number of threads at any time.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
bool getNestedParallelism()
Get nested parallelism status.
void setDynamicThreadsNumber(bool value)
Set the dynamic threads number (false by default).
void setNumberOfThreads(unsigned int number)
Set the number of threads to be used.