View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vistle::Module Class Reference

#include <module/module.h>

Inheritance diagram for vistle::Module:
Inheritance graph
[legend]
Collaboration diagram for vistle::Module:
Collaboration graph
[legend]

Public Member Functions

 Module (const std::string &name, const int moduleID, mpi::communicator comm)
 
virtual ~Module ()
 
virtual void eventLoop ()
 
void initDone ()
 
virtual bool dispatch (bool block=true, bool *messageReceived=nullptr)
 
ParameteraddParameterGeneric (const std::string &name, std::shared_ptr< Parameter > parameter) override
 
bool removeParameter (Parameter *param) override
 
const std::string & name () const
 
const mpi::communicator & comm () const
 
const mpi::communicator & commShmGroup () const
 
int rank () const
 
int size () const
 
int shmLeader (int rank=-1) const
 
int id () const
 
unsigned hardware_concurrency () const
 
ObjectCache::CacheMode setCacheMode (ObjectCache::CacheMode mode, bool update=true)
 
ObjectCache::CacheMode cacheMode () const
 
PortcreateInputPort (const std::string &name, const std::string &description="", const int flags=0)
 
PortcreateOutputPort (const std::string &name, const std::string &description="", const int flags=0)
 
bool destroyPort (const std::string &portName)
 
bool destroyPort (const Port *port)
 
bool sendObject (const mpi::communicator &comm, vistle::Object::const_ptr object, int destRank) const
 
bool sendObject (vistle::Object::const_ptr object, int destRank) const
 
vistle::Object::const_ptr receiveObject (const mpi::communicator &comm, int destRank) const
 
vistle::Object::const_ptr receiveObject (int destRank) const
 
bool broadcastObject (const mpi::communicator &comm, vistle::Object::const_ptr &object, int root) const
 
bool broadcastObject (vistle::Object::const_ptr &object, int root) const
 
bool broadcastObjectViaShm (vistle::Object::const_ptr &object, const std::string &objName, int root) const
 
bool addObject (Port *port, vistle::Object::ptr object)
 
bool addObject (const std::string &portName, vistle::Object::ptr object)
 
bool passThroughObject (Port *port, vistle::Object::const_ptr object)
 
bool passThroughObject (const std::string &portName, vistle::Object::const_ptr object)
 
ObjectList getObjects (const std::string &portName)
 
bool hasObject (const Port *port) const
 
bool hasObject (const std::string &portName) const
 
vistle::Object::const_ptr takeFirstObject (Port *port)
 
vistle::Object::const_ptr takeFirstObject (const std::string &portName)
 
template<class Type >
Type::const_ptr accept (Port *port)
 
template<class Type >
Type::const_ptr accept (const std::string &port)
 
template<class Interface >
const Interface * acceptInterface (Port *port)
 
template<class Interface >
const Interface * acceptInterface (const std::string &port)
 
template<class Type >
Type::const_ptr expect (Port *port)
 
template<class Type >
Type::const_ptr expect (const std::string &port)
 
void requestPortMapping (unsigned short forwardPort, unsigned short localPort)
 request hub to forward incoming connections on forwardPort to be forwarded to localPort More...
 
void removePortMapping (unsigned short forwardPort)
 remove port forwarding requested by requestPortMapping More...
 
void sendParameterMessage (const message::Message &message, const buffer *payload) const override
 
bool sendMessage (const message::Message &message, const buffer *payload=nullptr) const override
 
bool sendMessage (const message::Message &message, const MessagePayload &payload) const override
 
template<class Payload >
bool sendMessageWithPayload (message::Message &message, Payload &payload) const
 
void sendText (int type, const std::string &msg) const
 type should be a message::SendText::TextType More...
 
void sendInfo (const char *fmt,...) const
 send info message to UI - printf style More...
 
void sendWarning (const char *fmt,...) const
 send warning message to UI - printf style More...
 
void sendError (const char *fmt,...) const
 send error message to UI - printf style More...
 
void sendError (const message::Message &msg, const char *fmt,...) const
 send response message to UI - printf style More...
 
void sendInfo (const std::string &text) const
 send info message to UI - string style More...
 
void sendWarning (const std::string &text) const
 send warning message to UI - string style More...
 
void sendError (const std::string &text) const
 send error message to UI - string style More...
 
void sendError (const message::Message &msg, const std::string &text) const
 send response message to UI - string style More...
 
int schedulingPolicy () const
 
void setSchedulingPolicy (int schedulingPolicy)
 
int reducePolicy () const
 
void setReducePolicy (int reduceRequirement)
 
virtual void prepareQuit ()
 
const HubDatagetHub () const
 
