00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00048 #ifndef __vtkMPIController_h
00049 #define __vtkMPIController_h
00050
00051 #include "vtkMultiProcessController.h"
00052
00053
00054
00055 #include "vtkMPICommunicator.h"
00056
00057 class VTK_PARALLEL_EXPORT vtkMPIController : public vtkMultiProcessController
00058 {
00059
00060 public:
00061
00062 static vtkMPIController *New();
00063 vtkTypeRevisionMacro(vtkMPIController,vtkMultiProcessController);
00064 void PrintSelf(ostream& os, vtkIndent indent);
00065
00067
00075 virtual void Initialize(int* argc, char*** argv)
00076 { this->Initialize(argc, argv, 0); }
00078
00079 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv),
00080 int initializedExternally);
00081
00084 virtual void Finalize() { this->Finalize(0); }
00085
00086 virtual void Finalize(int finalizedExternally);
00087
00090 virtual void SingleMethodExecute();
00091
00095 virtual void MultipleMethodExecute();
00096
00099 virtual void CreateOutputWindow();
00100
00103 static char* ErrorString(int err);
00104
00105
00111 void SetCommunicator(vtkMPICommunicator* comm);
00112
00113 virtual vtkMPIController *CreateSubController(vtkProcessGroup *group);
00114
00115
00116
00118
00123 int NoBlockSend(const int* data, int length, int remoteProcessId, int tag,
00124 vtkMPICommunicator::Request& req)
00125 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00126 (data ,length, remoteProcessId, tag, req); }
00127 int NoBlockSend(const unsigned long* data, int length, int remoteProcessId,
00128 int tag, vtkMPICommunicator::Request& req)
00129 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00130 (data, length, remoteProcessId, tag, req); }
00131 int NoBlockSend(const char* data, int length, int remoteProcessId,
00132 int tag, vtkMPICommunicator::Request& req)
00133 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00134 (data, length, remoteProcessId, tag, req); }
00135 int NoBlockSend(const float* data, int length, int remoteProcessId,
00136 int tag, vtkMPICommunicator::Request& req)
00137 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00138 (data, length, remoteProcessId, tag, req); }
00140
00142
00146 int NoBlockReceive(int* data, int length, int remoteProcessId,
00147 int tag, vtkMPICommunicator::Request& req)
00148 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00149 (data, length, remoteProcessId, tag, req); }
00150 int NoBlockReceive(unsigned long* data, int length,
00151 int remoteProcessId, int tag,
00152 vtkMPICommunicator::Request& req)
00153 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00154 (data, length, remoteProcessId, tag, req); }
00155 int NoBlockReceive(char* data, int length, int remoteProcessId,
00156 int tag, vtkMPICommunicator::Request& req)
00157 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00158 (data, length, remoteProcessId, tag, req); }
00159 int NoBlockReceive(float* data, int length, int remoteProcessId,
00160 int tag, vtkMPICommunicator::Request& req)
00161 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00162 (data, length, remoteProcessId, tag, req); }
00163 #ifdef VTK_USE_64BIT_IDS
00164 int NoBlockReceive(vtkIdType* data, int length, int remoteProcessId,
00165 int tag, vtkMPICommunicator::Request& req)
00166 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00167 (data, length, remoteProcessId, tag, req); }
00169 #endif
00170
00171
00172
00173 static const char* GetProcessorName();
00174
00175 protected:
00176 vtkMPIController();
00177 ~vtkMPIController();
00178
00179
00180 void InitializeCommunicator(vtkMPICommunicator* comm);
00181
00182
00183 void InitializeRMICommunicator();
00184
00185
00186
00187
00188
00189
00190 static vtkMPICommunicator* WorldRMICommunicator;
00191
00192
00193 friend class vtkMPIOutputWindow;
00194
00195
00196
00197 static int Initialized;
00198
00199 static char ProcessorName[];
00200
00201 private:
00202 vtkMPIController(const vtkMPIController&);
00203 void operator=(const vtkMPIController&);
00204 };
00205
00206
00207 #endif
00208
00209