00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkMPIGroup.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00031 #ifndef __vtkMPIGroup_h 00032 #define __vtkMPIGroup_h 00033 00034 #include "vtkObject.h" 00035 00036 class vtkMPIController; 00037 class vtkMPICommunicator; 00038 00039 class VTK_PARALLEL_EXPORT vtkMPIGroup : public vtkObject 00040 { 00041 00042 public: 00043 00044 vtkTypeRevisionMacro( vtkMPIGroup,vtkObject); 00045 00048 static vtkMPIGroup* New(); 00049 00050 virtual void PrintSelf(ostream& os, vtkIndent indent); 00051 00054 void Initialize(vtkMPIController* controller); 00055 00059 int AddProcessId(int processId); 00060 00063 void RemoveProcessId(int processId); 00064 00067 int FindProcessId(int processId); 00068 00071 int GetProcessId(int pos); 00072 00075 void CopyProcessIdsFrom(vtkMPIGroup* group); 00076 00078 00079 int GetNumberOfProcessIds() 00080 { 00081 return this->CurrentPosition; 00082 } 00084 00085 //BTX 00086 00087 friend class vtkMPICommunicator; 00088 00089 //ETX 00090 00091 protected: 00092 00095 void CopyFrom(vtkMPIGroup* group); 00096 00098 void Initialize(int numProcIds); 00099 00100 int* ProcessIds; 00101 int MaximumNumberOfProcessIds; 00102 int Initialized; 00103 int CurrentPosition; 00104 00105 vtkMPIGroup(); 00106 ~vtkMPIGroup(); 00107 00108 private: 00109 vtkMPIGroup(const vtkMPIGroup&); // Not implemented. 00110 void operator=(const vtkMPIGroup&); // Not implemented. 00111 }; 00112 00113 #endif 00114 00115 00116 00117