 |
VTK
9.0.1
|
Go to the documentation of this file.
34 #ifndef vtkSocketCommunicator_h
35 #define vtkSocketCommunicator_h
38 #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
87 vtkGetMacro(SwapBytesInReceivedData,
int);
126 int destProcessId)
override;
130 int srcProcessId)
override;
138 int operation,
int destProcessId)
override;
140 Operation* operation,
int destProcessId)
override;
142 const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
int operation)
override;
182 vtkSetMacro(ReportErrors,
int);
183 vtkGetMacro(ReportErrors,
int);
219 vtkGetMacro(IsServer,
int);
260 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
265 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
274 const char*
name,
const void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
282 int SelectSocket(
int socket,
unsigned long msec);
295 int TagMessageLength;
298 class vtkMessageBuffer;
299 vtkMessageBuffer* ReceivedMessageBuffer;
virtual int LogToFile(const char *name)
Log messages to the given file.
static vtkSocketCommunicator * New()
vtkTypeBool PerformHandshake
Used to send/receive messages in a multiprocess environment.
Process communication using Sockets.
virtual int LogToFile(const char *name, int append)
A custom operation to use in a reduce command.
int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation) override
int CheckForErrorInternal(int id)
void Barrier() override
This class foolishly breaks the conventions of the superclass, so this overload fixes the method.
int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId) override
int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId) override
virtual ostream * GetLogStream()
int ReceiveVoidArray(void *data, vtkIdType length, int type, int remoteHandle, int tag) override
Subclasses have to supply this method to receive various arrays of data.
int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId) override
void SetSocket(vtkClientSocket *)
int ReceiveTagged(void *data, int wordSize, int numWords, int tag, const char *logName)
virtual int ConnectTo(const char *hostName, int port)
Open a connection to host.
int ReceivePartialTagged(void *data, int wordSize, int numWords, int tag, const char *logName)
virtual int WaitForConnection(int port)
Wait for connection on a given port.
bool HasBufferredMessages()
Returns true if there are any messages in the receive buffer.
Encapsulate a socket that accepts connections.
int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type) override
static int GetVersion()
Uniquely identifies the version of this class.
~vtkSocketCommunicator() override
void SetNumberOfProcesses(int num) override
Set the number of processes you will be using.
int ReceivedTaggedFromBuffer(void *data, int wordSize, int numWords, int tag, const char *logName)
void FixByteOrder(void *data, int wordSize, int numWords)
Fix byte order for received data.
a simple class to control print indentation
int Handshake()
Performs handshake.
int SendTagged(const void *data, int wordSize, int numWords, int tag, const char *logName)
int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId) override
int SwapBytesInReceivedData
int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation) override
virtual void SetLogStream(ostream *stream)
Get/Set the output stream to which communications should be logged.
int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
Encapsulates a client socket.
int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId) override
int GetIsConnected()
Is the communicator connected?.
int SendVoidArray(const void *data, vtkIdType length, int type, int remoteHandle, int tag) override
Performs the actual communication.
int ClientSideHandshake()
Performs ClientSide handshake.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void BufferCurrentMessage()
This flag is cleared before vtkCommand::WrongTagEvent is fired when ever a message with mismatched ta...
virtual void CloseConnection()
Close a connection.
int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation, int destProcessId) override
int ServerSideHandshake()
Performs ServerSide handshake.
int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type) override
void LogTagged(const char *name, const void *data, int wordSize, int numWords, int tag, const char *logName)
virtual int WaitForConnection(vtkServerSocket *socket, unsigned long msec=0)