bool isConnected (const Port &port) const
 
bool isConnected (const std::string &portname) const
 
std::string getModuleName (int id) const
 
int mirrorId () const
 
std::set< int > getMirrors () const
 
template<>
V_MODULEEXPORT Object::const_ptr expect (Port *port)
 
template<>
Object::const_ptr expect (Port *port)
 
- Public Member Functions inherited from vistle::ParameterManager
 ParameterManager (const std::string &name, int id)
 
virtual ~ParameterManager ()
 
void setCurrentParameterGroup (const std::string &group=std::string())
 set group for all subsequently added parameters, reset with empty group More...
 
const std::string & currentParameterGroup () const
 
bool updateParameter (const std::string &name, const Parameter *parameter, const message::SetParameter *inResponseTo, Parameter::RangeType rt=Parameter::Value)
 
template<class T >
ParameteraddParameter (const std::string &name, const std::string &description, const T &value, Parameter::Presentation presentation=Parameter::Generic)
 
template<class T >
bool setParameter (const std::string &name, const T &value, const message::SetParameter *inResponseTo=nullptr)
 
template<class T >
bool setParameter (ParameterBase< T > *param, const T &value, const message::SetParameter *inResponseTo=nullptr)
 
template<class T >
bool setParameterMinimum (ParameterBase< T > *param, const T &minimum)
 
template<class T >
bool setParameterMaximum (ParameterBase< T > *param, const T &maximum)
 
template<class T >
bool setParameterRange (const std::string &name, const T &minimum, const T &maximum)
 
template<class T >
bool setParameterRange (ParameterBase< T > *param, const T &minimum, const T &maximum)
 
template<class T >
bool getParameter (const std::string &name, T &value) const
 
void setParameterChoices (const std::string &name, const std::vector< std::string > &choices)
 
void setParameterChoices (Parameter *param, const std::vector< std::string > &choices)
 
void setParameterFilters (const std::string &name, const std::string &filters)
 
void setParameterFilters (StringParameter *param, const std::string &filters)
 
StringParameter * addStringParameter (const std::string &name, const std::string &description, const std::string &value, Parameter::Presentation p=Parameter::Generic)
 
bool setStringParameter (const std::string &name, const std::string &value, const message::SetParameter *inResponseTo=NULL)
 
std::string getStringParameter (const std::string &name) const
 
FloatParameter * addFloatParameter (const std::string &name, const std::string &description, const Float value)
 
bool setFloatParameter (const std::string &name, const Float value, const message::SetParameter *inResponseTo=NULL)
 
Float getFloatParameter (const std::string &name) const
 
IntParameter * addIntParameter (const std::string &name, const std::string &description, const Integer value, Parameter::Presentation p=Parameter::Generic)
 
bool setIntParameter (const std::string &name, const Integer value, const message::SetParameter *inResponseTo=NULL)
 
Integer getIntParameter (const std::string &name) const
 
VectorParameter * addVectorParameter (const std::string &name, const std::string &description, const ParamVector &value)
 
bool setVectorParameter (const std::string &name, const ParamVector &value, const message::SetParameter *inResponseTo=NULL)
 
ParamVector getVectorParameter (const std::string &name) const
 
IntVectorParameter * addIntVectorParameter (const std::string &name, const std::string &description, const IntParamVector &value)
 
bool setIntVectorParameter (const std::string &name, const IntParamVector &value, const message::SetParameter *inResponseTo=NULL)
 
IntParamVector getIntVectorParameter (const std::string &name) const
 
bool removeParameter (const std::string &name)
 
std::shared_ptr< ParameterfindParameter (const std::string &name) const
 
void init ()
 
void quit ()
 
bool handleMessage (const message::SetParameter &message)
 
template<class Payload >
void sendParameterMessageWithPayload (message::Message &message, Payload &payload)
 
virtual bool changeParameters (std::set< const Parameter * > params)
 
void setId (int id)
 
int id () const
 
void setName (const std::string &name)
 
void applyDelayedChanges ()
 
- Public Member Functions inherited from vistle::MessageSender
virtual ~MessageSender ()
 

Static Public Member Functions

static bool setup (const std::string &shmname, int moduleID, int rank)
 

Protected Member Functions

void setObjectReceivePolicy (int pol)
 
int objectReceivePolicy () const
 
void startIteration ()
 
void setDefaultCacheMode (ObjectCache::CacheMode mode)
 
void updateMeta (vistle::Object::ptr object) const
 
virtual bool handleMessage (const message::Message *message, const vistle::MessagePayload &payload)
 
virtual bool handleExecute (const message::Execute *exec)
 
bool cancelRequested (bool collective=false)
 
