View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
vistle::Reader Class Referenceabstract

base class for Vistle read modules More...

#include <module/reader.h>

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

Classes

class  Token
 

Public Member Functions

 Reader (const std::string &name, const int moduleID, mpi::communicator comm)
 construct a read module, parameters correspond to Module constructor More...
 
 ~Reader () override
 
virtual bool examine (const Parameter *param=nullptr)
 called whenever an observed parameter (cf. Reader::observeParameter) has been changed More...
 
virtual bool read (Token &token, int timestep=-1, int block=-1)=0
 called for every unit of work to be read More...
 
virtual bool prepareRead ()
 called once on every rank after execution of the module has been initiated before read is called More...
 
virtual bool finishRead ()
 called once on every rank after all read calls have been made and before execution finishes More...
 
int timeIncrement () const
 return number of timesteps to advance More...
 
virtual int rankForTimestepAndPartition (int t, int p) const
 compute rank on which partition p of timestep t should be read More...
 
int numPartitions () const
 query into how many parts the data should be split More...
 
- Public Member Functions inherited from vistle::Module
 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)
 
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)
 
void setId (int id)
 
int id () const
 
void setName (const std::string &name)
 
void applyDelayedChanges ()
 
- Public Member Functions inherited from vistle::MessageSender
virtual ~MessageSender ()
 

Protected Types

enum  ParallelizationMode { Serial , ParallelizeTimesteps , ParallelizeTimeAndBlocks , ParallelizeBlocks }
 

Protected Member Functions

void setParallelizationMode (ParallelizationMode mode)
 control whether and how read invocations are called in parallel More...
 
void setHandlePartitions (bool enable)
 whether partitions should be handled by the Reader class More...
 
void setAllowTimestepDistribution (bool allow)
 whether timesteps may be distributed to different ranks More...
 
void observeParameter (const Parameter *param)
 whenever an observed parameter changes, data set should be rescanned More...
 
void setTimesteps (int number)
 call during examine to inform module how many timesteps are present within dataset More...
 
void setPartitions (int number)
 call during examine to inform module nto how many the dataset will be split More...
 
bool changeParameters (std::set< const Parameter * > params) override
 
bool changeParameter (const Parameter *param) override
 
void prepareQuit () override
 
bool checkConvexity () const
 
- Protected Member Functions inherited from vistle::Module
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)
 
int openmpThreads () const
 
void setOpenmpThreads (int, bool updateParam=true)
 
void enableBenchmark (bool benchmark, bool updateParam=true)
 
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

IntParameter * m_first = nullptr
 
IntParameter * m_last = nullptr
 
IntParameter * m_increment = nullptr
 
IntParameter * m_distributeTime = nullptr
 
IntParameter * m_firstRank = nullptr
 
IntParameter * m_checkConvexity = nullptr
 
- Protected Attributes inherited from vistle::Module
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 Token
 

Additional Inherited Members

- Static Public Member Functions inherited from vistle::Module
static bool setup (const std::string &shmname, int moduleID, int rank)
 

Detailed Description

base class for Vistle read modules

Derive from Reader, if you want to implement a module Module for reading data from files. You should reimplement the methods

Member Enumeration Documentation

◆ ParallelizationMode

Enumerator
Serial 

only one operation at a time, all blocks of a timestep first, then other timesteps

ParallelizeTimesteps 

up to 'concurrency' operations at a time, but the same block from different timesteps may be scheduled on other ranks

ParallelizeTimeAndBlocks 

up to 'concurrency' operations at a time

ParallelizeBlocks 

up to 'concurrency' operations at a time, all operations for one timestep have finished before operations for another timestep are started

Constructor & Destructor Documentation

◆ Reader()

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

construct a read module, parameters correspond to Module constructor

construct a read module, parameters correspond to Module constructor

Parameters
namename of the module in the workflow editor
moduleIDunique identifier of the module instance
Boost.MPIcommunicator

◆ ~Reader()

vistle::Reader::~Reader ( )
override

Member Function Documentation

◆ changeParameter()

bool vistle::Reader::changeParameter ( const Parameter param)
overrideprotectedvirtual

Reimplemented from vistle::Module.

◆ changeParameters()

bool vistle::Reader::changeParameters ( std::set< const Parameter * >  params)
overrideprotectedvirtual

Reimplemented from vistle::ParameterManager.

◆ checkConvexity()

bool vistle::Reader::checkConvexity ( ) const
protected

◆ examine()

bool vistle::Reader::examine ( const Parameter param = nullptr)
virtual

called whenever an observed parameter (cf. Reader::observeParameter) has been changed

called whenever an observed parameter (cf. Reader::observeParameter) has been changed. After constructing the class, the method is called after all parameters have been set to their initial value with param==nullptr. Otherwise, the changed parameter is passed. Call setTimesteps and setPartitions according to the data to be read.

◆ finishRead()

bool vistle::Reader::finishRead ( )
virtual

called once on every rank after all read calls have been made and before execution finishes

◆ numPartitions()

int vistle::Reader::numPartitions ( ) const

query into how many parts the data should be split

◆ observeParameter()

void vistle::Reader::observeParameter ( const Parameter param)
protected

whenever an observed parameter changes, data set should be rescanned

◆ prepareQuit()

void vistle::Reader::prepareQuit ( )
overrideprotectedvirtual

Reimplemented from vistle::Module.

◆ prepareRead()

bool vistle::Reader::prepareRead ( )
virtual

called once on every rank after execution of the module has been initiated before read is called

◆ rankForTimestepAndPartition()

int vistle::Reader::rankForTimestepAndPartition ( int  t,
int  p 
) const
virtual

compute rank on which partition p of timestep t should be read

◆ read()

virtual bool vistle::Reader::read ( Token token,
int  timestep = -1,
int  block = -1 
)
pure virtual

called for every unit of work to be read

Called for every unit of work to be read. The size of a work unit depends on the partitioning that has been requested by setPartitions

◆ setAllowTimestepDistribution()

void vistle::Reader::setAllowTimestepDistribution ( bool  allow)
protected

whether timesteps may be distributed to different ranks

Allow timestep distribution across MPI processes.

Parameters
allowAdds a bool parameter to the reader if true and enables it when parallem mode is set to ParallelizeTimesteps.

◆ setHandlePartitions()

void vistle::Reader::setHandlePartitions ( bool  enable)
protected

whether partitions should be handled by the Reader class

◆ setParallelizationMode()

void vistle::Reader::setParallelizationMode ( Reader::ParallelizationMode  mode)
protected

control whether and how read invocations are called in parallel

Set parallelize mode per mpi process.

Parameters
modeenum.

◆ setPartitions()

void vistle::Reader::setPartitions ( int  number)
protected

call during examine to inform module nto how many the dataset will be split

◆ setTimesteps()

void vistle::Reader::setTimesteps ( int  number)
protected

call during examine to inform module how many timesteps are present within dataset

◆ timeIncrement()

int vistle::Reader::timeIncrement ( ) const

return number of timesteps to advance

Friends And Related Function Documentation

◆ Token

friend class Token
friend

Member Data Documentation

◆ m_checkConvexity

IntParameter* vistle::Reader::m_checkConvexity = nullptr
protected

◆ m_distributeTime

IntParameter* vistle::Reader::m_distributeTime = nullptr
protected

◆ m_first

IntParameter* vistle::Reader::m_first = nullptr
protected

◆ m_firstRank

IntParameter* vistle::Reader::m_firstRank = nullptr
protected

◆ m_increment

IntParameter* vistle::Reader::m_increment = nullptr
protected

◆ m_last

IntParameter* vistle::Reader::m_last = nullptr
protected

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