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 
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 
110 
117  int FindProcessId(int processId);
118 
123  int AddProcessId(int processId);
124 
131  int RemoveProcessId(int processId);
132 
137 
141  void Copy(vtkProcessGroup *group);
142 
143 protected:
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
vtkProcessGroup::NumberOfProcessIds
int NumberOfProcessIds
Definition: vtkProcessGroup.h:148
vtkCommunicator
Used to send/receive messages in a multiprocess environment.
Definition: vtkCommunicator.h:54
vtkProcessGroup::RemoveAllProcessIds
void RemoveAllProcessIds()
Removes all the processes ids from the group, leaving the group empty.
vtkProcessGroup::FindProcessId
int FindProcessId(int processId)
Given a process id in the communicator, this method returns its location in the group or -1 if it is ...
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkProcessGroup::Initialize
void Initialize(vtkCommunicator *communicator)
vtkProcessGroup::GetProcessId
int GetProcessId(int pos)
Given a position in the group, returns the id of the process in the communicator this group is based ...
Definition: vtkProcessGroup.h:103
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:83
vtkProcessGroup::ProcessIds
int * ProcessIds
Definition: vtkProcessGroup.h:147
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkProcessGroup::vtkProcessGroup
vtkProcessGroup()
vtkProcessGroup::~vtkProcessGroup
virtual ~vtkProcessGroup()
vtkProcessGroup::Communicator
vtkCommunicator * Communicator
Definition: vtkProcessGroup.h:150
vtkObject.h
vtkProcessGroup::SetCommunicator
void SetCommunicator(vtkCommunicator *communicator)
Set the communicator.
vtkProcessGroup
A subgroup of processes from a communicator.
Definition: vtkProcessGroup.h:58
vtkProcessGroup::New
static vtkProcessGroup * New()
vtkProcessGroup::Initialize
void Initialize(vtkMultiProcessController *controller)
Initialize the group to the given controller or communicator.
vtkProcessGroup::Copy
void Copy(vtkProcessGroup *group)
Copies the given group's communicator and process ids.
vtkProcessGroup::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkProcessGroup::GetLocalProcessId
int GetLocalProcessId()
Get the process id for the local process (as defined by the group's communicator).
vtkProcessGroup::RemoveProcessId
int RemoveProcessId(int processId)
Remove the given process id from the group (assuming it is in the group).
vtkProcessGroup::AddProcessId
int AddProcessId(int processId)
Add a process id to the end of the group (if it is not already in the group).