------------------------------------------------------------------------------
| 320 | |
| 321 | //------------------------------------------------------------------------------ |
| 322 | int vtkPDistributedDataFilter::RequestDataInternal(vtkDataSet* input, vtkUnstructuredGrid* output) |
| 323 | { |
| 324 | TimeLog timer("RequestDataInternal", this->Timing); |
| 325 | (void)timer; |
| 326 | |
| 327 | this->NextProgressStep = 0; |
| 328 | int progressSteps = 5 + this->GhostLevel; |
| 329 | if (this->ClipCells) |
| 330 | { |
| 331 | progressSteps++; |
| 332 | } |
| 333 | |
| 334 | this->ProgressIncrement = 1.0 / (double)progressSteps; |
| 335 | |
| 336 | this->UpdateProgress(this->NextProgressStep++ * this->ProgressIncrement); |
| 337 | this->SetProgressText("Begin data redistribution"); |
| 338 | |
| 339 | if (this->NumProcesses == 1) |
| 340 | { |
| 341 | this->SingleProcessExecute(input, output); |
| 342 | this->UpdateProgress(1.0); |
| 343 | return 1; |
| 344 | } |
| 345 | |
| 346 | // This method requires an MPI controller. |
| 347 | |
| 348 | int aok = 0; |
| 349 | |
| 350 | if (vtkMPIController::SafeDownCast(this->Controller)) |
| 351 | { |
| 352 | aok = 1; |
| 353 | } |
| 354 | |
| 355 | if (!aok) |
| 356 | { |
| 357 | vtkErrorMacro(<< "vtkPDistributedDataFilter multiprocess requires MPI"); |
| 358 | return 1; |
| 359 | } |
| 360 | |
| 361 | // Stage (0) - If any processes have 0 cell input data sets, then |
| 362 | // spread the input data sets around (quickly) before formal |
| 363 | // redistribution. |
| 364 | |
| 365 | int duplicateCells; |
| 366 | vtkDataSet* splitInput = this->TestFixTooFewInputFiles(input, duplicateCells); |
| 367 | |
| 368 | if (splitInput == nullptr) |
| 369 | { |
| 370 | return 1; // Fewer cells than processes - can't divide input |
| 371 | } |
| 372 | |
| 373 | this->UpdateProgress(this->NextProgressStep++ * this->ProgressIncrement); |
| 374 | this->SetProgressText("Compute spatial partitioning"); |
| 375 | |
| 376 | // Stage (1) - use vtkPKdTree to... |
| 377 | // Create a load balanced spatial decomposition in parallel. |
| 378 | // Create a table assigning regions to processes. |
| 379 | // |
no test coverage detected