Go to the documentation of this file.
46 #include "vtkFiltersParallelModule.h"
122 vtkGetMacro(RegionAssignment,
int);
159 {
return &this->RegionAssignmentMap[0]; }
166 {
return static_cast<int>(this->RegionAssignmentMap.size()); }
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);
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);
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);
static const int ContiguousAssignment
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning.
static vtkPKdTree * New()
vtkIdType GetCellListsForProcessRegions(int ProcessId, vtkDataSet *set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
int ViewOrderAllProcessesFromPosition(const double cameraPosition[3], vtkIntArray *orderedList)
Return a list of all processes in order from front to back given a camera position.
int MultiProcessBuildLocator(double *bounds)
int GetCellArrayGlobalRange(const char *name, double range[2])
int GetTotalProcessesInRegion(int regionId)
Returns the total number of processes that have data falling within this spatial region.
vtkIdType GetTotalNumberOfCells()
Get the total number of cells distributed across the data files read by all processes.
Used to send/receive messages in a multiprocess environment.
int GetCellArrayGlobalRange(const char *name, float range[2])
An added feature of vtkPKdTree is that it will calculate the the global range of field arrays across ...
int GetProcessAssignedToRegion(int regionId)
Returns the ID of the process assigned to the region.
void PrintTables(ostream &os, vtkIndent indent)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int Select(int dim, float *c1, int *ids, int nvals, double &coord)
int HasData(int processId, int regionId)
Returns 1 if the process has data for the given region, 0 otherwise.
Build a k-d tree decomposition of a list of points.
scalable collective communication for a subset of members of a parallel VTK application
int CreateGlobalDataArrayBounds()
A convenience function which compiles the global bounds of the data arrays across processes.
int GetProcessCellCountForRegion(int processId, int regionId)
Returns the number of cells the specified process has in the specified region.
static const int NoRegionAssignment
int GetRegionsCellCountForProcess(int ProcessId, int *count, int len)
Writes to the supplied integer array the number of cells this process has for each region.
int GetCellArrayGlobalRange(int arrayIndex, float range[2])
void SetController(vtkMultiProcessController *c)
Set/Get the communicator object.
int AssignRegionsRoundRobin()
Let the PKdTree class assign a process to each region in a round robin fashion.
int GetPointArrayGlobalRange(int arrayIndex, float range[2])
Multiprocessing communication superclass.
int CreateProcessCellCountData()
Create tables of counts of cells per process per region.
a simple class to control print indentation
dynamic, self-adjusting array of int
int DivideRegion(vtkKdNode *kd, float *c1, int *ids, int nlevels)
list of point or cell ids
void BuildLocator() override
Build the spatial decomposition.
static const int RoundRobinAssignment
int GetCellArrayGlobalRange(int arrayIndex, double range[2])
vtkIdType GetCellListsForProcessRegions(int ProcessId, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
int GetRegionAssignmentMapLength()
/ Returns the number of regions in the region assignment map.
static const int UserDefinedAssignment
int AssignRegionsContiguous()
Let the PKdTree class assign a process to each region by assigning contiguous sets of spatial regions...
abstract class to specify dataset behavior
int AssignRegions(int *map, int numRegions)
Assign spatial regions to processes via a user defined map.
const int * GetRegionAssignmentMap()
Returns the region assignment map where index is the region and value is the processes id for that re...
int GetPointArrayGlobalRange(const char *name, float range[2])
int GetProcessesCellCountForRegion(int regionId, int *count, int len)
Writes the number of cells each process has for the region to the supplied list of length len.
int GetTotalRegionsForProcess(int processId)
Returns the total number of spatial regions that a given process has data for.
int GetRegionListForProcess(int processId, vtkIntArray *regions)
Adds the region IDs for which this process has data to the supplied vtkIntArray.
int GetProcessListForRegion(int regionId, vtkIntArray *processes)
Adds the list of processes having data for the given region to the supplied list, returns the number ...
a Kd-tree spatial decomposition of a set of points
int GetPointArrayGlobalRange(int arrayIndex, double range[2])
int ViewOrderAllProcessesInDirection(const double directionOfProjection[3], vtkIntArray *orderedList)
Return a list of all processes in order from front to back given a vector direction of projection.
void GetAllProcessesBorderingOnPoint(float x, float y, float z, vtkIntArray *list)
The k-d tree spatial regions have been assigned to processes.
void PrintTiming(ostream &os, vtkIndent indent) override
Print timing of k-d tree build.
int GetPointArrayGlobalRange(const char *name, double range[2])
void operator=(const vtkKdTree &)=delete
void SingleProcessBuildLocator()
vtkIdType GetCellListsForProcessRegions(int ProcessId, int set, vtkIdList *inRegionCells, vtkIdList *onBoundaryCells)
After regions have been assigned to processes, I may want to know which cells I have that are in the ...
int GetRegionAssignmentList(int procId, vtkIntArray *list)
Writes the list of region IDs assigned to the specified process.