MCPcopy Create free account
hub / github.com/Kitware/VTK / PartitionController

Method PartitionController

IO/MPIImage/vtkPNrrdReader.cxx:147–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145//------------------------------------------------------------------------------
146#ifdef VTK_USE_MPI_IO
147void vtkPNrrdReader::PartitionController(const int extent[6])
148{
149 // Number of points in the z direction of the whole data.
150 int numZ = this->DataExtent[5] - this->DataExtent[4] + 1;
151
152 if ((this->GetFileDimensionality() == 3) || (numZ == 1))
153 {
154 // Everyone reads from the same single file. No need to partition controller.
155 this->SetGroupedController(this->Controller);
156 return;
157 }
158
159 // The following algorithm will have overflow problems if there are more
160 // than 2^15 files. I doubt anyone will ever be crazy enough to set up a
161 // large 3D image with that many slice files, but just in case...
162 if (numZ >= 32768)
163 {
164 vtkErrorMacro("I do not support more than 32768 files.");
165 return;
166 }
167
168 // Hash the Z extent. This is guaranteed to be unique for any pair of
169 // extents (within the constraint given above).
170 int extentHash = (extent[4] + this->DataExtent[4] + (extent[5] + this->DataExtent[4]) * numZ);
171
172 vtkMultiProcessController* subController = this->Controller->PartitionController(extentHash, 0);
173 this->SetGroupedController(subController);
174 subController->Delete();
175}
176#else // VTK_USE_MPI_IO
177void vtkPNrrdReader::PartitionController(const int*)
178{

Callers 6

RequestDataMethod · 0.45
RequestDataMethod · 0.45
InitializeKdTreeMethod · 0.45
RequestDataMethod · 0.45

Calls 1

DeleteMethod · 0.65

Tested by

no test coverage detected