eq::Node Class Reference

A Node represents a single computer in the cluster. More...

#include <node.h>

Inheritance diagram for eq::Node:
Inheritance graph
[legend]
Collaboration diagram for eq::Node:
Collaboration graph
[legend]

List of all members.

Classes

class  TransmitThread

Public Member Functions

 Node (Config *parent)
 Constructs a new node.
virtual ~Node ()
 Destructs the node.
ConfiggetConfig ()
 Returns the config of this node.
const ConfiggetConfig () const
ClientPtr getClient ()
ServerPtr getServer ()
const PipeVectorgetPipes () const
const std::string & getName () const
uint32_t getTasks () const
 Return the set of tasks this nodes's channels might execute in the worst case.
CommandQueuegetNodeThreadQueue ()
VisitorResult accept (NodeVisitor &visitor)
 Traverse this node and all children using a node visitor.
VisitorResult accept (NodeVisitor &visitor) const
 Const-version of accept().
net::BarriergetBarrier (const net::ObjectVersion barrier)
 Get a network barrier.
FrameDatagetFrameData (const net::ObjectVersion &dataVersion)
 Get a frame data instance.
void waitInitialized () const
 Wait for the node to be initialized.
bool isRunning () const
void waitFrameStarted (const uint32_t frameNumber) const
 Wait for a frame to be started.
uint32_t getFinishedFrame () const

Public Attributes

TransmitThread transmitter
char dummy [64]

Protected Member Functions

virtual void attachToSession (const uint32_t id, const uint32_t instanceID, net::Session *session)
 Called when object is attached to session.
Actions



void startFrame (const uint32_t frameNumber)
 Start a frame by unlocking all child resources.
void releaseFrame (const uint32_t frameNumber)
 Signal the completion of a frame to the parent.
void releaseFrameLocal (const uint32_t frameNumber)
 Release the local synchronization of the parent for a frame.
Callbacks

The callbacks are called by Equalizer during rendering to execute various actions.



virtual bool configInit (const uint32_t initID)
 Initialises this node.
virtual bool configExit ()
 Exit this node.
virtual void frameStart (const uint32_t frameID, const uint32_t frameNumber)
 Start rendering a frame.
virtual void frameFinish (const uint32_t frameID, const uint32_t frameNumber)
 Finish rendering a frame.
virtual void frameDrawFinish (const uint32_t frameID, const uint32_t frameNumber)
 Finish drawing.
virtual void frameTasksFinish (const uint32_t frameID, const uint32_t frameNumber)
 Finish all rendering tasks.
Error information.



void setErrorMessage (const std::string &message)
 Set a message why the last operation failed.

Friends

class Config
class Pipe

Attributes



enum  IAttribute {
  IATTR_THREAD_MODEL, IATTR_LAUNCH_TIMEOUT, IATTR_FILL1, IATTR_FILL2,
  IATTR_ALL
}
 

Node attributes.

More...
void setIAttribute (const IAttribute attr, const int32_t value)
int32_t getIAttribute (const IAttribute attr) const
static const std::string & getIAttributeString (const IAttribute attr)

Detailed Description

A Node represents a single computer in the cluster.

Each node is executed in a seperate process.

Definition at line 39 of file lib/client/node.h.


Member Enumeration Documentation

Node attributes.

Enumerator:
IATTR_THREAD_MODEL 

Threading model

IATTR_LAUNCH_TIMEOUT 

Launch timeout.

Definition at line 125 of file lib/client/node.h.


Constructor & Destructor Documentation

eq::Node::Node ( Config parent  ) 

Constructs a new node.

Reimplemented in eqNbody::Node, eqPly::Node, and eVolve::Node.

Definition at line 60 of file lib/client/node.cpp.

References EQINFO.

eq::Node::~Node (  )  [virtual]

Destructs the node.

Reimplemented in eqNbody::Node, eqPly::Node, and eVolve::Node.

