ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkProcessModule Class Reference

process initialization and management core for ParaView processes. More...

#include <vtkProcessModule.h>

Inherits vtkObject.

Collaboration diagram for vtkProcessModule:
Collaboration graph
[legend]

Public Types

enum  ProcessTypes {
  PROCESS_CLIENT, PROCESS_SERVER, PROCESS_DATA_SERVER, PROCESS_RENDER_SERVER,
  PROCESS_BATCH, PROCESS_INVALID = -1
}
 
enum  ServerFlags {
  DATA_SERVER = 0x01, DATA_SERVER_ROOT = 0x02, RENDER_SERVER = 0x04, RENDER_SERVER_ROOT = 0x08,
  SERVERS = DATA_SERVER | RENDER_SERVER, CLIENT = 0x10, CLIENT_AND_SERVERS = DATA_SERVER | CLIENT | RENDER_SERVER
}
 These flags are used to specify destination servers for the SendStream function. More...
 
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
void UpdateProcessType (ProcessTypes newType, bool dontKnowWhatImDoing=true)
 This method has been added to support migration from one type to another but this method call if NOT RECOMMENDED. More...
 
vtkIdType RegisterSession (vtkSession *)
 Registers a new session. More...
 
vtkSessionGetSession (vtkIdType)
 Returns the session associated with a given ID. More...
 
vtkIdType GetSessionID (vtkSession *)
 Returns the session id for the session, if any. More...
 
vtkSessionIteratorNewSessionIterator ()
 Returns a new session iterator that can be used to iterate over the registered sessions. More...
 
vtkSessionGetActiveSession ()
 Whenever any session is processing some message, it typically marks itself active with the process module. More...
 
vtkSessionGetSession ()
 This is a convenience method that either returns the active session, if present, otherwise the first session. More...
 
vtkMultiProcessController * GetGlobalController ()
 Provides access to the global MPI controller, if any. More...
 
int GetNumberOfLocalPartitions ()
 Returns the number of processes in this process group. More...
 
int GetPartitionId ()
 Returns the local process id. More...
 
bool IsMPIInitialized ()
 Return whether MPI is initialized in this process group. More...
 
std::string GetProgramPath () const
 The full path to the current executable that is running (or empty if unknown). More...
 
std::string GetSelfDir () const
 The directory containing the current executable (or empty if unknown). More...
 
bool UnRegisterSession (vtkIdType sessionID)
 Unregister a session given its ID. More...
 
bool UnRegisterSession (vtkSession *session)
 Unregister a session given its ID. More...
 
virtual vtkIdType GetEventCallDataSessionId ()
 RegisterSession and UnRegisterSession fire events with SessionID in calldata. More...
 
virtual bool GetMultipleSessionsSupport ()
 Return true, if multiple sessions can be used simultanuously. More...
 
virtual void SetMultipleSessionsSupport (bool)
 Return true, if multiple sessions can be used simultanuously. More...
 
virtual void MultipleSessionsSupportOn ()
 Return true, if multiple sessions can be used simultanuously. More...
 
virtual void MultipleSessionsSupportOff ()
 Return true, if multiple sessions can be used simultanuously. More...
 
virtual vtkPVOptionsGetOptions ()
 Set/Get the application command line options object. More...
 
void SetOptions (vtkPVOptions *op)
 Set/Get the application command line options object. More...
 
virtual vtkNetworkAccessManagerGetNetworkAccessManager ()
 Get/Set the network access manager. More...
 
void SetNetworkAccessManager (vtkNetworkAccessManager *)
 Get/Set the network access manager. More...
 
virtual bool GetReportInterpreterErrors ()
 Set/Get whether to report errors from the Interpreter. More...
 
virtual void SetReportInterpreterErrors (bool)
 Set/Get whether to report errors from the Interpreter. More...
 
virtual void ReportInterpreterErrorsOn ()
 Set/Get whether to report errors from the Interpreter. More...
 
virtual void ReportInterpreterErrorsOff ()
 Set/Get whether to report errors from the Interpreter. More...
 
virtual bool GetSymmetricMPIMode ()
 Returns true if ParaView is to be run in symmetric mode. More...
 

Static Public Member Functions

static vtkProcessModuleNew ()
 
static int IsTypeOf (const char *type)
 
static vtkProcessModuleSafeDownCast (vtkObject *o)
 
static ProcessTypes GetProcessType ()
 
