40 #ifndef vtkSocketCommunicator_h
41 #define vtkSocketCommunicator_h
44 #include "vtkEndian.h"
45 #include "vtkParallelCoreModule.h"
49 #ifdef VTK_WORDS_BIGENDIAN
50 #define vtkSwap4 vtkByteSwap::Swap4LE
51 #define vtkSwap4Range vtkByteSwap::Swap4LERange
52 #define vtkSwap8 vtkByteSwap::Swap8LE
53 #define vtkSwap8Range vtkByteSwap::Swap8LERange
55 #define vtkSwap4 vtkByteSwap::Swap4BE
56 #define vtkSwap4Range vtkByteSwap::Swap4BERange
57 #define vtkSwap8 vtkByteSwap::Swap8BE
58 #define vtkSwap8Range vtkByteSwap::Swap8BERange
76 virtual int WaitForConnection(
int port);
77 virtual int WaitForConnection(
vtkServerSocket* socket,
unsigned long msec = 0);
83 virtual void CloseConnection();
88 virtual int ConnectTo(
const char* hostName,
int port);
94 vtkGetMacro(SwapBytesInReceivedData,
int);
100 int GetIsConnected();
133 int destProcessId)
override;
137 int srcProcessId)
override;
145 int operation,
int destProcessId)
override;
147 Operation* operation,
int destProcessId)
override;
149 const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
int operation)
override;
160 vtkSetClampMacro(PerformHandshake,
vtkTypeBool, 0, 1);
170 virtual void SetLogStream(ostream* stream);
171 virtual ostream* GetLogStream();
181 virtual int LogToFile(
const char*
name);
182 virtual int LogToFile(
const char*
name,
int append);
189 vtkSetMacro(ReportErrors,
int);
190 vtkGetMacro(ReportErrors,
int);
212 int ServerSideHandshake();
219 int ClientSideHandshake();
226 vtkGetMacro(IsServer,
int);
233 static int GetVersion();
248 bool HasBufferredMessages();
267 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
268 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
269 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
271 int ReceivedTaggedFromBuffer(
272 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
277 void FixByteOrder(
void*
data,
int wordSize,
int numWords);
281 const char*
name,
const void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
282 int CheckForErrorInternal(
int id);
289 int SelectSocket(
int socket,
unsigned long msec);
302 int TagMessageLength;
305 class vtkMessageBuffer;
306 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