5 #include "CORE_Object.h"
29 static tInteger MAX_THREADS_NUMBER;
59 static inline CORE_UniquePointer<OMP_Thread>
New() {
88 else OMP_SET_THREADS_NUMBER(nThreads);
90 if (nUsedThreads<nThreads) {
91 std::cout<<
"Warning: OpenMP threads number wanted: "<<nThreads<<
", only "<<
GetThreadsNumber()<<
" available ! ";
96 std::cout<<
"Warning: memory checked is forced to be disabled because of multi-threadings ";
107 return OMP_IS_ENABLED();
118 return OMP_GET_THREAD_ID();
126 OMP_PARALLEL_SHARED((n)) {
127 if (OMP_GET_THREAD_ID()==0) {
128 n=OMP_GET_THREADS_NUMBER();
138 return MAX_THREADS_NUMBER;
146 return OMP_GET_TIME();
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
abstract base class for most classes.
Definition: CORE_Object.h:65
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
static void DisableMemoryStack()
disable the memory stack
Definition: CORE_Object.h:200
static tBoolean IsMemoryStackEnabled()
return trur if the memory stack is enabled
Definition: CORE_Object.h:209
This class is an list of options.
Definition: CORE_OptionsList.h:36
tBoolean getOptionValue(const tString &optName, tString &optValue) const
get the option value
Definition: CORE_OptionsList.h:334
This class describes an Open MP process.
Definition: OMP_Thread.h:24
static tInteger SetThreadsOptions(const CORE_OptionsList &options)
set the threads data from the options
Definition: OMP_Thread.h:159
static CORE_UniquePointer< OMP_Thread > New()
create an instance of thread
Definition: OMP_Thread.h:59
static const tInteger & GetMaxThreadsNumber()
get the max threads number
Definition: OMP_Thread.h:137
static tBoolean IsOpenMPMultiThreaded()
return true if the program is multithreaded by OpenMP
Definition: OMP_Thread.h:106
virtual ~OMP_Thread(void)
destroy an object.
Definition: OMP_Thread.h:50
static void SetThreadsNumber(const tIndex &nThreads)
set the number of threads
Definition: OMP_Thread.h:86
static tInteger GetThreadId()
get the thread id
Definition: OMP_Thread.h:117
static tULLInt GetTime()
get time
Definition: OMP_Thread.h:145
static tULLInt GetDuration(const tULLInt &startTime)
get duration
Definition: OMP_Thread.h:151
OMP_Thread(void)
create an object
Definition: OMP_Thread.h:40
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: OMP_Thread.h:77
static tInteger GetThreadsNumber()
get the threads number
Definition: OMP_Thread.h:124