VTK  9.3.1
vtkProcessGroup.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
32 #ifndef vtkProcessGroup_h
33 #define vtkProcessGroup_h
34 
35 #include "vtkObject.h"
36 #include "vtkParallelCoreModule.h" // For export macro
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCommunicator;
41 
42 class VTKPARALLELCORE_EXPORT vtkProcessGroup : public vtkObject
43 {
44 public:
45  vtkTypeMacro(vtkProcessGroup, vtkObject);
46  static vtkProcessGroup* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
55  void Initialize(vtkMultiProcessController* controller);
56  void Initialize(vtkCommunicator* communicator);
58 
60 
63  vtkGetObjectMacro(Communicator, vtkCommunicator);
65 
73  void SetCommunicator(vtkCommunicator* communicator);
74 
76 
79  vtkGetMacro(NumberOfProcessIds, int);
81 
88  int GetProcessId(int pos) { return this->ProcessIds[pos]; }
89 
94  int GetLocalProcessId();
95 
102  int FindProcessId(int processId);
103 
108  int AddProcessId(int processId);
109 
116  int RemoveProcessId(int processId);
117 
121  void RemoveAllProcessIds();
122 
126  void Copy(vtkProcessGroup* group);
127 
128 protected:
129  vtkProcessGroup();
130  ~vtkProcessGroup() override;
131 
134 
136 
137 private:
138  vtkProcessGroup(const vtkProcessGroup&) = delete;
139  void operator=(const vtkProcessGroup&) = delete;
140 };
141 
142 VTK_ABI_NAMESPACE_END
143 #endif // vtkProcessGroup_h
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCommunicator * Communicator
a simple class to control print indentation
Definition: vtkIndent.h:28
int GetProcessId(int pos)
Given a position in the group, returns the id of the process in the communicator this group is based ...
A subgroup of processes from a communicator.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Used to send/receive messages in a multiprocess environment.
Multiprocessing communication superclass.