34 #ifndef vtkSocketCommunicator_h 35 #define vtkSocketCommunicator_h 37 #include "vtkParallelCoreModule.h" 42 #ifdef VTK_WORDS_BIGENDIAN 43 # define vtkSwap4 vtkByteSwap::Swap4LE 44 # define vtkSwap4Range vtkByteSwap::Swap4LERange 45 # define vtkSwap8 vtkByteSwap::Swap8LE 46 # define vtkSwap8Range vtkByteSwap::Swap8LERange 48 # define vtkSwap4 vtkByteSwap::Swap4BE 49 # define vtkSwap4Range vtkByteSwap::Swap4BERange 50 # define vtkSwap8 vtkByteSwap::Swap8BE 51 # define vtkSwap8Range vtkByteSwap::Swap8BERange 69 virtual int WaitForConnection(
int port);
71 unsigned long msec = 0);
77 virtual void CloseConnection();
82 virtual int ConnectTo(
const char* hostName,
int port);
88 vtkGetMacro(SwapBytesInReceivedData,
int);
109 int remoteHandle,
int tag) VTK_OVERRIDE;
111 int remoteHandle,
int tag) VTK_OVERRIDE;
127 int srcProcessId) VTK_OVERRIDE;
128 int GatherVoidArray(const
void *sendBuffer,
void *recvBuffer,
130 int GatherVVoidArray(const
void *sendBuffer,
void *recvBuffer,
132 vtkIdType *offsets,
int type,
int destProcessId) VTK_OVERRIDE;
133 int ScatterVoidArray(const
void *sendBuffer,
void *recvBuffer,
135 int ScatterVVoidArray(const
void *sendBuffer,
void *recvBuffer,
138 int srcProcessId) VTK_OVERRIDE;
139 int AllGatherVoidArray(const
void *sendBuffer,
void *recvBuffer,
141 int AllGatherVVoidArray(const
void *sendBuffer,
void *recvBuffer,
144 int ReduceVoidArray(const
void *sendBuffer,
void *recvBuffer,
146 int operation,
int destProcessId) VTK_OVERRIDE;
147 int ReduceVoidArray(const
void *sendBuffer,
void *recvBuffer,
149 Operation *operation,
int destProcessId) VTK_OVERRIDE;
150 int AllReduceVoidArray(const
void *sendBuffer,
void *recvBuffer,
152 int operation) VTK_OVERRIDE;
153 int AllReduceVoidArray(const
void *sendBuffer,
void *recvBuffer,
164 vtkSetClampMacro(PerformHandshake,
int, 0, 1);
166 vtkGetMacro(PerformHandshake,
int);
174 virtual
void SetLogStream(ostream* stream);
175 virtual ostream* GetLogStream();
185 virtual
int LogToFile(const
char*
name);
186 virtual
int LogToFile(const
char*
name,
int append);
194 vtkGetMacro(ReportErrors,
int);
216 int ServerSideHandshake();
223 int ClientSideHandshake();
230 vtkGetMacro(IsServer,
int);
237 static
int GetVersion();
247 void BufferCurrentMessage()
248 { this->BufferMessage =
true; }
253 bool HasBufferredMessages();
273 int SendTagged(const
void*
data,
int wordSize,
int numWords,
int tag,
274 const
char* logName);
275 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
276 const
char* logName);
277 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
278 const
char* logName);
280 int ReceivedTaggedFromBuffer(
281 void*
data,
int wordSize,
int numWords,
int tag, const
char* logName);
286 void FixByteOrder(
void*
data,
int wordSize,
int numWords);
289 void LogTagged(const
char*
name, const
void*
data,
int wordSize,
int numWords,
290 int tag, const
char* logName);
291 int CheckForErrorInternal(
int id);
297 int SelectSocket(
int socket,
unsigned long msec);
309 int TagMessageLength;
312 class vtkMessageBuffer;
313 vtkMessageBuffer* ReceivedMessageBuffer;
A custom operation to use in a reduce command.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Process communication using Sockets.
Encapsulate a socket that accepts connections.
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.
a simple class to control print indentation
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.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void Barrier()
Will block the processes until all other processes reach the Barrier function.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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