00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00058 #ifndef __vtkMPIController_h
00059 #define __vtkMPIController_h
00060
00061 #include "vtkMultiProcessController.h"
00062
00063
00064
00065 #include "vtkMPICommunicator.h"
00066
00067 class VTK_PARALLEL_EXPORT vtkMPIController : public vtkMultiProcessController
00068 {
00069
00070 public:
00071
00072 static vtkMPIController *New();
00073 vtkTypeRevisionMacro(vtkMPIController,vtkMultiProcessController);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00077
00085 virtual void Initialize(int* argc, char*** argv)
00086 { this->Initialize(argc, argv, 0); }
00088
00089 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv),
00090 int initializedExternally);
00091
00094 virtual void Finalize() { this->Finalize(0); }
00095
00096 virtual void Finalize(int finalizedExternally);
00097
00100 virtual void SingleMethodExecute();
00101
00105 virtual void MultipleMethodExecute();
00106
00109 void Barrier();
00110
00113 virtual void CreateOutputWindow();
00114
00117 static char* ErrorString(int err);
00118
00119
00125 void SetCommunicator(vtkMPICommunicator* comm);
00126
00127
00128
00130
00135 int NoBlockSend(int* data, int length, int remoteProcessId, int tag,
00136 vtkMPICommunicator::Request& req)
00137 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00138 (data ,length, remoteProcessId, tag, req); }
00139 int NoBlockSend(unsigned long* data, int length, int remoteProcessId,
00140 int tag, vtkMPICommunicator::Request& req)
00141 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00142 (data, length, remoteProcessId, tag, req); }
00143 int NoBlockSend(char* 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(float* data, int length, int remoteProcessId,
00148 int tag, vtkMPICommunicator::Request& req)
00149 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00150 (data, length, remoteProcessId, tag, req); }
00152
00154
00158 int NoBlockReceive(int* data, int length, int remoteProcessId,
00159 int tag, vtkMPICommunicator::Request& req)
00160 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00161 (data, length, remoteProcessId, tag, req); }
00162 int NoBlockReceive(unsigned long* data, int length,
00163 int remoteProcessId, int tag,
00164 vtkMPICommunicator::Request& req)
00165 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00166 (data, length, remoteProcessId, tag, req); }
00167 int NoBlockReceive(char* data, int length, int remoteProcessId,
00168 int tag, vtkMPICommunicator::Request& req)
00169 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00170 (data, length, remoteProcessId, tag, req); }
00171 int NoBlockReceive(float* data, int length, int remoteProcessId,
00172 int tag, vtkMPICommunicator::Request& req)
00173 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00174 (data, length, remoteProcessId, tag, req); }
00176
00177
00178
00179 static const char* GetProcessorName();
00180
00181 protected:
00182 vtkMPIController();
00183 ~vtkMPIController();
00184
00185
00186
00187
00188
00189 int InitializeNumberOfProcesses();
00190
00191
00192 void InitializeCommunicator(vtkMPICommunicator* comm);
00193
00194
00195 void InitializeRMICommunicator();
00196
00197
00198
00199
00200
00201
00202 static vtkMPICommunicator* WorldRMICommunicator;
00203
00204
00205 static int Initialized;
00206
00207 static char ProcessorName[];
00208
00209 private:
00210 vtkMPIController(const vtkMPIController&);
00211 void operator=(const vtkMPIController&);
00212 };
00213
00214
00215 #endif
00216
00217