54 Loki::SingleThreaded> Type;
55 return Type::Instance();
124 m_mutex(), m_threadingType()
146 Loki::CreateUsingNew,
148 Loki::SingleThreaded> Type;
149 return Type::Instance();
165 "Tried to SetThreadingType when it was already set");
204 "Trying to create a ThreadManager before SetThreadingType called");
234 "Attempted to QueueJobs in ThreadDefaultManager");
244 "Attempted to QueueJob in ThreadDefaultManager");
272 "Attempted to SetNumWorkers to != 1 in ThreadDefaultManager");
309 "Attempted to SetChunkSize in ThreadDefaultManager");
319 "Attempted to SetSchedType in ThreadDefaultManager");
virtual unsigned int GetWorkerNum()
Returns the worker number of the executing thread.
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
virtual ~ThreadManager()
Destructor.
unsigned int GetWorkerNum()
virtual const std::string & GetType() const
Returns a description of the type of threading.
void SetWorkerNum(unsigned int num)
Set number of worker threads.
virtual unsigned int GetMaxNumWorkers()
Gets the maximum available number of threads.
virtual unsigned int GetNumWorkers()
Return the number of active workers.
virtual void Hold()
A calling threads holds until all active threads call this method.
ThreadManagerSharedPtr & GetInstance(const ThreadManagerName t)
Gets the ThreadManager associated with string s.
virtual void SetNumWorkers()
Sets the number of active workers to the maximum.
virtual void Wait()
Waits until all queued jobs are finished.
SchedType
Identifies the algorithm for scheduling.
virtual ~ThreadStartupManager()
ThreadJob()
Base constructor.
ThreadManagerFactory & GetThreadManagerFactory()
std::vector< ThreadManagerSharedPtr > m_threadManagers
std::string m_threadingType
ThreadStartupManager()
ThreadDefaultManager.
LibUtilities::NekFactory< std::string, ThreadManager, unsigned int > ThreadManagerFactory
virtual void QueueJob(ThreadJob *job)
Pass a single job to the master queue.
virtual void SetSchedType(SchedType s)
Sets the current scheduling algorithm.
ThreadMaster()
Constructor.
ThreadMaster & GetThreadMaster()
virtual void QueueJobs(std::vector< ThreadJob * > &joblist)
Pass a list of tasklets to the master queue.
virtual void SetChunkSize(unsigned int chnk)
Controls how many jobs are sent to each worker at a time.
ThreadManagerSharedPtr CreateInstance(const ThreadManagerName t, unsigned int nThr)
Creates an instance of a ThreadManager (which one is determined by a previous call to SetThreadingTyp...
Base class for tasks to be sent to the ThreadManager to run.
~ThreadMaster()
Destructor.
virtual bool InThread()
Indicates whether the code is in a worker thread or not.
virtual bool IsInitialised()
ThreadManager implementation.
void SetThreadingType(const std::string &p_type)
Sets what ThreadManagers will be created in CreateInstance.
virtual ~ThreadJob()
Base destructor.
virtual bool IsInitialised()
ThreadManager implementation.
Provides a generic Factory class.
boost::shared_ptr< ThreadManager > ThreadManagerSharedPtr