00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00062 #ifndef __vtkMPIController_h
00063 #define __vtkMPIController_h
00064
00065 #include "vtkMultiProcessController.h"
00066
00067
00068
00069 #include "vtkMPICommunicator.h"
00070
00071 class VTK_PARALLEL_EXPORT vtkMPIController : public vtkMultiProcessController
00072 {
00073
00074 public:
00075
00076 static vtkMPIController *New();
00077 vtkTypeRevisionMacro(vtkMPIController,vtkMultiProcessController);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081
00089 virtual void Initialize(int* argc, char*** argv)
00090 { this->Initialize(argc, argv, 0); }
00092
00093 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv),
00094 int initializedExternally);
00095
00098 virtual void Finalize() { this->Finalize(0); }
00099
00100 virtual void Finalize(int finalizedExternally);
00101
00104 virtual void SingleMethodExecute();
00105
00109 virtual void MultipleMethodExecute();
00110
00113 void Barrier();
00114
00117 virtual void CreateOutputWindow();
00118
00121 static char* ErrorString(int err);
00122
00123
00129 void SetCommunicator(vtkMPICommunicator* comm);
00130
00131
00132
00134
00139 int NoBlockSend(int* data, int length, int remoteProcessId, int tag,
00140 vtkMPICommunicator::Request& req)
00141 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00142 (data ,length, remoteProcessId, tag, req); }
00143 int NoBlockSend(unsigned long* data, int length, int remoteProcessId,
00144 int tag, vtkMPICommunicator::Request& req)
00145 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00146 (data, length, remoteProcessId, tag, req); }
00147 int NoBlockSend(char* data, int length, int remoteProcessId,
00148 int tag, vtkMPICommunicator::Request& req)
00149 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00150 (data, length, remoteProcessId, tag, req); }
00151 int NoBlockSend(float* data, int length, int remoteProcessId,
00152 int tag, vtkMPICommunicator::Request& req)
00153 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00154 (data, length, remoteProcessId, tag, req); }
00156
00158
00162 int NoBlockReceive(int* data, int length, int remoteProcessId,
00163 int tag, vtkMPICommunicator::Request& req)
00164 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00165 (data, length, remoteProcessId, tag, req); }
00166 int NoBlockReceive(unsigned long* data, int length,
00167 int remoteProcessId, int tag,
00168 vtkMPICommunicator::Request& req)
00169 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00170 (data, length, remoteProcessId, tag, req); }
00171 int NoBlockReceive(char* data, int length, int remoteProcessId,
00172 int tag, vtkMPICommunicator::Request& req)
00173 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00174 (data, length, remoteProcessId, tag, req); }
00175 int NoBlockReceive(float* data, int length, int remoteProcessId,
00176 int tag, vtkMPICommunicator::Request& req)
00177 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00178 (data, length, remoteProcessId, tag, req); }
00180
00181
00182
00183 static const char* GetProcessorName();
00184
00185 protected:
00186 vtkMPIController();
00187 ~vtkMPIController();
00188
00189
00190
00191
00192
00193 int InitializeNumberOfProcesses();
00194
00195
00196 void InitializeCommunicator(vtkMPICommunicator* comm);
00197
00198
00199 void InitializeRMICommunicator();
00200
00201
00202
00203
00204
00205
00206 static vtkMPICommunicator* WorldRMICommunicator;
00207
00208
00209 static int Initialized;
00210
00211 static char ProcessorName[];
00212
00213 private:
00214 vtkMPIController(const vtkMPIController&);
00215 void operator=(const vtkMPIController&);
00216 };
00217
00218
00219 #endif
00220
00221