static unsigned int GetProcessTypeAsInt ()
 
static bool Initialize (ProcessTypes type, int &argc, char **&argv)
 Initializes the process and the ProcessModule. More...
 
static bool Finalize ()
 Finalizes and cleans up the process. More...
 
static vtkProcessModuleGetProcessModule ()
 Provides access to the global ProcessModule. More...
 

Protected Member Functions

 vtkProcessModule ()
 
 ~vtkProcessModule ()
 
virtual void SetSymmetricMPIMode (bool)
 
void SetExecutablePath (const std::string &path)
 Sets the executable path of the process so that ParaView can, e.g., set up paths for Python properly. More...
 
void PushActiveSession (vtkSession *)
 Push/Pop the active session. More...
 
void PopActiveSession (vtkSession *)
 Push/Pop the active session. More...
 

Protected Attributes

vtkNetworkAccessManagerNetworkAccessManager
 
vtkPVOptionsOptions
 
vtkIdType MaxSessionId
 Used to keep track of maximum session used. More...
 
vtkProcessModuleInternalsInternals
 
bool ReportInterpreterErrors
 

Friends

class vtkSession
 Marking vtkSession as friend since it needs access to PushActiveSession/PopActiveSession. More...
 
class vtkSessionIterator
 

Detailed Description

process initialization and management core for ParaView processes.

vtkProcessModule is the process initialization and session management core for ParaView processes.

Definition at line 39 of file vtkProcessModule.h.

Member Typedef Documentation

§ Superclass

typedef vtkObject vtkProcessModule::Superclass

Definition at line 43 of file vtkProcessModule.h.

Member Enumeration Documentation

§ ProcessTypes

Enumerator
PROCESS_CLIENT 
PROCESS_SERVER 
PROCESS_DATA_SERVER 
PROCESS_RENDER_SERVER 
PROCESS_BATCH 
PROCESS_INVALID 

Definition at line 46 of file vtkProcessModule.h.

§ ServerFlags

These flags are used to specify destination servers for the SendStream function.

FIXME: These flags should simply move to PVSession. They don't make sense in non-PVSessions since the processes may have different roles in that case.

Enumerator
DATA_SERVER 
DATA_SERVER_ROOT 
RENDER_SERVER 
RENDER_SERVER_ROOT 
SERVERS 
CLIENT 
CLIENT_AND_SERVERS 

Definition at line 65 of file vtkProcessModule.h.

Constructor & Destructor Documentation

§ vtkProcessModule()

vtkProcessModule::vtkProcessModule ( )
protected

§ ~vtkProcessModule()

vtkProcessModule::~vtkProcessModule ( )
protected

Member Function Documentation

§ New()

static vtkProcessModule* vtkProcessModule::New ( )
static

§ GetClassName()

virtual const char* vtkProcessModule::GetClassName ( )
virtual

§ IsTypeOf()

static int vtkProcessModule::IsTypeOf ( const char *  type)
static

§ IsA()

virtual int vtkProcessModule::IsA ( const char *  type)
virtual

§ SafeDownCast()

static vtkProcessModule* vtkProcessModule::SafeDownCast ( vtkObject *  o)
static

§ PrintSelf()

void vtkProcessModule::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

§ GetProcessType()

static ProcessTypes vtkProcessModule::GetProcessType ( )
static

§ GetProcessTypeAsInt()

static unsigned int vtkProcessModule::GetProcessTypeAsInt ( )
inlinestatic

Definition at line 77 of file vtkProcessModule.h.

§ UpdateProcessType()

void vtkProcessModule::UpdateProcessType ( ProcessTypes  newType,
bool  dontKnowWhatImDoing = true 
)

This method has been added to support migration from one type to another but this method call if NOT RECOMMENDED.

-> We use it to handle the Animation saving at disconnection time on the server side. We create a new session and migrate the sever process to a batch process.

§ Initialize()

static bool vtkProcessModule::Initialize ( ProcessTypes  type,
int &  argc,
char **&  argv 
)
static

Initializes the process and the ProcessModule.

The function is to initialize MPI if applicable for the process and setup some environment e.g. DISPLAY. Initializes the ProcessModule. for the process and setup some environment e.g. DISPLAY.

§ Finalize()

static bool vtkProcessModule::Finalize ( )
static

Finalizes and cleans up the process.

§ RegisterSession()

