Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::RemoteWorker Class Reference

Acquires work from the scheduler and forwards it to a processing node reachable through a Stream. More...

#include <mitsuba/core/sched_remote.h>

+ Inheritance diagram for mitsuba::RemoteWorker:

Public Member Functions

 RemoteWorker (const std::string &name, Stream *stream)
 Construct a new remote worker with the given name and communication stream. More...
 
const std::string & getNodeName () const
 Return the name of the node on the other side. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::Worker
size_t getCoreCount () const
 Return the number of cores exposed by this worker. More...
 
bool isRemoteWorker () const
 Is this a remote worker? More...
 
- Public Member Functions inherited from mitsuba::Thread
 Thread (const std::string &name)
 Create a new thread object. More...
 
bool setPriority (EThreadPriority priority)
 Set the thread priority. More...
 
EThreadPriority getPriority () const
 Return the thread priority. More...
 
void setCoreAffinity (int core)
 Set the core affinity. More...
 
int getCoreAffinity () const
 Return the core affinity. More...
 
void setCritical (bool critical)
 Specify whether or not this thread is critical. More...
 
bool getCritical () const
 Return the value of the critical flag. More...
 
const std::string & getName () const
 Return the name of this thread. More...
 
void setName (const std::string &name)
 Set the name of this thread. More...
 
ThreadgetParent ()
 Return the parent thread. More...
 
const ThreadgetParent () const
 Return the parent thread (const version) More...
 
void setLogger (Logger *logger)
 Set the logger instance used to process log messages from this thread. More...
 
LoggergetLogger ()
 Return the thread's logger instance. More...
 
void setFileResolver (FileResolver *fresolver)
 Set the thread's file resolver. More...
 
FileResolvergetFileResolver ()
 Return the thread's file resolver. More...
 
bool isRunning () const
 Is this thread still running? More...
 
void start ()
 Start the thread. More...
 
void detach ()
 Detach the thread and release resources. More...
 
void join ()
 Wait until the thread finishes. More...
 
virtual std::string toString () const
 Return a string representation. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Worker
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Thread
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

virtual ~RemoteWorker ()
 Virtual destructor. More...
 
virtual void run ()
 The thread's run method. More...
 
virtual void clear ()
 
virtual void signalResourceExpiration (int id)
 Called to inform a worker that a resource is no longer in use. More...
 
virtual void signalProcessCancellation (int id)
 Called to inform a worker that a process has been cancelled. More...
 
virtual void signalProcessTermination (int id)
 Called to inform a worker that a process has successfully been completed and any associated resources can be freed. More...
 
virtual void start (Scheduler *scheduler, int workerIndex, int coreOffset)
 Used internally by the scheduler. More...
 
void flush ()
 
void signalCompletion ()
 
- Protected Member Functions inherited from mitsuba::Worker
virtual ~Worker ()
 Virtual destructor. More...
 
 Worker (const std::string &name)
 Protected constructor. More...
 
Scheduler::EStatus acquireWork (bool local, bool onlyTry=false, bool keepLock=false)
 
void releaseSchedulerLock ()
 
void releaseWork (Scheduler::Item &item)
 Release a processed work unit. More...
 
void setProcessByID (Scheduler::Item &item, int id)
 Initialize the m_schedItem data structure when only the process ID is known. More...
 
void cancel (bool reduceInflight)
 
- Protected Member Functions inherited from mitsuba::Thread
virtual ~Thread ()
 Virtual destructor. More...
 
void exit ()
 
void yield ()
 Yield to another processor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

ref< Mutexm_mutex
 
ref< ConditionVariablem_finishCond
 
ref< MemoryStreamm_memStream
 
ref< Streamm_stream
 
ref< RemoteWorkerReaderm_reader
 
std::set< int > m_resources
 
std::set< int > m_processes
 
std::set< std::string > m_plugins
 
std::string m_nodeName
 
size_t m_inFlight
 
- Protected Attributes inherited from mitsuba::Worker
Schedulerm_scheduler
 
Scheduler::Item m_schedItem
 
size_t m_coreCount
 
bool m_isRemote
 

Friends

class RemoteWorkerReader
 