Definition at line 72 of file lib/client/node.cpp.

References EQINFO.


Member Function Documentation

Config* eq::Node::getConfig (  )  [inline]

Returns the config of this node.

Returns:
the config of this node.

Definition at line 53 of file lib/client/node.h.

Referenced by eqPly::Node::configExit(), eqNbody::Node::configExit(), eVolve::Node::configInit(), eqPly::Node::configInit(), eqNbody::Node::configInit(), and releaseFrameLocal().

Here is the caller graph for this function:

uint32_t eq::Node::getTasks (  )  const [inline]

Return the set of tasks this nodes's channels might execute in the worst case.

It is not guaranteed that all the tasks will be actually executed during rendering.

Warning:
Not finalized, might change in the future.
Returns:
a bitwise combination of the Task enum.

Definition at line 72 of file lib/client/node.h.

VisitorResult eq::Node::accept ( NodeVisitor visitor  ) 

Traverse this node and all children using a node visitor.

Parameters:
visitor the visitor.
Returns:
the result of the visitor traversal.

Definition at line 167 of file lib/client/node.cpp.

VisitorResult eq::Node::accept ( NodeVisitor visitor  )  const

Const-version of accept().

Definition at line 172 of file lib/client/node.cpp.

net::Barrier * eq::Node::getBarrier ( const net::ObjectVersion  barrier  ) 

Get a network barrier.

Parameters:
barrier the barrier identifier and version.
Returns:
the barrier.

For internal use only.

Definition at line 203 of file lib/client/node.cpp.

References eq::net::Object::getSession(), eq::net::Object::makeThreadSafe(), eq::net::Session::mapObject(), eq::base::Lock::set(), eq::net::Object::sync(), and eq::base::Lock::unset().

Here is the call graph for this function:

FrameData * eq::Node::getFrameData ( const net::ObjectVersion dataVersion  ) 

Get a frame data instance.

Parameters:
dataVersion the frame data identifier and version.
Returns:
the frame.

For internal use only.

Definition at line 224 of file lib/client/node.cpp.

References eq::net::Object::getSession(), eq::net::Object::getVersion(), eq::net::Object::makeThreadSafe(), eq::net::Session::mapObject(), eq::base::Lock::set(), eq::net::Object::sync(), eq::base::Lock::unset(), and eq::FrameData::update().

Referenced by eq::Pipe::getFrame().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Node::waitInitialized (  )  const

Wait for the node to be initialized.

Definition at line 251 of file lib/client/node.cpp.

References eq::base::Monitor< T >::waitGE().

Here is the call graph for this function:

void eq::Node::waitFrameStarted ( const uint32_t  frameNumber  )  const

Wait for a frame to be started.

Parameters:
frameNumber the frame number.
See also:
releaseFrame()

Definition at line 285 of file lib/client/node.cpp.

References eq::base::Monitor< T >::waitGE().

Referenced by eq::Pipe::frameStart().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Node::attachToSession ( const uint32_t  id,
const uint32_t  instanceID,
net::Session session 
) [protected, virtual]

Called when object is attached to session.

For internal use only.

Reimplemented from eq::net::Object.

Definition at line 79 of file lib/client/node.cpp.

References eq::Config::getNodeThreadQueue(), and eq::net::Dispatcher::registerCommand().

Here is the call graph for this function:

void eq::Node::startFrame ( const uint32_t  frameNumber  )  [protected]

Start a frame by unlocking all child resources.

Parameters:
frameNumber the frame to start.

Definition at line 290 of file lib/client/node.cpp.

Referenced by frameStart().

Here is the caller graph for this function:

void eq::Node::releaseFrame ( const uint32_t  frameNumber  )  [protected]

Signal the completion of a frame to the parent.

Parameters:
frameNumber the frame to end.

Definition at line 327 of file lib/client/node.cpp.

