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 virtual vtkMPIController *PartitionController(int localColor, int localKey);
00113
00114
00115
00117
00122 int NoBlockSend(const int* data, int length, int remoteProcessId, int tag,
00123 vtkMPICommunicator::Request& req)
00124 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00125 (data ,length, remoteProcessId, tag, req); }
00126 int NoBlockSend(const unsigned long* data, int length, int remoteProcessId,
00127 int tag, vtkMPICommunicator::Request& req)
00128 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00129 (data, length, remoteProcessId, tag, req); }
00130 int NoBlockSend(const char* data, int length, int remoteProcessId,
00131 int tag, vtkMPICommunicator::Request& req)
00132 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00133 (data, length, remoteProcessId, tag, req); }
00134 int NoBlockSend(const float* data, int length, int remoteProcessId,
00135 int tag, vtkMPICommunicator::Request& req)
00136 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockSend
00137 (data, length, remoteProcessId, tag, req); }
00139
00141
00145 int NoBlockReceive(int* data, int length, int remoteProcessId,
00146 int tag, vtkMPICommunicator::Request& req)
00147 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00148 (data, length, remoteProcessId, tag, req); }
00149 int NoBlockReceive(unsigned long* data, int length,
00150 int remoteProcessId, int tag,
00151 vtkMPICommunicator::Request& req)
00152 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00153 (data, length, remoteProcessId, tag, req); }
00154 int NoBlockReceive(char* data, int length, int remoteProcessId,
00155 int tag, vtkMPICommunicator::Request& req)
00156 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00157 (data, length, remoteProcessId, tag, req); }
00158 int NoBlockReceive(float* data, int length, int remoteProcessId,
00159 int tag, vtkMPICommunicator::Request& req)
00160 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00161 (data, length, remoteProcessId, tag, req); }
00162 #ifdef VTK_USE_64BIT_IDS
00163 int NoBlockReceive(vtkIdType* data, int length, int remoteProcessId,
00164 int tag, vtkMPICommunicator::Request& req)
00165 { return ((vtkMPICommunicator*)this->Communicator)->NoBlockReceive
00166 (data, length, remoteProcessId, tag, req); }
00168 #endif
00169
00170
00171
00172 static const char* GetProcessorName();
00173
00175
00177 static void SetUseSsendForRMI(int use_send)
00178 { vtkMPIController::UseSsendForRMI = (use_send != 0)? 1: 0; }
00179 static int GetUseSsendForRMI() { return vtkMPIController::UseSsendForRMI; }
00181
00182 protected:
00183 vtkMPIController();
00184 ~vtkMPIController();
00185
00186
00187 void InitializeCommunicator(vtkMPICommunicator* comm);
00188
00189
00190 void InitializeRMICommunicator();
00191
00193
00196 virtual void TriggerRMIInternal(int remoteProcessId,
00197 void* arg, int argLength, int rmiTag, bool propagate);
00199
00200
00201
00202
00203
00204
00205 static vtkMPICommunicator* WorldRMICommunicator;
00206
00207 friend class vtkMPIOutputWindow;
00208
00209
00210 static int Initialized;
00211
00212 static char ProcessorName[];
00213
00215 static int UseSsendForRMI;
00216 private:
00217 vtkMPIController(const vtkMPIController&);
00218 void operator=(const vtkMPIController&);
00219
00220 };
00221
00222
00223 #endif
00224
00225