Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Servers/Filters/vtkMPIMoveData.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMPIMoveData.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00024 #ifndef __vtkMPIMoveData_h
00025 #define __vtkMPIMoveData_h
00026 
00027 #include "vtkDataSetToDataSetFilter.h"
00028 class vtkMultiProcessController;
00029 class vtkSocketController;
00030 class vtkMPIMToNSocketConnection;
00031 class vtkDataSet;
00032 class vtkIndent;
00033 
00034 class VTK_EXPORT vtkMPIMoveData : public vtkDataSetToDataSetFilter
00035 {
00036 public:
00037   static vtkMPIMoveData *New();
00038   vtkTypeRevisionMacro(vtkMPIMoveData, vtkDataSetToDataSetFilter);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040 
00042 
00044   virtual vtkPolyData* GetPolyDataOutput();
00045   virtual vtkUnstructuredGrid* GetUnstructuredGridOutput();
00046   virtual vtkDataSet* GetOutput();
00048 
00050 
00060   void SetController(vtkMultiProcessController* controller);
00061   void SetClientDataServerSocketController(vtkSocketController* sdc);
00062   void SetMPIMToNSocketConnection(vtkMPIMToNSocketConnection* sc);
00064   
00066 
00068   void SetServerToClient(){this->Server=vtkMPIMoveData::CLIENT;}
00069   void SetServerToDataServer(){this->Server=vtkMPIMoveData::DATA_SERVER;}
00070   void SetServerToRenderServer(){this->Server=vtkMPIMoveData::RENDER_SERVER;}
00071   vtkSetClampMacro(Server, int, vtkMPIMoveData::CLIENT, vtkMPIMoveData::RENDER_SERVER);
00073 
00075 
00076   void SetMoveModeToPassThrough(){this->MoveMode=vtkMPIMoveData::PASS_THROUGH;}
00077   void SetMoveModeToCollect(){this->MoveMode=vtkMPIMoveData::COLLECT;}
00078   void SetMoveModeToClone(){this->MoveMode=vtkMPIMoveData::CLONE;}
00079   vtkSetClampMacro(MoveMode, int, vtkMPIMoveData::PASS_THROUGH, vtkMPIMoveData::CLONE);
00081 
00083 
00086   vtkSetMacro(DefineCollectAsClone,int);
00087   vtkGetMacro(DefineCollectAsClone,int);
00088   vtkBooleanMacro(DefineCollectAsClone,int);
00090 
00092 
00093   void SetPassThrough(int v) 
00094     {if(v){this->SetMoveModeToPassThrough();} else {this->SetMoveModeToClone();}}
00095   void SetSocketController(vtkSocketController* c) {this->SetClientDataServerSocketController(c);}
00097 
00098 
00099 protected:
00100   vtkMPIMoveData();
00101   ~vtkMPIMoveData();
00102 
00103   // This is called by the superclass.
00104   // This is the method you should override.
00105   virtual int RequestDataObject(vtkInformation* request, 
00106                            vtkInformationVector** inputVector, 
00107                            vtkInformationVector* outputVector);
00108 
00109   vtkMultiProcessController* Controller;
00110   vtkSocketController* ClientDataServerSocketController;
00111   vtkMPIMToNSocketConnection* MPIMToNSocketConnection;
00112 
00113   // Data generation method
00114   virtual void ComputeInputUpdateExtents(vtkDataObject *output);
00115   virtual void Execute();
00116   virtual void ExecuteInformation();
00117 
00118   void DataServerAllToN(vtkDataSet* inData, vtkDataSet* outData, int n);
00119   void DataServerGatherAll(vtkDataSet* input, vtkDataSet* output);
00120   void DataServerGatherToZero(vtkDataSet* input, vtkDataSet* output);
00121   void DataServerSendToRenderServer(vtkDataSet* output);
00122   void RenderServerReceiveFromDataServer(vtkDataSet* output);
00123   void DataServerZeroSendToRenderServerZero(vtkDataSet* data);
00124   void RenderServerZeroReceiveFromDataServerZero(vtkDataSet* data);
00125   void RenderServerZeroBroadcast(vtkDataSet* data);
00126   void DataServerSendToClient(vtkDataSet* output);
00127   void ClientReceiveFromDataServer(vtkDataSet* output);
00128 
00129   int   NumberOfBuffers;
00130   int*  BufferLengths;
00131   int*  BufferOffsets;
00132   char* Buffers;
00133   int   BufferTotalLength;
00134 
00135   void ClearBuffer();
00136   void MarshalDataToBuffer(vtkDataSet* data);
00137   void ReconstructDataFromBuffer(vtkDataSet* data);
00138 
00139   int MoveMode;
00140   int Server;
00141 
00142   int DefineCollectAsClone;
00143 //BTX
00144   enum MoveModes {
00145     PASS_THROUGH=0,
00146     COLLECT=1,
00147     CLONE=2
00148   };
00149 //ETX
00150 
00151 //BTX
00152   enum Servers {
00153     CLIENT=0,
00154     DATA_SERVER=1,
00155     RENDER_SERVER=2
00156   };
00157 //ETX
00158 
00159 private:
00160   vtkMPIMoveData(const vtkMPIMoveData&); // Not implemented
00161   void operator=(const vtkMPIMoveData&); // Not implemented
00162 };
00163 
00164 #endif
00165 

Generated on Tue May 30 12:31:46 2006 for ParaView by doxygen 1.3.5