vtkMPIMoveData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMPIMoveData.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkMPIMoveData_h
27 #define vtkMPIMoveData_h
28 
29 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" //needed for exports
31 
35 class vtkDataSet;
36 class vtkIndent;
37 
39 {
40 public:
41  static vtkMPIMoveData* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49  virtual void InitializeForCommunicationForParaView();
50 
52 
66  void SetController(vtkMultiProcessController* controller);
67  void SetMPIMToNSocketConnection(vtkMPIMToNSocketConnection* sc);
68  void SetClientDataServerSocketController(vtkMultiProcessController*);
69  vtkGetObjectMacro(ClientDataServerSocketController, vtkMultiProcessController);
71 
73 
77  void SetServerToClient() { this->Server = vtkMPIMoveData::CLIENT; }
80  vtkSetClampMacro(Server, int, vtkMPIMoveData::CLIENT, vtkMPIMoveData::RENDER_SERVER);
81  vtkGetMacro(Server, int);
83 
88  void SetMoveModeToCollect() { this->MoveMode = vtkMPIMoveData::COLLECT; }
89  void SetMoveModeToClone() { this->MoveMode = vtkMPIMoveData::CLONE; }
90  vtkSetClampMacro(
92 
94 
102  vtkSetMacro(OutputDataType, int);
103  vtkGetMacro(OutputDataType, int);
105 
107 
112  static void SetUseZLibCompression(bool b);
113  static bool GetUseZLibCompression();
115 
122  bool GetOutputGeneratedOnProcess();
123 
125 
130  vtkSetMacro(SkipDataServerGatherToZero, bool);
131  vtkGetMacro(SkipDataServerGatherToZero, bool);
133 
135  {
136  PASS_THROUGH = 0,
137  COLLECT = 1,
138  CLONE = 2,
139  COLLECT_AND_PASS_THROUGH = 3,
140  INVALID
141  };
142 
143 protected:
144  vtkMPIMoveData();
145  ~vtkMPIMoveData() override;
146 
147  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
148  vtkInformationVector* outputVector) override;
149  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
150  vtkInformationVector* outputVector) override;
151  int FillInputPortInformation(int port, vtkInformation* info) override;
152 
156 
157  void DataServerAllToN(vtkDataObject* inData, vtkDataObject* outData, int n);
158  void DataServerGatherAll(vtkDataObject* input, vtkDataObject* output);
159  void DataServerGatherToZero(vtkDataObject* input, vtkDataObject* output);
160  void DataServerSendToRenderServer(vtkDataObject* output);
161  void RenderServerReceiveFromDataServer(vtkDataObject* output);
162  void DataServerZeroSendToRenderServerZero(vtkDataObject* data);
163  void RenderServerZeroReceiveFromDataServerZero(vtkDataObject* data);
164  void RenderServerZeroBroadcast(vtkDataObject* data);
165  void DataServerSendToClient(vtkDataObject* output);
166  void ClientReceiveFromDataServer(vtkDataObject* output);
167 
171  char* Buffers;
173 
174  void ClearBuffer();
175  void MarshalDataToBuffer(vtkDataObject* data);
176  void ReconstructDataFromBuffer(vtkDataObject* data);
177 
178  int MoveMode;
179  int Server;
180 
182 
183  enum Servers
184  {
185  CLIENT = 0,
186  DATA_SERVER = 1,
187  RENDER_SERVER = 2
188  };
189 
191 
192 private:
193  int UpdateNumberOfPieces;
194  int UpdatePiece;
195 
196  vtkMPIMoveData(const vtkMPIMoveData&) = delete;
197  void operator=(const vtkMPIMoveData&) = delete;
198 
199  static bool UseZLibCompression;
200 };
201 
202 #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.