bool wasCancelRequested () const
 
virtual void cancelExecuteMessageReceived (const message::Message *msg)
 
virtual bool addInputObject (int sender, const std::string &senderPort, const std::string &portName, Object::const_ptr object)
 
virtual bool objectAdded (int sender, const std::string &senderPort, const Port *port)
 
bool syncMessageProcessing () const
 
void setSyncMessageProcessing (bool sync)
 
virtual void connectionAdded (const Port *from, const Port *to)
 
virtual void connectionRemoved (const Port *from, const Port *to)
 
bool changeParameter (const Parameter *p) override
 
int openmpThreads () const
 
void setOpenmpThreads (int, bool updateParam=true)
 
void enableBenchmark (bool benchmark, bool updateParam=true)
 
virtual bool prepare ()
 
virtual bool reduce (int timestep)
 
virtual bool cancelExecute ()
 
int numTimesteps () const
 
void setStatus (const std::string &text, message::UpdateStatus::Importance prio=message::UpdateStatus::Low)
 
void clearStatus ()
 
bool getNextMessage (message::Buffer &buf, bool block=true)
 
bool reduceWrapper (const message::Execute *exec, bool reordered=false)
 
bool prepareWrapper (const message::Execute *exec)
 

Protected Attributes

const std::string m_name
 
int m_rank
 
int m_size
 
const int m_id
 
int m_executionCount
 
int m_iteration
 
std::set< Port * > m_withOutput
 
message::MessageQueuesendMessageQueue
 
message::MessageQueuereceiveMessageQueue
 
std::deque< message::BuffermessageBacklog
 

Friends

class Reader
 
class Renderer
 
class PortTask
 

Constructor & Destructor Documentation

◆ Module()

Module::Module ( const std::string &  name,
const int  moduleID,
mpi::communicator  comm 
)

◆ ~Module()

Module::~Module ( )
virtual

Member Function Documentation

◆ accept() [1/2]

template<class Type >
Type::const_ptr Module::accept ( const std::string &  port)

◆ accept() [2/2]

template<class Type >
Type::const_ptr Module::accept ( Port port)

◆ acceptInterface() [1/2]

template<class Interface >
const Interface * vistle::Module::acceptInterface ( const std::string &  port)

◆ acceptInterface() [2/2]

template<class Interface >
const Interface * vistle::Module::acceptInterface ( Port port)

◆ addInputObject()

bool Module::addInputObject ( int  sender,
const std::string &  senderPort,
const std::string &  portName,
Object::const_ptr  object 
)
protectedvirtual

◆ addObject() [1/2]

bool Module::addObject ( const std::string &  portName,
vistle::Object::ptr  object 
)

◆ addObject() [2/2]

bool Module::addObject ( Port port,
vistle::Object::ptr  object 
)

◆ addParameterGeneric()

Parameter * Module::addParameterGeneric ( const std::string &  name,
std::shared_ptr< Parameter parameter 
)
overridevirtual

Reimplemented from vistle::ParameterManager.

◆ broadcastObject() [1/2]

bool Module::broadcastObject ( const mpi::communicator &  comm,
vistle::Object::const_ptr object,
int  root 
) const

◆ broadcastObject() [2/2]

bool Module::broadcastObject ( vistle::Object::const_ptr object,
int  root 
) const

◆ broadcastObjectViaShm()

bool Module::broadcastObjectViaShm ( vistle::Object::const_ptr object,
const std::string &  objName,
int  root 
) const

◆ cacheMode()

ObjectCache::CacheMode Module::cacheMode ( ) const

◆ cancelExecute()

bool Module::cancelExecute ( )
protectedvirtual

◆ cancelExecuteMessageReceived()

void Module::cancelExecuteMessageReceived ( const message::Message msg)
protectedvirtual

◆ cancelRequested()

bool Module::cancelRequested ( bool  collective = false)
protected

◆ changeParameter()

bool Module::changeParameter ( const Parameter p)
overrideprotectedvirtual

Reimplemented from vistle::ParameterManager.

Reimplemented in vistle::Reader.

◆ clearStatus()

void Module::clearStatus ( )
protected

◆ comm()

const mpi::communicator & Module::comm ( ) const

◆ commShmGroup()

const mpi::communicator & Module::commShmGroup ( ) const

◆ connectionAdded()

void Module::connectionAdded ( const Port from,
const Port to 
)
protectedvirtual

◆ connectionRemoved()

void Module::connectionRemoved ( const Port from,
const Port to 
)
protectedvirtual

◆ createInputPort()

Port * Module::createInputPort ( const std::string &  name,
const std::string &  description = "",
const int  flags = 0 
)