References eq::base::RefPtr< T >::get(), eq::Config::getServer(), and eq::net::Object::send().

Referenced by frameFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Node::releaseFrameLocal ( const uint32_t  frameNumber  )  [protected]

Release the local synchronization of the parent for a frame.

Parameters:
frameNumber the frame to release.

Definition at line 344 of file lib/client/node.cpp.

References EQLOG, getConfig(), eq::Config::getNodes(), eq::LOG_TASKS, and eq::Config::releaseFrameLocal().

Referenced by frameDrawFinish(), frameStart(), and frameTasksFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Node::configInit ( const uint32_t  initID  )  [protected, virtual]

Initialises this node.

Parameters:
initID the init identifier.

Reimplemented in eqNbody::Node, eqPly::Node, and eVolve::Node.

Definition at line 261 of file lib/client/node.cpp.

References eq::AGLEventHandler::initMagellan().

Referenced by eVolve::Node::configInit(), eqPly::Node::configInit(), and eqNbody::Node::configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Node::frameStart ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Start rendering a frame.

Called once at the beginning of each frame, to start the node's frame and to do per-frame updates of node-specific data. This method has to call startFrame(). Immediately releases local synchronization if the thread model is async.

Parameters:
frameID the per-frame identifier.
frameNumber the frame to start.
See also:
startFrame(), Config::beginFrame()

Definition at line 357 of file lib/client/node.cpp.

References eq::ASYNC, eq::DRAW_SYNC, IATTR_THREAD_MODEL, eq::LOCAL_SYNC, releaseFrameLocal(), and startFrame().

Here is the call graph for this function:

virtual void eq::Node::frameFinish ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [inline, protected, virtual]

Finish rendering a frame.

Called once at the end of each frame, to end the frame and to do per-frame updates of node-specific data. This method has to call releaseFrame().

Parameters:
frameID the per-frame identifier.
frameNumber the frame to finish.
See also:
endFrame(), Config::finishFrame()

Definition at line 248 of file lib/client/node.h.

References releaseFrame().

Here is the call graph for this function:

void eq::Node::frameDrawFinish ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish drawing.

Called once per frame after the last draw operation. Waits for the pipes to release the local synchonization and releases the node's local synchronization if the thread model is draw_sync (the default).

Parameters:
frameID the per-frame identifier.
frameNumber the frame finished with draw.
See also:
Pipe::waitFrameLocal(), releaseFrameLocal()

Definition at line 377 of file lib/client/node.cpp.

References eq::ASYNC, eq::DRAW_SYNC, eq::Pipe::getTasks(), IATTR_THREAD_MODEL, eq::LOCAL_SYNC, releaseFrameLocal(), eq::TASK_DRAW, and eq::Pipe::waitFrameLocal().

Here is the call graph for this function:

void eq::Node::frameTasksFinish ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish all rendering tasks.

Called once per frame after all frame tasks. Waits for the pipes to release the local synchonization and releases the node's local synchronization if the thread model is local_sync.

Note that frameFinish is called after the latency is exhausted and synchronizes pipe thread execution.

Parameters:
frameID the per-frame identifier.
frameNumber the frame finished with draw.
See also:
Pipe::waitFrameLocal(), releaseFrameLocal()

Definition at line 402 of file lib/client/node.cpp.

References eq::ASYNC, eq::DRAW_SYNC, eq::Pipe::getTasks(), IATTR_THREAD_MODEL, eq::LOCAL_SYNC, releaseFrameLocal(), and eq::Pipe::waitFrameLocal().

Here is the call graph for this function:

void eq::Node::setErrorMessage ( const std::string &  message  )  [protected]

Set a message why the last operation failed.

The message will be transmitted to the originator of the request, for example to Config::init when set from within the init method.

Parameters:
message the error message.

Definition at line 427 of file lib/client/node.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:05:42 2010 for Equalizer 0.9.1 by  doxygen 1.6.1