vtkIdType vtkProcessModule::RegisterSession ( vtkSession )

Registers a new session.

A new ID is assigned for the session and that ID is returned. The ID can be used in future to access this session. Fires vtkCommand::ConnectionCreatedEvent every time a session is registered. The event-data for this event is a vtkIdType whose value is the session id.

§ UnRegisterSession() [1/2]

bool vtkProcessModule::UnRegisterSession ( vtkIdType  sessionID)

Unregister a session given its ID.

This is the same ID that is returned when the session was registered. Returns true is the session was unregistered. Unregistering a session implies that the ProcessModule will no longer monitor communication on the sockets, if any, in the session. Fires vtkCommand::ConnectionClosedEvent every time a session is unregistered. The event-data for this event is a vtkIdType whose value is the session id.

§ UnRegisterSession() [2/2]

bool vtkProcessModule::UnRegisterSession ( vtkSession session)

Unregister a session given its ID.

This is the same ID that is returned when the session was registered. Returns true is the session was unregistered. Unregistering a session implies that the ProcessModule will no longer monitor communication on the sockets, if any, in the session. Fires vtkCommand::ConnectionClosedEvent every time a session is unregistered. The event-data for this event is a vtkIdType whose value is the session id.

§ GetEventCallDataSessionId()

virtual vtkIdType vtkProcessModule::GetEventCallDataSessionId ( )
virtual

RegisterSession and UnRegisterSession fire events with SessionID in calldata.

To provide access to that in Python, we have this method. The value is valid only in vtkCommand::ConnectionCreatedEvent and vtkCommand::ConnectionClosedEvent callbacks and is set to 0 at other times.

§ GetSession() [1/2]

vtkSession* vtkProcessModule::GetSession ( vtkIdType  )

Returns the session associated with a given ID.

§ GetSessionID()

vtkIdType vtkProcessModule::GetSessionID ( vtkSession )

Returns the session id for the session, if any.

Return 0 is the session has not been registered with the process module.

§ NewSessionIterator()

vtkSessionIterator* vtkProcessModule::NewSessionIterator ( )

Returns a new session iterator that can be used to iterate over the registered sessions.

§ GetActiveSession()

vtkSession* vtkProcessModule::GetActiveSession ( )

Whenever any session is processing some message, it typically marks itself active with the process module.

The active session can be accessed using this method.

§ GetSession() [2/2]

vtkSession* vtkProcessModule::GetSession ( )

This is a convenience method that either returns the active session, if present, otherwise the first session.

Don't use this for new API. This is provided for some old api.

§ GetMultipleSessionsSupport()

virtual bool vtkProcessModule::GetMultipleSessionsSupport ( )
virtual

Return true, if multiple sessions can be used simultanuously.

We set the default to be FALSE.

§ SetMultipleSessionsSupport()

virtual void vtkProcessModule::SetMultipleSessionsSupport ( bool  )
virtual

Return true, if multiple sessions can be used simultanuously.

We set the default to be FALSE.

§ MultipleSessionsSupportOn()

virtual void vtkProcessModule::MultipleSessionsSupportOn ( )
virtual

Return true, if multiple sessions can be used simultanuously.

We set the default to be FALSE.

§ MultipleSessionsSupportOff()

virtual void vtkProcessModule::MultipleSessionsSupportOff ( )
virtual

Return true, if multiple sessions can be used simultanuously.

We set the default to be FALSE.

§ GetProcessModule()

static vtkProcessModule* vtkProcessModule::GetProcessModule ( )
static

Provides access to the global ProcessModule.

This method can only be called after Initialize().

§ GetOptions()

virtual vtkPVOptions* vtkProcessModule::GetOptions ( )
virtual

Set/Get the application command line options object.

Note that this has to be explicitly set. vtkProcessModule::Initialize() does not initialize the vtkPVOptions.

§ SetOptions()

void vtkProcessModule::SetOptions ( vtkPVOptions op)

Set/Get the application command line options object.

Note that this has to be explicitly set. vtkProcessModule::Initialize() does not initialize the vtkPVOptions.

§ GetNetworkAccessManager()

virtual vtkNetworkAccessManager* vtkProcessModule::GetNetworkAccessManager ( )
virtual

Get/Set the network access manager.