◆ createOutputPort()

Port * Module::createOutputPort ( const std::string &  name,
const std::string &  description = "",
const int  flags = 0 
)

◆ destroyPort() [1/2]

bool Module::destroyPort ( const Port port)

◆ destroyPort() [2/2]

bool Module::destroyPort ( const std::string &  portName)

◆ dispatch()

bool Module::dispatch ( bool  block = true,
bool *  messageReceived = nullptr 
)
virtual

◆ enableBenchmark()

void Module::enableBenchmark ( bool  benchmark,
bool  updateParam = true 
)
protected

◆ eventLoop()

void Module::eventLoop ( )
virtual

◆ expect() [1/4]

template<class Type >
Type::const_ptr Module::expect ( const std::string &  port)

◆ expect() [2/4]

template<>
Object::const_ptr vistle::Module::expect ( Port port)

◆ expect() [3/4]

template<class Type >
Type::const_ptr Module::expect ( Port port)

◆ expect() [4/4]

template<>
V_MODULEEXPORT Object::const_ptr vistle::Module::expect ( Port port)

◆ getHub()

const HubData & Module::getHub ( ) const

◆ getMirrors()

std::set< int > Module::getMirrors ( ) const

◆ getModuleName()

std::string Module::getModuleName ( int  id) const

◆ getNextMessage()

bool Module::getNextMessage ( message::Buffer buf,
bool  block = true 
)
protected

◆ getObjects()

ObjectList Module::getObjects ( const std::string &  portName)

◆ handleExecute()

bool Module::handleExecute ( const message::Execute exec)
protectedvirtual

◆ handleMessage()

bool Module::handleMessage ( const message::Message message,
const vistle::MessagePayload payload 
)
protectedvirtual

◆ hardware_concurrency()

unsigned Module::hardware_concurrency ( ) const

◆ hasObject() [1/2]

bool Module::hasObject ( const Port port) const

◆ hasObject() [2/2]

bool Module::hasObject ( const std::string &  portName) const

◆ id()

int Module::id ( ) const

◆ initDone()

void Module::initDone ( )

◆ isConnected() [1/2]

bool Module::isConnected ( const Port port) const

◆ isConnected() [2/2]

bool Module::isConnected ( const std::string &  portname) const

◆ mirrorId()

int Module::mirrorId ( ) const

◆ name()

const std::string & Module::name ( ) const

◆ numTimesteps()

int Module::numTimesteps ( ) const
protected

◆ objectAdded()

bool Module::objectAdded ( int  sender,
const std::string &  senderPort,
const Port port 
)
protectedvirtual

◆ objectReceivePolicy()

int Module::objectReceivePolicy ( ) const
protected

◆ openmpThreads()

int Module::openmpThreads ( ) const
protected

◆ passThroughObject() [1/2]

bool Module::passThroughObject ( const std::string &  portName,
vistle::Object::const_ptr  object 
)

◆ passThroughObject() [2/2]

bool Module::passThroughObject ( Port port,
vistle::Object::const_ptr  object 
)

◆ prepare()

bool Module::prepare ( )
protectedvirtual

◆ prepareQuit()

void Module::prepareQuit ( )
virtual

Reimplemented in vistle::Reader.

◆ prepareWrapper()

bool Module::prepareWrapper ( const message::Execute exec)
protected

◆ rank()

int Module::rank ( ) const

◆ receiveObject() [1/2]

Object::const_ptr Module::receiveObject ( const mpi::communicator &  comm,
int  destRank 
) const

◆ receiveObject() [2/2]

Object::const_ptr Module::receiveObject ( int  destRank) const

◆ reduce()

bool Module::reduce ( int  timestep)
protectedvirtual

◆ reducePolicy()

int Module::reducePolicy ( ) const

◆ reduceWrapper()

bool Module::reduceWrapper ( const message::Execute exec,
bool  reordered = false 
)
protected

◆ removeParameter()

bool Module::removeParameter ( Parameter param)
overridevirtual

Reimplemented from vistle::ParameterManager.

◆ removePortMapping()

void Module::removePortMapping ( unsigned short  forwardPort)

remove port forwarding requested by requestPortMapping

◆ requestPortMapping()

void Module::requestPortMapping ( unsigned short  forwardPort,
unsigned short  localPort 
)

request hub to forward incoming connections on forwardPort to be forwarded to localPort

◆ schedulingPolicy()

int Module::schedulingPolicy ( ) const

◆ sendError() [1/4]

void Module::sendError ( const char *  fmt,
  ... 
) const

send error message to UI - printf style

◆ sendError() [2/4]

void Module::sendError ( const message::Message msg,
const char *  fmt,
  ... 
) const

