VTK
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 
48 #ifndef vtkProcessGroup_h
49 #define vtkProcessGroup_h
50 
51 #include "vtkParallelCoreModule.h" // For export macro
52 #include "vtkObject.h"
53 
55 class vtkCommunicator;
56 
57 class VTKPARALLELCORE_EXPORT vtkProcessGroup : public vtkObject
58 {
59 public:
60  vtkTypeMacro(vtkProcessGroup, vtkObject);
61  static vtkProcessGroup *New();
62  virtual void PrintSelf(ostream &os, vtkIndent indent);
63 
65 
70  void Initialize(vtkMultiProcessController *controller);
71  void Initialize(vtkCommunicator *communicator);
73 
75 
78  vtkGetObjectMacro(Communicator, vtkCommunicator);
80 
88  void SetCommunicator(vtkCommunicator *communicator);
89 
91 
94  vtkGetMacro(NumberOfProcessIds, int);
96 
103  int GetProcessId(int pos) { return this->ProcessIds[pos]; }
104 
109  int GetLocalProcessId();
110 
117  int FindProcessId(int processId);
118 
123  int AddProcessId(int processId);
124 
131  int RemoveProcessId(int processId);
132 
136  void RemoveAllProcessIds();
137 
141  void Copy(vtkProcessGroup *group);
142 
143 protected:
144  vtkProcessGroup();
145  virtual ~vtkProcessGroup();
146 
149 
151 
152 private:
153  vtkProcessGroup(const vtkProcessGroup &) VTK_DELETE_FUNCTION;
154  void operator=(const vtkProcessGroup &) VTK_DELETE_FUNCTION;
155 };
156 
157 #endif //vtkProcessGroup_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
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.