vtkNetworkAccessManager encapsulates the setup of interprocess communication channels. By default a vtkTCPNetworkAccessManager is setup. If you want to change the network access manager, it should be done only when no sessions are present. Ideally, you want to do that during the initialization of the process itself.

§ SetNetworkAccessManager()

void vtkProcessModule::SetNetworkAccessManager ( vtkNetworkAccessManager )

Get/Set the network access manager.

vtkNetworkAccessManager encapsulates the setup of interprocess communication channels. By default a vtkTCPNetworkAccessManager is setup. If you want to change the network access manager, it should be done only when no sessions are present. Ideally, you want to do that during the initialization of the process itself.

§ GetGlobalController()

vtkMultiProcessController* vtkProcessModule::GetGlobalController ( )

Provides access to the global MPI controller, if any.

Same can be obtained using vtkMultiProcessController::GetGlobalController();

§ GetNumberOfLocalPartitions()

int vtkProcessModule::GetNumberOfLocalPartitions ( )

Returns the number of processes in this process group.

§ GetPartitionId()

int vtkProcessModule::GetPartitionId ( )

Returns the local process id.

§ IsMPIInitialized()

bool vtkProcessModule::IsMPIInitialized ( )

Return whether MPI is initialized in this process group.

§ GetReportInterpreterErrors()

virtual bool vtkProcessModule::GetReportInterpreterErrors ( )
virtual

Set/Get whether to report errors from the Interpreter.

§ SetReportInterpreterErrors()

virtual void vtkProcessModule::SetReportInterpreterErrors ( bool  )
virtual

Set/Get whether to report errors from the Interpreter.

§ ReportInterpreterErrorsOn()

virtual void vtkProcessModule::ReportInterpreterErrorsOn ( )
virtual

Set/Get whether to report errors from the Interpreter.

§ ReportInterpreterErrorsOff()

virtual void vtkProcessModule::ReportInterpreterErrorsOff ( )
virtual

Set/Get whether to report errors from the Interpreter.

§ GetSymmetricMPIMode()

virtual bool vtkProcessModule::GetSymmetricMPIMode ( )
virtual

Returns true if ParaView is to be run in symmetric mode.

Symmetric mode implies that satellites process same code as the root node. This is applicable only for PROCESS_BATCH.

§ GetProgramPath()

std::string vtkProcessModule::GetProgramPath ( ) const
inline

The full path to the current executable that is running (or empty if unknown).

Definition at line 260 of file vtkProcessModule.h.

§ GetSelfDir()

std::string vtkProcessModule::GetSelfDir ( ) const
inline

The directory containing the current executable (or empty if unknown).

Definition at line 264 of file vtkProcessModule.h.

§ SetSymmetricMPIMode()

virtual void vtkProcessModule::SetSymmetricMPIMode ( bool  )
protectedvirtual

§ PushActiveSession()

void vtkProcessModule::PushActiveSession ( vtkSession )
protected

Push/Pop the active session.

§ PopActiveSession()

void vtkProcessModule::PopActiveSession ( vtkSession )
protected

Push/Pop the active session.

§ SetExecutablePath()

void vtkProcessModule::SetExecutablePath ( const std::string &  path)
protected

Sets the executable path of the process so that ParaView can, e.g., set up paths for Python properly.

Friends And Related Function Documentation

§ vtkSession

friend class vtkSession
friend

Marking vtkSession as friend since it needs access to PushActiveSession/PopActiveSession.

Definition at line 284 of file vtkProcessModule.h.

§ vtkSessionIterator

friend class vtkSessionIterator
friend

Definition at line 306 of file vtkProcessModule.h.

Member Data Documentation

§ NetworkAccessManager

vtkNetworkAccessManager* vtkProcessModule::NetworkAccessManager
protected

Definition at line 286 of file vtkProcessModule.h.

§ Options

vtkPVOptions* vtkProcessModule::Options
protected

Definition at line 287 of file vtkProcessModule.h.

§ MaxSessionId

vtkIdType vtkProcessModule::MaxSessionId
protected

Used to keep track of maximum session used.

Only used to ensure that no session id is ever repeated.

Definition at line 293 of file vtkProcessModule.h.

§ Internals

vtkProcessModuleInternals* vtkProcessModule::Internals
protected

Definition at line 302 of file vtkProcessModule.h.

§ ReportInterpreterErrors

bool vtkProcessModule::ReportInterpreterErrors
protected

Definition at line 308 of file vtkProcessModule.h.


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