VTK  9.0.1
vtkProcessGroup.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkProcessGroup.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 /*----------------------------------------------------------------------------
17  Copyright (c) Sandia Corporation
18  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
19 ----------------------------------------------------------------------------*/
20 
45 #ifndef vtkProcessGroup_h
46 #define vtkProcessGroup_h
47 
48 #include "vtkObject.h"
49 #include "vtkParallelCoreModule.h" // For export macro
50 
52 class vtkCommunicator;
53 
54 class VTKPARALLELCORE_EXPORT vtkProcessGroup : public vtkObject
55 {
56 public:
57  vtkTypeMacro(vtkProcessGroup, vtkObject);
58  static vtkProcessGroup* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
67  void Initialize(vtkMultiProcessController* controller);
68  void Initialize(vtkCommunicator* communicator);
70 
72 
75  vtkGetObjectMacro(Communicator, vtkCommunicator);
77 
85  void SetCommunicator(vtkCommunicator* communicator);
86 
88 
91  vtkGetMacro(NumberOfProcessIds, int);
93 
100  int GetProcessId(int pos) { return this->ProcessIds[pos]; }
101 
106  int GetLocalProcessId();
107 
114  int FindProcessId(int processId);
115 
120  int AddProcessId(int processId);
121 
128  int RemoveProcessId(int processId);
129 
133  void RemoveAllProcessIds();
134 
138  void Copy(vtkProcessGroup* group);
139 
140 protected:
141  vtkProcessGroup();
142  ~vtkProcessGroup() override;
143 
146 
148 
149 private:
150  vtkProcessGroup(const vtkProcessGroup&) = delete;
151  void operator=(const vtkProcessGroup&) = delete;
152 };
153 
154 #endif // vtkProcessGroup_h
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:33
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.