00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkMPIController_h
00046 #define __vtkMPIController_h
00047
00048 #include "vtkMultiProcessController.h"
00049
00050
00051
00052 #include "vtkMPICommunicator.h"
00053
00054 class VTK_PARALLEL_EXPORT vtkMPIController : public vtkMultiProcessController
00055 {
00056
00057 public:
00058
00059 static vtkMPIController *New();
00060 vtkTypeRevisionMacro(vtkMPIController,vtkMultiProcessController);
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062
00064
00072 virtual void Initialize(int* argc, char*** argv)
00073 { this->Initialize(argc, argv, 0); }
00075
00076 virtual void Initialize(int* vtkNotUsed(argc), char*** vtkNotUsed(argv),
00077 int initializedExternally);
00078
00081 virtual void Finalize() { this->Finalize(0); }
00082
00083 virtual void Finalize(int finalizedExternally);
00084
00087 virtual void SingleMethodExecute();
00088
00092 virtual void MultipleMethodExecute();
00093
00096 virtual void CreateOutputWindow();
00097
00100 static char* ErrorString(int err);
00101
00102
00108 void SetCommunicator(vtkMPICommunicator* comm);
00109
00110 virtual vtkMPIController *CreateSubController(vtkProcessGroup *group);
00111
00112
00113
00115
00120 int NoBlockSend(const int* data, int length, int remoteProcessId, int tag,
00121 vtkMPICommunicator::Request& req)
00122 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00123 (data ,length, remoteProcessId, tag, req); }
00124 int NoBlockSend(const unsigned long* data, int length, int remoteProcessId,
00125 int tag, vtkMPICommunicator::Request& req)
00126 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00127 (data, length, remoteProcessId, tag, req); }
00128 int NoBlockSend(const char* data, int length, int remoteProcessId,
00129 int tag, vtkMPICommunicator::Request& req)
00130 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00131 (data, length, remoteProcessId, tag, req); }
00132 int NoBlockSend(const float* data, int length, int remoteProcessId,
00133 int tag, vtkMPICommunicator::Request& req)
00134 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00135 (data, length, remoteProcessId, tag, req); }
00137
00139
00143 int NoBlockReceive(int* data, int length, int remoteProcessId,
00144 int tag, vtkMPICommunicator::Request& req)
00145 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00146 (data, length, remoteProcessId, tag, req); }
00147 int NoBlockReceive(unsigned long* data, int length,
00148 int remoteProcessId, int tag,
00149 vtkMPICommunicator::Request& req)
00150 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00151 (data, length, remoteProcessId, tag, req); }
00152 int NoBlockReceive(char* data, int length, int remoteProcessId,
00153 int tag, vtkMPICommunicator::Request& req)
00154 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00155 (data, length, remoteProcessId, tag, req); }
00156 int NoBlockReceive(float* data, int length, int remoteProcessId,
00157 int tag, vtkMPICommunicator::Request& req)
00158 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00159 (data, length, remoteProcessId, tag, req); }
00160 #ifdef VTK_USE_64BIT_IDS
00161 int NoBlockReceive(vtkIdType* data, int length, int remoteProcessId,
00162 int tag, vtkMPICommunicator::Request& req)
00163 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00164 (data, length, remoteProcessId, tag, req); }
00166 #endif
00167
00168
00169
00170 static const char* GetProcessorName();
00171
00173
00175 static void SetUseSsendForRMI(int use_send)
00176 { vtkMPIController::UseSsendForRMI = (use_send != 0)? 1: 0; }
00177 static int GetUseSsendForRMI() { return vtkMPIController::UseSsendForRMI; }
00179
00180 protected:
00181 vtkMPIController();
00182 ~vtkMPIController();
00183
00184
00185 void InitializeCommunicator(vtkMPICommunicator* comm);
00186
00187
00188 void InitializeRMICommunicator();
00189
00191
00194 virtual void TriggerRMIInternal(int remoteProcessId,
00195 void* arg, int argLength, int rmiTag, bool propagate);
00197
00198
00199
00200
00201
00202
00203 static vtkMPICommunicator* WorldRMICommunicator;
00204
00205 friend class vtkMPIOutputWindow;
00206
00207
00208 static int Initialized;
00209
00210 static char ProcessorName[];
00211
00213 static int UseSsendForRMI;
00214 private:
00215 vtkMPIController(const vtkMPIController&);
00216 void operator=(const vtkMPIController&);
00217
00218 };
00219
00220
00221 #endif
00222
00223