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

Method PartitionController

IO/MPIImage/vtkMPIImageReader.cxx:135–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

DeleteMethod · 0.65

Tested by

no test coverage detected