Additional Inherited Members

- Public Types inherited from mitsuba::Thread
enum  EThreadPriority {
  EIdlePriority = 0, ELowestPriority, ELowPriority, ENormalPriority,
  EHighPriority, EHighestPriority, ERealtimePriority
}
 Possible priority values for Thread::setPriority() More...
 
- Static Public Member Functions inherited from mitsuba::Thread
static int getID ()
 Return the thread ID. More...
 
static ThreadgetThread ()
 Return the current thread. More...
 
static void sleep (unsigned int ms)
 Sleep for a certain amount of time. More...
 
static void staticInitialization ()
 Initialize the threading system. More...
 
static void staticShutdown ()
 Shut down the threading system. More...
 
static void initializeOpenMP (size_t threadCount)
 Initialize Mitsuba's threading system for simultaneous use of OpenMP. More...
 
static ThreadregisterUnmanagedThread (const std::string &name)
 Register an unmanaged thread with Mitsuba (i.e. one that doesn't derive from mitsuba::Thread) More...
 
static void registerCrashHandler (bool(*handler)(void))
 Register a thread crash handler. More...
 
- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 
- Static Protected Member Functions inherited from mitsuba::Thread
static void dispatch (Thread *thread)
 Thread dispatch function. More...
 

Detailed Description

Acquires work from the scheduler and forwards it to a processing node reachable through a Stream.

Constructor & Destructor Documentation

mitsuba::RemoteWorker::RemoteWorker ( const std::string &  name,
Stream stream 
)

Construct a new remote worker with the given name and communication stream.

virtual mitsuba::RemoteWorker::~RemoteWorker ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual void mitsuba::RemoteWorker::clear ( )
protectedvirtual

Reimplemented from mitsuba::Worker.

void mitsuba::RemoteWorker::flush ( )
protected
virtual const Class* mitsuba::RemoteWorker::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::Worker.

const std::string& mitsuba::RemoteWorker::getNodeName ( ) const
inline

Return the name of the node on the other side.

virtual void mitsuba::RemoteWorker::run ( )
protectedvirtual

The thread's run method.

Implements mitsuba::Thread.

void mitsuba::RemoteWorker::signalCompletion ( )
inlineprotected
virtual void mitsuba::RemoteWorker::signalProcessCancellation ( int  id)
protectedvirtual

Called to inform a worker that a process has been cancelled.

Guaranteed to be called while the Scheduler's main lock is held.

Implements mitsuba::Worker.

virtual void mitsuba::RemoteWorker::signalProcessTermination ( int  id)
protectedvirtual

Called to inform a worker that a process has successfully been completed and any associated resources can be freed.

Implements mitsuba::Worker.

virtual void mitsuba::RemoteWorker::signalResourceExpiration ( int  id)
protectedvirtual

Called to inform a worker that a resource is no longer in use.

The remote worker uses this to notify the machine on the other end that the memory used by this resource can now be released.

Implements mitsuba::Worker.

virtual void mitsuba::RemoteWorker::start ( Scheduler scheduler,
int  workerIndex,
int  coreOffset 
)
protectedvirtual

Used internally by the scheduler.

Reimplemented from mitsuba::Worker.

Friends And Related Function Documentation

friend class RemoteWorkerReader
friend

Member Data Documentation

ref<ConditionVariable> mitsuba::RemoteWorker::m_finishCond
protected
size_t mitsuba::RemoteWorker::m_inFlight
protected
ref<MemoryStream> mitsuba::RemoteWorker::m_memStream
protected
ref<Mutex> mitsuba::RemoteWorker::m_mutex
protected
std::string mitsuba::RemoteWorker::m_nodeName
protected
std::set<std::string> mitsuba::RemoteWorker::m_plugins
protected
std::set<int> mitsuba::RemoteWorker::m_processes
protected
ref<RemoteWorkerReader> mitsuba::RemoteWorker::m_reader
protected
std::set<int> mitsuba::RemoteWorker::m_resources
protected
ref<Stream> mitsuba::RemoteWorker::m_stream
protected
Class* mitsuba::RemoteWorker::m_theClass
static

The documentation for this class was generated from the following file: