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

Method RequestData

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:196–319  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

194
195//------------------------------------------------------------------------------
196int vtkPDistributedDataFilter::RequestData(vtkInformation* vtkNotUsed(request),
197 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
198{
199 TimeLog timer("D3::RequestData", this->Timing, true);
200 (void)timer;
201
202 // get the info objects
203 vtkInformation* outInfo = outputVector->GetInformationObject(0);
204
205 this->GhostLevel =
206 outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
207 this->GhostLevel = std::max(this->GhostLevel, this->MinimumGhostLevel);
208
209 // get the input and output
210 vtkDataSet* inputDS = vtkDataSet::GetData(inputVector[0], 0);
211 vtkUnstructuredGrid* outputUG = vtkUnstructuredGrid::GetData(outInfo);
212 if (inputDS && outputUG)
213 {
214 return this->RequestDataInternal(inputDS, outputUG);
215 }
216
217 vtkCompositeDataSet* inputCD = vtkCompositeDataSet::GetData(inputVector[0], 0);
218 vtkMultiBlockDataSet* outputMB = vtkMultiBlockDataSet::GetData(outputVector, 0);
219 if (!inputCD || !outputMB)
220 {
221 vtkErrorMacro("Input must either be a composite dataset or a vtkDataSet.");
222 return 0;
223 }
224
225 outputMB->CopyStructure(inputCD);
226
227 TimeLog::StartEvent("Classify leaves", this->Timing);
228 vtkSmartPointer<vtkCompositeDataIterator> iter;
229 iter.TakeReference(inputCD->NewIterator());
230 // We want to traverse over empty nodes as well. This ensures that this
231 // algorithm will work correctly in parallel.
232 iter->SkipEmptyNodesOff();
233
234 // Collect information about datatypes all the processes have at all the leaf
235 // nodes. Ideally all processes will either have the same type or an empty
236 // dataset. This assumes that all processes have the same composite structure.
237 std::vector<int> leafTypes;
238 for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
239 {
240 vtkDataObject* dObj = iter->GetCurrentDataObject();
241 if (dObj)
242 {
243 leafTypes.push_back(dObj->GetDataObjectType());
244 }
245 else
246 {
247 leafTypes.push_back(-1);
248 }
249 }
250 unsigned int numLeaves = static_cast<unsigned int>(leafTypes.size());
251
252 int myId = this->Controller->GetLocalProcessId();
253 int numProcs = this->Controller->GetNumberOfProcesses();

Callers

nothing calls this directly

Calls 15

RequestDataInternalMethod · 0.95
GetInformationObjectMethod · 0.80
GetDataObjectTypeMethod · 0.80
GetNumberOfProcessesMethod · 0.80
maxFunction · 0.50
GetDataFunction · 0.50
NewFunction · 0.50
GetMethod · 0.45
CopyStructureMethod · 0.45
TakeReferenceMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45

Tested by

no test coverage detected