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 
47 #ifndef vtkProcessGroup_h
48 #define vtkProcessGroup_h
49 
50 #include "vtkParallelCoreModule.h" // For export macro
51 #include "vtkObject.h"
52 
54 class vtkCommunicator;
55 
57 {
58 public:
59  vtkTypeMacro(vtkProcessGroup, vtkObject);
60  static vtkProcessGroup *New();
61  virtual void PrintSelf(ostream &os, vtkIndent indent);
62 
64 
67  void Initialize(vtkMultiProcessController *controller);
68  void Initialize(vtkCommunicator *communicator);
70 
72 
73  vtkGetObjectMacro(Communicator, vtkCommunicator);
75 
81  void SetCommunicator(vtkCommunicator *communicator);
82 
84 
86  vtkGetMacro(NumberOfProcessIds, int);
88 
93  int GetProcessId(int pos) { return this->ProcessIds[pos]; }
94 
97  int GetLocalProcessId();
98 
103  int FindProcessId(int processId);
104 
107  int AddProcessId(int processId);
108 
113  int RemoveProcessId(int processId);
114 
117  void RemoveAllProcessIds();
118 
120  void Copy(vtkProcessGroup *group);
121 
122 protected:
123  vtkProcessGroup();
124  virtual ~vtkProcessGroup();
125 
128 
130 
131 private:
132  vtkProcessGroup(const vtkProcessGroup &); // Not implemented
133  void operator=(const vtkProcessGroup &); // Not implemented
134 };
135 
136 #endif //vtkProcessGroup_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTKPARALLELCORE_EXPORT
vtkCommunicator * Communicator
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
int GetProcessId(int pos)
A subgroup of processes from a communicator.
static vtkObject * New()
Used to send/receive messages in a multiprocess environment.
Multiprocessing communication superclass.