37 #ifndef vtkSocketCommunicator_h 38 #define vtkSocketCommunicator_h 40 #include "vtkParallelCoreModule.h" 45 #ifdef VTK_WORDS_BIGENDIAN 46 # define vtkSwap4 vtkByteSwap::Swap4LE 47 # define vtkSwap4Range vtkByteSwap::Swap4LERange 48 # define vtkSwap8 vtkByteSwap::Swap8LE 49 # define vtkSwap8Range vtkByteSwap::Swap8LERange 51 # define vtkSwap4 vtkByteSwap::Swap4BE 52 # define vtkSwap4Range vtkByteSwap::Swap4BERange 53 # define vtkSwap8 vtkByteSwap::Swap8BE 54 # define vtkSwap8Range vtkByteSwap::Swap8BERange 72 virtual int WaitForConnection(
int port);
74 unsigned long msec = 0);
80 virtual void CloseConnection();
85 virtual int ConnectTo(
const char* hostName,
int port);
91 vtkGetMacro(SwapBytesInReceivedData,
int);
112 int remoteHandle,
int tag)
override;
114 int remoteHandle,
int tag)
override;
130 int srcProcessId)
override;
141 int srcProcessId)
override;
149 int operation,
int destProcessId)
override;
152 Operation *operation,
int destProcessId)
override;
155 int operation)
override;
167 vtkSetClampMacro(PerformHandshake,
vtkTypeBool, 0, 1);
177 virtual void SetLogStream(ostream* stream);
178 virtual ostream* GetLogStream();
188 virtual int LogToFile(
const char*
name);
189 virtual int LogToFile(
const char*
name,
int append);
196 vtkSetMacro(ReportErrors,
int);
197 vtkGetMacro(ReportErrors,
int);
219 int ServerSideHandshake();
226 int ClientSideHandshake();
233 vtkGetMacro(IsServer,
int);
240 static int GetVersion();
251 { this->BufferMessage =
true; }
256 bool HasBufferredMessages();
276 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
277 const char* logName);
278 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
279 const char* logName);
280 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
281 const char* logName);
283 int ReceivedTaggedFromBuffer(
284 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
289 void FixByteOrder(
void*
data,
int wordSize,
int numWords);
292 void LogTagged(
const char*
name,
const void*
data,
int wordSize,
int numWords,
293 int tag,
const char* logName);
294 int CheckForErrorInternal(
int id);
300 int SelectSocket(
int socket,
unsigned long msec);
312 int TagMessageLength;
315 class vtkMessageBuffer;
316 vtkMessageBuffer* ReceivedMessageBuffer;
void BufferCurrentMessage()
This flag is cleared before vtkCommand::WrongTagEvent is fired when ever a message with mismatched ta...
A custom operation to use in a reduce command.
virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
virtual int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool PerformHandshake
Process communication using Sockets.
Encapsulate a socket that accepts connections.
virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type)
Subclasses should reimplement these if they have a more efficient implementation. ...
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 ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
a simple class to control print indentation
virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
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 void SetNumberOfProcesses(int num)
Set the number of processes you will be using.
virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type)
Subclasses should reimplement these if they have a more efficient implementation. ...
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)
Subclasses should reimplement these if they have a more efficient implementation. ...
virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId)
Subclasses should reimplement these if they have a more efficient implementation. ...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Used to send/receive messages in a multiprocess environment.
Encapsulates a client socket.
int SwapBytesInReceivedData