46 #include "vtkFiltersParallelModule.h" 65 void PrintTables(ostream& os,
vtkIndent indent);
92 int CreateProcessCellCountData();
102 int CreateGlobalDataArrayBounds();
122 vtkGetMacro(RegionAssignment,
int);
135 int AssignRegions(
int *map,
int numRegions);
142 int AssignRegionsRoundRobin();
152 int AssignRegionsContiguous();
159 {
return &this->RegionAssignmentMap[0]; }
166 {
return static_cast<int>(this->RegionAssignmentMap.size()); }
174 int GetRegionAssignmentList(
int procId,
vtkIntArray *list);
184 void GetAllProcessesBorderingOnPoint(
float x,
float y,
float z,
190 int GetProcessAssignedToRegion(
int regionId);
196 int HasData(
int processId,
int regionId);
202 int GetProcessCellCountForRegion(
int processId,
int regionId);
208 int GetTotalProcessesInRegion(
int regionId);
215 int GetProcessListForRegion(
int regionId,
vtkIntArray *processes);
224 int GetProcessesCellCountForRegion(
int regionId,
int *count,
int len);
230 int GetTotalRegionsForProcess(
int processId);
236 int GetRegionListForProcess(
int processId,
vtkIntArray *regions);
245 int GetRegionsCellCountForProcess(
int ProcessId,
int *count,
int len);
273 vtkIdType GetCellListsForProcessRegions(
int ProcessId,
int set,
277 vtkIdType GetCellListsForProcessRegions(
int ProcessId,
289 int ViewOrderAllProcessesInDirection(
const double directionOfProjection[3],
299 int ViewOrderAllProcessesFromPosition(
const double cameraPosition[3],
310 int GetCellArrayGlobalRange(
const char *
name,
float range[2]);
311 int GetPointArrayGlobalRange(
const char *name,
float range[2]);
312 int GetCellArrayGlobalRange(
const char *name,
double range[2]);
313 int GetPointArrayGlobalRange(
const char *name,
double range[2]);
315 int GetCellArrayGlobalRange(
int arrayIndex,
double range[2]);
316 int GetPointArrayGlobalRange(
int arrayIndex,
double range[2]);
317 int GetCellArrayGlobalRange(
int arrayIndex,
float range[2]);
318 int GetPointArrayGlobalRange(
int arrayIndex,
float range[2]);
325 void SingleProcessBuildLocator();
326 int MultiProcessBuildLocator(
double *bounds);
330 int RegionAssignment;
336 void StrDupWithNew(
const char *s,
std::string& output);
344 std::vector<int> RegionAssignmentMap;
345 std::vector<std::vector<int> > ProcessAssignmentMap;
346 std::vector<int> NumRegionsAssigned;
348 int UpdateRegionAssignment();
353 std::vector<char> DataLocationMap;
355 std::vector<int> NumProcessesInRegion;
356 std::vector<std::vector<int> > ProcessList;
358 std::vector<int> NumRegionsInProcess;
359 std::vector<std::vector<int> > ParallelRegionList;
361 std::vector<std::vector<vtkIdType> > CellCountList;
363 std::vector<double> CellDataMin;
364 std::vector<double> CellDataMax;
365 std::vector<double> PointDataMin;
366 std::vector<double> PointDataMax;
367 std::vector<std::string> CellDataName;
368 std::vector<std::string> PointDataName;
374 int BuildGlobalIndexLists(
vtkIdType ncells);
376 std::vector<vtkIdType> StartVal;
377 std::vector<vtkIdType> EndVal;
378 std::vector<vtkIdType> NumCells;
384 int _whoHas(
int L,
int R,
int pos);
385 float *GetLocalVal(
int pos);
386 float *GetLocalValNext(
int pos);
387 void SetLocalVal(
int pos,
float *val);
388 void ExchangeVals(
int pos1,
int pos2);
389 void ExchangeLocalVals(
int pos1,
int pos2);
395 float *CurrentPtArray;
399 std::vector<int> SelectBuffer;
403 int AllCheckForFailure(
int rc,
const char *where,
const char *how);
404 void AllCheckParameters();
411 bool VolumeBounds(
double*);
413 int BreadthFirstDivide(
double *bounds);
414 void enQueueNode(
vtkKdNode *kd,
int L,
int level,
int tag);
417 int Select(
int dim,
int L,
int R);
418 void _select(
int L,
int R,
int K,
int dim);
419 void DoTransfer(
int from,
int to,
int fromIndex,
int toIndex,
int count);
421 int *PartitionAboutMyValue(
int L,
int R,
int K,
int dim);
422 int *PartitionAboutOtherValue(
int L,
int R,
float T,
int dim);
423 int *PartitionSubArray(
int L,
int R,
int K,
int dim,
int p1,
int p2);
426 #ifdef YIELDS_INCONSISTENT_REGION_BOUNDARIES 427 void RetrieveData(
vtkKdNode *kd,
int *buf);
429 void ReduceData(
vtkKdNode *kd,
int *sources);
433 void GetDataBounds(
int L,
int K,
int R,
float dataBounds[12]);
434 void GetLocalMinMax(
int L,
int R,
int me,
float *min,
float *
max);
436 static int FillOutTree(
vtkKdNode *kd,
int level);
439 static void UnpackData(
vtkKdNode *kd,
double *data);
440 static void CheckFixRegionBoundaries(
vtkKdNode *tree);
444 int AllocateDoubleBuffer();
445 void FreeDoubleBuffer();
446 void SwitchDoubleBuffer();
447 void AllocateSelectBuffer();
448 void FreeSelectBuffer();
450 void InitializeGlobalIndexLists();
451 void AllocateAndZeroGlobalIndexLists();
452 void FreeGlobalIndexLists();
453 void InitializeRegionAssignmentLists();
454 void AllocateAndZeroRegionAssignmentLists();
455 void FreeRegionAssignmentLists();
456 void InitializeProcessDataLists();
457 void AllocateAndZeroProcessDataLists();
458 void FreeProcessDataLists();
459 void InitializeFieldArrayMinMax();
460 void AllocateAndZeroFieldArrayMinMax();
461 void FreeFieldArrayMinMax();
463 void ReleaseTables();
467 void AddProcessRegions(
int procId,
vtkKdNode *kd);
468 void BuildRegionListsForProcesses();
472 bool CollectLocalRegionProcessData(std::vector<int>&);
473 int BuildRegionProcessTables();
474 int BuildFieldArrayMinMax();
475 void AddEntry(
int *list,
int len,
int id);
476 #ifdef VTK_USE_64BIT_IDS 481 static int FindNextLocalArrayIndex(
const char *n,
const std::vector<std::string>& names,
482 int len,
int start=0);
int DivideRegion(vtkKdNode *kd, float *c1, int *ids, int nlevels)
void operator=(const vtkKdTree &)=delete
static const int RoundRobinAssignment
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning...
const int * GetRegionAssignmentMap()
Returns the region assignment map where index is the region and value is the processes id for that re...
Build a k-d tree decomposition of a list of points.
int GetRegionAssignmentMapLength()
/ Returns the number of regions in the region assignment map.
abstract class to specify dataset behavior
vtkIdType GetTotalNumberOfCells()
Get the total number of cells distributed across the data files read by all processes.
void BuildLocator() override
Create the k-d tree decomposition of the cells of the data set or data sets.
dynamic, self-adjusting array of int
a simple class to control print indentation
list of point or cell ids
static const int ContiguousAssignment
static int Select(int dim, float *c1, int *ids, int nvals, double &coord)
virtual void PrintTiming(ostream &os, vtkIndent indent)
Print timing of k-d tree build.
scalable collective communication for a subset of members of a parallel VTK application ...
static const int NoRegionAssignment
a Kd-tree spatial decomposition of a set of points
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static const int UserDefinedAssignment
Used to send/receive messages in a multiprocess environment.
Multiprocessing communication superclass.