Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkMultiProcessController Class Reference

Multiprocessing communication superclass. More...

#include <vtkMultiProcessController.h>

Inheritance diagram for vtkMultiProcessController:

Inheritance graph
[legend]
Collaboration diagram for vtkMultiProcessController:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void Initialize (int vtkNotUsed(argc), char *arcv[])
virtual void SetNumberOfProcesses (int num)
virtual int GetNumberOfProcesses ()
void SetSingleMethod (vtkProcessFunctionType, void *data)
virtual void SingleMethodExecute ()=0
void SetMultipleMethod (int index, vtkProcessFunctionType, void *data)
virtual void MultipleMethodExecute ()=0
virtual int GetLocalProcessId ()
virtual int Send (vtkDataObject *data, int remoteProcessId, int tag)
virtual int Send (int *data, int length, int remoteProcessId, int tag)=0
virtual int Send (unsigned long *data, int length, int remoteProcessId, int tag)=0
virtual int Send (char *data, int length, int remoteProcessId, int tag)=0
virtual int Send (float *data, int length, int remoteProcessId, int tag)=0
virtual int Receive (vtkDataObject *data, int remoteProcessId, int tag)
virtual int Receive (int *data, int length, int remoteProcessId, int tag)=0
virtual int Receive (unsigned long *data, int length, int remoteProcessId, int tag)=0
virtual int Receive (char *data, int length, int remoteProcessId, int tag)=0
virtual int Receive (float *data, int length, int remoteProcessId, int tag)=0
virtual void SetForceDeepCopy (int)
virtual int GetForceDeepCopy ()
virtual void ForceDeepCopyOn ()
virtual void ForceDeepCopyOff ()
void AddRMI (vtkRMIFunctionType, void *localArg, int tag)
void RemoveRMI (vtkRMIFunctionType f, void *arg, int tag)
void TriggerRMI (int remoteProcessId, void *arg, int argLength, int tag)
void TriggerRMI (int remoteProcessId, char *arg, int tag)
void TriggerRMI (int remoteProcessId, int tag)
void ProcessRMIs ()
virtual void SetBreakFlag (int)
virtual int GetBreakFlag ()
virtual float GetWriteTime ()
virtual float GetReadTime ()
virtual float GetSendWaitTime ()
virtual float GetSendTime ()
virtual float GetReceiveWaitTime ()
virtual float GetReceiveTime ()

Static Public Methods

vtkMultiProcessController * New ()
int IsTypeOf (const char *type)
vtkMultiProcessController * SafeDownCast (vtkObject *o)
vtkMultiProcessController * GetGlobalController ()

Protected Methods

 vtkMultiProcessController ()
 ~vtkMultiProcessController ()
 vtkMultiProcessController (const vtkMultiProcessController &)
void operator= (const vtkMultiProcessController &)
void DeleteAndSetMarshalString (char *str, int strLength)
int WriteObject (vtkDataObject *object)
int ReadObject (vtkDataObject *object)
int WriteDataSet (vtkDataSet *object)
int ReadDataSet (vtkDataSet *object)
int WriteImageData (vtkImageData *object)
int ReadImageData (vtkImageData *object)
void ProcessRMI (int remoteProcessId, void *arg, int argLength, int rmiTag)
virtual vtkMultiProcessController * GetLocalController ()
virtual void SetGlobalController (vtkMultiProcessController *controller)

Protected Attributes

int MaximumNumberOfProcesses
int NumberOfProcesses
int LocalProcessId
vtkProcessFunctionType SingleMethod
void * SingleData
vtkProcessFunctionType MultipleMethod [VTK_MP_CONTROLLER_MAX_PROCESSES]
void * MultipleData [VTK_MP_CONTROLLER_MAX_PROCESSES]
vtkCollectionRMIs
char * MarshalString
int MarshalStringLength
int MarshalDataLength
int BreakFlag
float ReadTime
float WriteTime
float SendWaitTime
float SendTime
float ReceiveWaitTime
float ReceiveTime
int ForceDeepCopy

Detailed Description

Multiprocessing communication superclass.

Date:
2000/12/10 20:08:25
Revision:
1.27

vtkMultiProcessController supplies an API for sending and receiving message between processes. The controller also defines calls for sending and receiving vtkDataObjects, and remote method invocations.

See also:
vtkMPIController vtkThreadedController
Examples:
vtkMultiProcessController (examples)

Definition at line 93 of file vtkMultiProcessController.h.


Constructor & Destructor Documentation

vtkMultiProcessController::vtkMultiProcessController   [protected]
 

vtkMultiProcessController::~vtkMultiProcessController   [protected]
 

vtkMultiProcessController::vtkMultiProcessController const vtkMultiProcessController &    [inline, protected]
 

Definition at line 232 of file vtkMultiProcessController.h.


Member Function Documentation

