00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00075 #ifndef __vtkMPIController_h
00076 #define __vtkMPIController_h
00077
00078 #include "mpi.h"
00079
00080 #include "vtkMultiProcessController.h"
00081 #include "vtkMPICommunicator.h"
00082
00083
00084 class VTK_PARALLEL_EXPORT vtkMPIController : public vtkMultiProcessController
00085 {
00086
00087 public:
00088
00089 static vtkMPIController *New();
00090 vtkTypeMacro(vtkMPIController,vtkMultiProcessController);
00091 void PrintSelf(ostream& os, vtkIndent indent);
00092
00101 virtual void Initialize(int* argc, char*** arcv);
00102
00105 virtual void Finalize();
00106
00109 virtual void SingleMethodExecute();
00110
00114 virtual void MultipleMethodExecute();
00115
00118 void Barrier();
00119
00122 virtual void CreateOutputWindow();
00123
00126 static char* ErrorString(int err);
00127
00128
00134 void SetCommunicator(vtkMPICommunicator* comm);
00135
00136
00137
00139
00144 int NoBlockSend(int* data, int length, int remoteProcessId, int tag,
00145 vtkMPICommunicator::Request& req)
00146 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00147 (data ,length, remoteProcessId, tag, req); }
00148 int NoBlockSend(unsigned long* data, int length, int remoteProcessId,
00149 int tag, vtkMPICommunicator::Request& req)
00150 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00151 (data, length, remoteProcessId, tag, req); }
00152 int NoBlockSend(char* data, int length, int remoteProcessId,
00153 int tag, vtkMPICommunicator::Request& req)
00154 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00155 (data, length, remoteProcessId, tag, req); }
00156 int NoBlockSend(float* data, int length, int remoteProcessId,
00157 int tag, vtkMPICommunicator::Request& req)
00158 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00159 (data, length, remoteProcessId, tag, req); }
00161
00163
00167 int NoBlockReceive(int* 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(unsigned long* data, int length,
00172 int remoteProcessId, int tag,
00173 vtkMPICommunicator::Request& req)
00174 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00175 (data, length, remoteProcessId, tag, req); }
00176 int NoBlockReceive(char* data, int length, int remoteProcessId,
00177 int tag, vtkMPICommunicator::Request& req)
00178 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00179 (data, length, remoteProcessId, tag, req); }
00180 int NoBlockReceive(float* data, int length, int remoteProcessId,
00181 int tag, vtkMPICommunicator::Request& req)
00182 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00183 (data, length, remoteProcessId, tag, req); }
00185
00186
00187
00188 protected:
00189
00190 vtkMPIController();
00191 ~vtkMPIController();
00192
00193
00194
00195
00196
00197 int InitializeNumberOfProcesses();
00198
00199
00200 void InitializeCommunicator(vtkMPICommunicator* comm);
00201
00202
00203 void InitializeRMICommunicator();
00204
00205
00206
00207
00208
00209
00210 static vtkMPICommunicator* WorldRMICommunicator;
00211
00212
00213 static int Initialized;
00214
00215
00216 private:
00217 vtkMPIController(const vtkMPIController&);
00218 void operator=(const vtkMPIController&);
00219 };
00220
00221
00222 #endif
00223
00224