Go to the documentation of this file.
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
74 unsigned long msec = 0);
91 vtkGetMacro(SwapBytesInReceivedData,
int);
112 int remoteHandle,
int tag);
114 int remoteHandle,
int tag);
149 int operation,
int destProcessId);
152 Operation *operation,
int destProcessId);
167 vtkSetClampMacro(PerformHandshake,
int, 0, 1);
169 vtkGetMacro(PerformHandshake,
int);
197 vtkGetMacro(ReportErrors,
int);
233 vtkGetMacro(IsServer,
int);
251 { this->BufferMessage =
true; }
277 const char* logName);
279 const char* logName);
281 const char* logName);
284 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
293 int tag,
const char* logName);
300 int SelectSocket(
int socket,
unsigned long msec);
312 int TagMessageLength;
315 class vtkMessageBuffer;
316 vtkMessageBuffer* ReceivedMessageBuffer;
virtual int LogToFile(const char *name)
Log messages to the given file.
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation, int destProcessId)
static vtkSocketCommunicator * New()
virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId)
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.
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation)
int CheckForErrorInternal(int id)
virtual int SendVoidArray(const void *data, vtkIdType length, int type, int remoteHandle, int tag)
Performs the actual communication.
virtual ostream * GetLogStream()
virtual void Barrier()
This class foolishly breaks the conventions of the superclass, so this overload fixes the method.
void SetSocket(vtkClientSocket *)
int ReceiveTagged(void *data, int wordSize, int numWords, int tag, const char *logName)
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId)
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.
static int GetVersion()
Uniquely identifies the version of this class.
virtual int ReceiveVoidArray(void *data, vtkIdType length, int type, int remoteHandle, int tag)
Subclasses have to supply this method to receive various arrays of data.
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 SwapBytesInReceivedData
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
virtual void SetLogStream(ostream *stream)
Get/Set the output stream to which communications should be logged.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation)
Encapsulates a client socket.
virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type)
int GetIsConnected()
Is the communicator connected?.
virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId)
virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId)
int ClientSideHandshake()
Performs ClientSide handshake.
void BufferCurrentMessage()
This flag is cleared before vtkCommand::WrongTagEvent is fired when ever a message with mismatched ta...
virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId)
virtual void CloseConnection()
Close a connection.
virtual void SetNumberOfProcesses(int num)
Set the number of processes you will be using.
virtual int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId)
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type)
int ServerSideHandshake()
Performs ServerSide handshake.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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)