vtkMultiProcessController* vtkMultiProcessController::New   [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual const char* vtkMultiProcessController::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

int vtkMultiProcessController::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

vtkMultiProcessController* vtkMultiProcessController::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

void vtkMultiProcessController::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual void vtkMultiProcessController::Initialize int vtkNotUsed(argc)   ,
char *    arcv[]
[inline, virtual]
 

This method is for setting up the processes. If a subclass needs to initialize process communication (i.e. MPI) it would over ride this method.

Reimplemented in vtkSocketCommunicator.

Definition at line 103 of file vtkMultiProcessController.h.

virtual void vtkMultiProcessController::SetNumberOfProcesses int    num [virtual]
 

Set the number of processes you will be using. This defaults to the maximum number available. If you set this to a value higher than the default, you will get an error.

Reimplemented in vtkSocketCommunicator.

virtual int vtkMultiProcessController::GetNumberOfProcesses   [virtual]
 

void vtkMultiProcessController::SetSingleMethod vtkProcessFunctionType   ,
void *    data
 

Set the SingleMethod to f() and the UserData of the for the method to be executed by all of the processes when SingleMethodExecute is called. All the processes will start by calling this function.

virtual void vtkMultiProcessController::SingleMethodExecute   [pure virtual]
 

Execute the SingleMethod (as define by SetSingleMethod) using this->NumberOfProcesses processes. This will only return when all the processes finish executing their methods.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

void vtkMultiProcessController::SetMultipleMethod int    index,
vtkProcessFunctionType   ,
void *    data
 

Set the MultipleMethod to f() and the UserData of the for the method to be executed by the process index when MultipleMethodExecute is called. This is for having each process start with a different function and data argument.

virtual void vtkMultiProcessController::MultipleMethodExecute   [pure virtual]
 

Execute the MultipleMethods (as define by calling SetMultipleMethod for each of the required this->NumberOfProcesses methods) using this->NumberOfProcesses processes.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::GetLocalProcessId   [inline, virtual]
 

Tells you which process [0, NumProcess) you are in.

Reimplemented in vtkThreadedController.

Definition at line 137 of file vtkMultiProcessController.h.

vtkMultiProcessController* vtkMultiProcessController::GetGlobalController   [static]
 

This convenience method returns the controller associated with the local process. It returns NULL until the processes are spawned. It is better if you hang on to the controller passed as an argument to the SingleMethod or MultipleMethod functions.

virtual int vtkMultiProcessController::Send vtkDataObject   data,
int    remoteProcessId,
int    tag
[virtual]
 

This method sends an object to another process. Tag eliminates ambiguity and is used to match sends to receives.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

Referenced by vtkSocketCommunicator::Send(), and vtkMPIController::Send().

virtual int vtkMultiProcessController::Send int *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Subclass have to supply these methods to send various arrays of data.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Send unsigned long *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Send char *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Send float *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Receive vtkDataObject   data,
int    remoteProcessId,
int    tag
[virtual]
 

This method receives a data object from a corresponding send. It blocks until the receive is finished.

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

Referenced by vtkSocketCommunicator::Receive(), and vtkMPIController::Receive().

virtual int vtkMultiProcessController::Receive int *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Subclass have to supply these methods to receive various arrays of data. The methods also have to support a remoteProcessId of VTK_MP_CONTROLLER_ANY_SOURCE

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Receive unsigned long *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Receive char *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual int vtkMultiProcessController::Receive float *    data,
int    length,
int    remoteProcessId,
int    tag
[pure virtual]
 

Reimplemented in vtkMPIController, vtkSocketCommunicator, and vtkThreadedController.

virtual void vtkMultiProcessController::SetForceDeepCopy int    [virtual]
 

By default, sending objects use shallow copy whenever possible. This flag forces the controller to use deep copies instead. This is necessary when asynchronous processing occurs (i.e. pipeline parallelism). This is only important when using vtkThreadedController.

virtual int vtkMultiProcessController::GetForceDeepCopy   [virtual]
 

virtual void vtkMultiProcessController::ForceDeepCopyOn   [virtual]
 

virtual void vtkMultiProcessController::ForceDeepCopyOff   [virtual]
 

void vtkMultiProcessController::AddRMI vtkRMIFunctionType   ,
void *    localArg,
int    tag
 

Register remote method invocation in the receiving process which makes the call. It must have a unique tag as an RMI id. The vtkRMIFunctionType has several arguments: localArg (same as passed in), remoteArg, remoteArgLength (memory passed by process triggering the RMI), remoteProcessId.

void vtkMultiProcessController::RemoveRMI vtkRMIFunctionType    f,
void *    arg,
int    tag
[inline]
 

Take an RMI away.

Definition at line 194 of file vtkMultiProcessController.h.

void vtkMultiProcessController::TriggerRMI int    remoteProcessId,
void *    arg,
int    argLength,
int    tag
 

A method to trigger a method invocation in another process.

void vtkMultiProcessController::TriggerRMI int    remoteProcessId,
char *    arg,
int    tag
[inline]
 

Convenience method when the arg is a string.

Definition at line 202 of file vtkMultiProcessController.h.

void vtkMultiProcessController::TriggerRMI int    remoteProcessId,
int    tag
[inline]
 

Convenience method when there is no argument.

Definition at line 206 of file vtkMultiProcessController.h.

void vtkMultiProcessController::ProcessRMIs  
 

Calling this method gives control to the controller to start processing RMIs.

virtual void vtkMultiProcessController::SetBreakFlag int    [virtual]
 

Setting this flag to 1 will cause the ProcessRMIs loop to return. This also causes vtkUpStreamPorts to return from their WaitForUpdate loops.

virtual int vtkMultiProcessController::GetBreakFlag   [virtual]
 

virtual float vtkMultiProcessController::GetWriteTime   [virtual]
 

For performance monitoring, reading and writing polydata to strings are timed. Access to these times is provided by these methods.

virtual float vtkMultiProcessController::GetReadTime   [virtual]
 

virtual float vtkMultiProcessController::GetSendWaitTime   [virtual]
 

virtual float vtkMultiProcessController::GetSendTime   [virtual]
 

virtual float vtkMultiProcessController::GetReceiveWaitTime   [virtual]
 

virtual float vtkMultiProcessController::GetReceiveTime   [virtual]
 

void vtkMultiProcessController::operator= const vtkMultiProcessController &    [inline, protected]
 

Definition at line 233 of file vtkMultiProcessController.h.

void vtkMultiProcessController::DeleteAndSetMarshalString char *    str,
int    strLength
[protected]
 

int vtkMultiProcessController::WriteObject vtkDataObject   object [protected]
 

int vtkMultiProcessController::ReadObject vtkDataObject   object [protected]
 

int vtkMultiProcessController::WriteDataSet vtkDataSet   object [protected]
 

int vtkMultiProcessController::ReadDataSet vtkDataSet   object [protected]
 

int vtkMultiProcessController::WriteImageData vtkImageData   object [protected]
 

int vtkMultiProcessController::ReadImageData vtkImageData   object [protected]
 

void vtkMultiProcessController::ProcessRMI int    remoteProcessId,
void *    arg,
int    argLength,
int    rmiTag
[protected]
 

virtual vtkMultiProcessController* vtkMultiProcessController::GetLocalController   [protected, virtual]
 

Reimplemented in vtkThreadedController.

virtual void vtkMultiProcessController::SetGlobalController vtkMultiProcessController *    controller [protected, virtual]
 


Member Data Documentation

int vtkMultiProcessController::MaximumNumberOfProcesses [protected]
 

Definition at line 235 of file vtkMultiProcessController.h.

int vtkMultiProcessController::NumberOfProcesses [protected]
 

Definition at line 236 of file vtkMultiProcessController.h.

int vtkMultiProcessController::LocalProcessId [protected]
 

Reimplemented in vtkThreadedController.

Definition at line 239 of file vtkMultiProcessController.h.

vtkProcessFunctionType vtkMultiProcessController::SingleMethod [protected]
 

Definition at line 241 of file vtkMultiProcessController.h.

void* vtkMultiProcessController::SingleData [protected]
 

Definition at line 242 of file vtkMultiProcessController.h.

vtkProcessFunctionType vtkMultiProcessController::MultipleMethod[VTK_MP_CONTROLLER_MAX_PROCESSES] [protected]
 

Definition at line 243 of file vtkMultiProcessController.h.

void* vtkMultiProcessController::MultipleData[VTK_MP_CONTROLLER_MAX_PROCESSES] [protected]
 

Definition at line 244 of file vtkMultiProcessController.h.

vtkCollection* vtkMultiProcessController::RMIs [protected]
 

Definition at line 246 of file vtkMultiProcessController.h.

char* vtkMultiProcessController::MarshalString [protected]
 

Definition at line 248 of file vtkMultiProcessController.h.

int vtkMultiProcessController::MarshalStringLength [protected]
 

Definition at line 249 of file vtkMultiProcessController.h.

int vtkMultiProcessController::MarshalDataLength [protected]
 

Definition at line 251 of file vtkMultiProcessController.h.

int vtkMultiProcessController::BreakFlag [protected]
 

Definition at line 255 of file vtkMultiProcessController.h.

float vtkMultiProcessController::ReadTime [protected]
 

Definition at line 280 of file vtkMultiProcessController.h.

float vtkMultiProcessController::WriteTime [protected]
 

Definition at line 281 of file vtkMultiProcessController.h.

float vtkMultiProcessController::SendWaitTime [protected]
 

Definition at line 283 of file vtkMultiProcessController.h.

float vtkMultiProcessController::SendTime [protected]
 

Definition at line 284 of file vtkMultiProcessController.h.

float vtkMultiProcessController::ReceiveWaitTime [protected]
 

Definition at line 285 of file vtkMultiProcessController.h.

float vtkMultiProcessController::ReceiveTime [protected]
 

Definition at line 286 of file vtkMultiProcessController.h.

int vtkMultiProcessController::ForceDeepCopy [protected]
 

Definition at line 289 of file vtkMultiProcessController.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:55:04 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001