send response message to UI - printf style

◆ sendError() [3/4]

void Module::sendError ( const message::Message msg,
const std::string &  text 
) const

send response message to UI - string style

◆ sendError() [4/4]

void Module::sendError ( const std::string &  text) const

send error message to UI - string style

◆ sendInfo() [1/2]

void Module::sendInfo ( const char *  fmt,
  ... 
) const

send info message to UI - printf style

◆ sendInfo() [2/2]

void Module::sendInfo ( const std::string &  text) const

send info message to UI - string style

◆ sendMessage() [1/2]

bool Module::sendMessage ( const message::Message message,
const buffer payload = nullptr 
) const
overridevirtual

Implements vistle::MessageSender.

◆ sendMessage() [2/2]

bool Module::sendMessage ( const message::Message message,
const MessagePayload payload 
) const
overridevirtual

Implements vistle::MessageSender.

◆ sendMessageWithPayload()

template<class Payload >
bool Module::sendMessageWithPayload ( message::Message message,
Payload &  payload 
) const

◆ sendObject() [1/2]

bool Module::sendObject ( const mpi::communicator &  comm,
vistle::Object::const_ptr  object,
int  destRank 
) const

◆ sendObject() [2/2]

bool Module::sendObject ( vistle::Object::const_ptr  object,
int  destRank 
) const

◆ sendParameterMessage()

void Module::sendParameterMessage ( const message::Message message,
const buffer payload 
) const
overridevirtual

◆ sendText()

void Module::sendText ( int  type,
const std::string &  msg 
) const

type should be a message::SendText::TextType

◆ sendWarning() [1/2]

void Module::sendWarning ( const char *  fmt,
  ... 
) const

send warning message to UI - printf style

◆ sendWarning() [2/2]

void Module::sendWarning ( const std::string &  text) const

send warning message to UI - string style

◆ setCacheMode()

ObjectCache::CacheMode Module::setCacheMode ( ObjectCache::CacheMode  mode,
bool  update = true 
)

◆ setDefaultCacheMode()

void Module::setDefaultCacheMode ( ObjectCache::CacheMode  mode)
protected

◆ setObjectReceivePolicy()

void Module::setObjectReceivePolicy ( int  pol)
protected

◆ setOpenmpThreads()

void Module::setOpenmpThreads ( int  nthreads,
bool  updateParam = true 
)
protected

◆ setReducePolicy()

void Module::setReducePolicy ( int  reduceRequirement)

◆ setSchedulingPolicy()

void Module::setSchedulingPolicy ( int  schedulingPolicy)

◆ setStatus()

void Module::setStatus ( const std::string &  text,
message::UpdateStatus::Importance  prio = message::UpdateStatus::Low 
)
protected

◆ setSyncMessageProcessing()

void Module::setSyncMessageProcessing ( bool  sync)
protected

◆ setup()

bool Module::setup ( const std::string &  shmname,
int  moduleID,
int  rank 
)
static

◆ shmLeader()

int Module::shmLeader ( int  rank = -1) const

◆ size()

int Module::size ( ) const

◆ startIteration()

void Module::startIteration ( )
protected

◆ syncMessageProcessing()

bool Module::syncMessageProcessing ( ) const
protected

◆ takeFirstObject() [1/2]

vistle::Object::const_ptr Module::takeFirstObject ( const std::string &  portName)

◆ takeFirstObject() [2/2]

vistle::Object::const_ptr Module::takeFirstObject ( Port port)

◆ updateMeta()

void Module::updateMeta ( vistle::Object::ptr  object) const
protected

◆ wasCancelRequested()

bool Module::wasCancelRequested ( ) const
protected

Friends And Related Function Documentation

◆ PortTask

friend class PortTask
friend

◆ Reader

friend class Reader
friend

◆ Renderer

friend class Renderer
friend

Member Data Documentation

◆ m_executionCount

int vistle::Module::m_executionCount
protected

◆ m_id

const int vistle::Module::m_id
protected

◆ m_iteration

int vistle::Module::m_iteration
protected

◆ m_name

const std::string vistle::Module::m_name
protected

◆ m_rank

int vistle::Module::m_rank
protected

◆ m_size

int vistle::Module::m_size
protected

◆ m_withOutput

std::set<Port *> vistle::Module::m_withOutput
protected

◆ messageBacklog

std::deque<message::Buffer> vistle::Module::messageBacklog
protected

◆ receiveMessageQueue

message::MessageQueue* vistle::Module::receiveMessageQueue
protected

◆ sendMessageQueue

message::MessageQueue* vistle::Module::sendMessageQueue
protected

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