|  | VTK
    9.0.1
    | 
 
 
 
Go to the documentation of this file.
   40 #ifndef vtkSocketCommunicator_h 
   41 #define vtkSocketCommunicator_h 
   44 #include "vtkParallelCoreModule.h"  
   48 #ifdef VTK_WORDS_BIGENDIAN 
   49 #define vtkSwap4 vtkByteSwap::Swap4LE 
   50 #define vtkSwap4Range vtkByteSwap::Swap4LERange 
   51 #define vtkSwap8 vtkByteSwap::Swap8LE 
   52 #define vtkSwap8Range vtkByteSwap::Swap8LERange 
   54 #define vtkSwap4 vtkByteSwap::Swap4BE 
   55 #define vtkSwap4Range vtkByteSwap::Swap4BERange 
   56 #define vtkSwap8 vtkByteSwap::Swap8BE 
   57 #define vtkSwap8Range vtkByteSwap::Swap8BERange 
   75   virtual int WaitForConnection(
int port);
 
   76   virtual int WaitForConnection(
vtkServerSocket* socket, 
unsigned long msec = 0);
 
   82   virtual void CloseConnection();
 
   87   virtual int ConnectTo(
const char* hostName, 
int port);
 
   93   vtkGetMacro(SwapBytesInReceivedData, 
int);
 
  132     int destProcessId) 
override;
 
  136     int srcProcessId) 
override;
 
  144     int operation, 
int destProcessId) 
override;
 
  146     Operation* operation, 
int destProcessId) 
override;
 
  148     const void* sendBuffer, 
void* recvBuffer, 
vtkIdType length, 
int type, 
int operation) 
override;
 
  159   vtkSetClampMacro(PerformHandshake, 
vtkTypeBool, 0, 1);
 
  169   virtual void SetLogStream(ostream* stream);
 
  170   virtual ostream* GetLogStream();
 
  180   virtual int LogToFile(
const char* 
name);
 
  181   virtual int LogToFile(
const char* 
name, 
int append);
 
  188   vtkSetMacro(ReportErrors, 
int);
 
  189   vtkGetMacro(ReportErrors, 
int);
 
  211   int ServerSideHandshake();
 
  218   int ClientSideHandshake();
 
  225   vtkGetMacro(IsServer, 
int);
 
  232   static int GetVersion();
 
  247   bool HasBufferredMessages();
 
  266   int SendTagged(
const void* 
data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  267   int ReceiveTagged(
void* 
data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  268   int ReceivePartialTagged(
void* 
data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  270   int ReceivedTaggedFromBuffer(
 
  271     void* 
data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  276   void FixByteOrder(
void* 
data, 
int wordSize, 
int numWords);
 
  280     const char* 
name, 
const void* 
data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  281   int CheckForErrorInternal(
int id);
 
  288   int SelectSocket(
int socket, 
unsigned long msec);
 
  301   int TagMessageLength;
 
  304   class vtkMessageBuffer;
 
  305   vtkMessageBuffer* ReceivedMessageBuffer;
 
  
vtkTypeBool PerformHandshake
Used to send/receive messages in a multiprocess environment.
Process communication using Sockets.
virtual int SendVoidArray(const void *data, vtkIdType length, int type, int remoteHandle, int tag)=0
Subclasses have to supply this method to send various arrays of data.
virtual int ReceiveVoidArray(void *data, vtkIdType maxlength, int type, int remoteHandle, int tag)=0
Subclasses have to supply this method to receive various arrays of data.
virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId)
A custom operation to use in a reduce command.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId)
virtual void Barrier()
Will block the processes until all other processes reach the Barrier function.
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation)
virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type)
Encapsulate a socket that accepts connections.
a simple class to control print indentation
virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId)
virtual void SetNumberOfProcesses(int num)
Set the number of processes you will be using.
virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId)
int SwapBytesInReceivedData
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type)
Encapsulates a client socket.
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId)
void BufferCurrentMessage()
This flag is cleared before vtkCommand::WrongTagEvent is fired when ever a message with mismatched ta...
virtual int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId)
Subclasses should reimplement these if they have a more efficient implementation.