VTK
vtkSubGroup.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ParaView
4 Module: vtkSubGroup.h
5
6 Copyright (c) Kitware, Inc.
7 All rights reserved.
8 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*----------------------------------------------------------------------------
16 Copyright (c) Sandia Corporation
17 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18----------------------------------------------------------------------------*/
19
42#ifndef vtkSubGroup_h
43#define vtkSubGroup_h
44
45#include "vtkParallelCoreModule.h" // For export macro
46#include "vtkObject.h"
47
49class vtkCommunicator;
50
51class VTKPARALLELCORE_EXPORT vtkSubGroup : public vtkObject
52{
53public:
54 vtkTypeMacro(vtkSubGroup, vtkObject);
55 virtual void PrintSelf(ostream &os, vtkIndent indent);
56 static vtkSubGroup *New();
57
58 // The wrapper gets confused here and falls down.
59 enum {MINOP = 1, MAXOP = 2, SUMOP = 3};
60
70 int Initialize(int p0, int p1, int me, int tag, vtkCommunicator *c);
71
72 int Gather(int *data, int *to, int length, int root);
73 int Gather(char *data, char *to, int length, int root);
74 int Gather(float *data, float *to, int length, int root);
75#ifdef VTK_USE_64BIT_IDS
76 int Gather(vtkIdType *data, vtkIdType *to, int length, int root);
77#endif
78 int Broadcast(float *data, int length, int root);
79 int Broadcast(double *data, int length, int root);
80 int Broadcast(int *data, int length, int root);
81 int Broadcast(char *data, int length, int root);
82#ifdef VTK_USE_64BIT_IDS
83 int Broadcast(vtkIdType *data, int length, int root);
84#endif
85 int ReduceSum(int *data, int *to, int length, int root);
86 int ReduceMax(float *data, float *to, int length, int root);
87 int ReduceMax(double *data, double *to, int length, int root);
88 int ReduceMax(int *data, int *to, int length, int root);
89 int ReduceMin(float *data, float *to, int length, int root);
90 int ReduceMin(double *data, double *to, int length, int root);
91 int ReduceMin(int *data, int *to, int length, int root);
92
93 int AllReduceUniqueList(int *list, int len, int **newList);
94 int MergeSortedUnique(int *list1, int len1, int *list2, int len2, int **newList);
95
96 void setGatherPattern(int root, int length);
97 int getLocalRank(int processID);
98
99 int Barrier();
100
101 void PrintSubGroup() const;
102
103 static int MakeSortedUnique(int *list, int len, int **newList);
104
105 int tag;
106
107protected:
110
111private:
112 int computeFanInTargets();
113 void restoreRoot(int rootLoc);
114 void moveRoot(int rootLoc);
115 void setUpRoot(int root);
116
117 int nFrom;
118 int nTo;
119
120 int sendId; // gather
121 int sendOffset;
122 int sendLength;
123
124 int recvId[20];
125 int recvOffset[20];
126 int recvLength[20];
127 int fanInFrom[20]; // reduce, broadcast
128
129 int fanInTo;
130 int nSend;
131 int nRecv;
132 int gatherRoot;
133 int gatherLength;
134
135 int *members;
136 int nmembers;
137 int myLocalRank;
138
139 vtkCommunicator *comm;
140
141 vtkSubGroup(const vtkSubGroup&) VTK_DELETE_FUNCTION;
142 void operator=(const vtkSubGroup&) VTK_DELETE_FUNCTION;
143};
144#endif
Used to send/receive messages in a multiprocess environment.
a simple class to control print indentation
Definition: vtkIndent.h:40
Multiprocessing communication superclass.
abstract base class for most VTK objects
Definition: vtkObject.h:60
scalable collective communication for a subset of members of a parallel VTK application
Definition: vtkSubGroup.h:52
int Gather(float *data, float *to, int length, int root)
int ReduceMin(int *data, int *to, int length, int root)
void PrintSubGroup() const
void setGatherPattern(int root, int length)
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int Broadcast(float *data, int length, int root)
int Gather(char *data, char *to, int length, int root)
int ReduceMin(float *data, float *to, int length, int root)
int Broadcast(char *data, int length, int root)
int Broadcast(double *data, int length, int root)
int MergeSortedUnique(int *list1, int len1, int *list2, int len2, int **newList)
int Broadcast(int *data, int length, int root)
static vtkSubGroup * New()
int Gather(int *data, int *to, int length, int root)
int ReduceMax(int *data, int *to, int length, int root)
int ReduceSum(int *data, int *to, int length, int root)
int Initialize(int p0, int p1, int me, int tag, vtkCommunicator *c)
Initialize a communication subgroup for the processes with rank p0 through p1 of the given communicat...
int AllReduceUniqueList(int *list, int len, int **newList)
int ReduceMax(float *data, float *to, int length, int root)
int getLocalRank(int processID)
int ReduceMax(double *data, double *to, int length, int root)
int ReduceMin(double *data, double *to, int length, int root)
static int MakeSortedUnique(int *list, int len, int **newList)
@ length
Definition: vtkX3D.h:393
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:287