vtkMPIMoveData.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkMPIMoveData_h
16 #define vtkMPIMoveData_h
17 
18 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" //needed for exports
20 
24 class vtkDataSet;
25 class vtkIndent;
26 
28 {
29 public:
30  static vtkMPIMoveData* New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
38  virtual void InitializeForCommunicationForParaView();
39 
41 
55  void SetController(vtkMultiProcessController* controller);
56  void SetMPIMToNSocketConnection(vtkMPIMToNSocketConnection* sc);
57  void SetClientDataServerSocketController(vtkMultiProcessController*);
58  vtkGetObjectMacro(ClientDataServerSocketController, vtkMultiProcessController);
60 
62 
66  void SetServerToClient() { this->Server = vtkMPIMoveData::CLIENT; }
69  vtkSetClampMacro(Server, int, vtkMPIMoveData::CLIENT, vtkMPIMoveData::RENDER_SERVER);
70  vtkGetMacro(Server, int);
72 
77  void SetMoveModeToCollect() { this->MoveMode = vtkMPIMoveData::COLLECT; }
78  void SetMoveModeToClone() { this->MoveMode = vtkMPIMoveData::CLONE; }
79  vtkSetClampMacro(
81 
83 
91  vtkSetMacro(OutputDataType, int);
92  vtkGetMacro(OutputDataType, int);
94 
96 
101  static void SetUseZLibCompression(bool b);
102  static bool GetUseZLibCompression();
104 
111  bool GetOutputGeneratedOnProcess();
112 
114 
119  vtkSetMacro(SkipDataServerGatherToZero, bool);
120  vtkGetMacro(SkipDataServerGatherToZero, bool);
122 
124  {
125  PASS_THROUGH = 0,
126  COLLECT = 1,
127  CLONE = 2,
128  COLLECT_AND_PASS_THROUGH = 3,
129  INVALID
130  };
131 
132 protected:
133  vtkMPIMoveData();
134  ~vtkMPIMoveData() override;
135 
136  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
137  vtkInformationVector* outputVector) override;
138  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
139  vtkInformationVector* outputVector) override;
140  int FillInputPortInformation(int port, vtkInformation* info) override;
141 
145 
146  void DataServerAllToN(vtkDataObject* inData, vtkDataObject* outData, int n);
147  void DataServerGatherAll(vtkDataObject* input, vtkDataObject* output);
148  void DataServerGatherToZero(vtkDataObject* input, vtkDataObject* output);
149  void DataServerSendToRenderServer(vtkDataObject* output);
150  void RenderServerReceiveFromDataServer(vtkDataObject* output);
151  void DataServerZeroSendToRenderServerZero(vtkDataObject* data);
152  void RenderServerZeroReceiveFromDataServerZero(vtkDataObject* data);
153  void RenderServerZeroBroadcast(vtkDataObject* data);
154  void DataServerSendToClient(vtkDataObject* output);
155  void ClientReceiveFromDataServer(vtkDataObject* output);
156 
160  char* Buffers;
162 
163  void ClearBuffer();
164  void MarshalDataToBuffer(vtkDataObject* data);
165  void ReconstructDataFromBuffer(vtkDataObject* data);
166 
167  int MoveMode;
168  int Server;
169 
171 
172  enum Servers
173  {
174  CLIENT = 0,
175  DATA_SERVER = 1,
176  RENDER_SERVER = 2
177  };
178 
180 
181 private:
182  int UpdateNumberOfPieces;
183  int UpdatePiece;
184 
185  vtkMPIMoveData(const vtkMPIMoveData&) = delete;
186  void operator=(const vtkMPIMoveData&) = delete;
187 
188  static bool UseZLibCompression;
189 };
190 
191 #endif
vtkIdType * BufferOffsets
void SetMoveModeToCollect()
vtkMultiProcessController * ClientDataServerSocketController
vtkMPIMToNSocketConnection * MPIMToNSocketConnection
bool SkipDataServerGatherToZero
vtkIdType * BufferLengths
virtual int UpdatePiece(int piece, int numPieces, int ghostLevels, const int extents[6]=0)
int vtkIdType
void SetServerToDataServer()
Tell the object on which client/server it resides.
virtual int FillInputPortInformation(int port, vtkInformation *info)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkIdType BufferTotalLength
class to create socket connections between two servers
vtkMultiProcessController * Controller
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
Moves/redistributes data between processes.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetServerToClient()
Tell the object on which client/server it resides.
void SetServerToRenderServer()
Tell the object on which client/server it resides.
void SetMoveModeToClone()
void operator=(const vtkObjectBase &)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkPassInputTypeAlgorithm * New()
void SetMoveModeToPassThrough()
Specify how the data is to be redistributed.