----------------------------------------------------------------------------
| 419 | |
| 420 | //---------------------------------------------------------------------------- |
| 421 | std::vector<std::string> vtkFileSeriesHelper::GetActiveFiles(vtkInformation* outInfo) const |
| 422 | { |
| 423 | std::vector<std::string> activeFiles; |
| 424 | |
| 425 | typedef vtkStreamingDemandDrivenPipeline SDDP; |
| 426 | |
| 427 | bool hasTime = outInfo->Has(SDDP::UPDATE_TIME_STEP()) != 0; |
| 428 | double time = hasTime ? outInfo->Get(SDDP::UPDATE_TIME_STEP()) : 0.0; |
| 429 | int tindex = 0; |
| 430 | |
| 431 | if (hasTime) |
| 432 | { |
| 433 | // let's clamp the time to available timesteps. |
| 434 | if (!this->AggregatedTimeSteps.empty()) |
| 435 | { |
| 436 | tindex = vtkFileSeriesHelperNS::GetTimeStepIndex( |
| 437 | time, this->AggregatedTimeSteps.data(), static_cast<int>(this->AggregatedTimeSteps.size())); |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | if (tindex < 0 || tindex >= static_cast<int>(this->AggregatedTimeSteps.size())) |
| 442 | { |
| 443 | return activeFiles; |
| 444 | } |
| 445 | |
| 446 | // clamp time to actual timestep available in the files. |
| 447 | time = this->AggregatedTimeSteps[tindex]; |
| 448 | |
| 449 | // build up activeFiles to match files that provide the requested timestep. |
| 450 | for (size_t cc = 0; cc < this->Information.size(); ++cc) |
| 451 | { |
| 452 | const vtkTimeInformation& tinfo = this->Information[cc]; |
| 453 | if (tinfo.GetTimeStepsValid() && |
| 454 | std::find(tinfo.GetTimeSteps().begin(), tinfo.GetTimeSteps().end(), time) != |
| 455 | tinfo.GetTimeSteps().end()) |
| 456 | { |
| 457 | activeFiles.push_back(this->FileNames[cc]); |
| 458 | } |
| 459 | else if (tinfo.GetTimeRangeValid() && tinfo.GetTimeRange().first <= time && |
| 460 | time <= tinfo.GetTimeRange().second) |
| 461 | { |
| 462 | activeFiles.push_back(this->FileNames[cc]); |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | if (!this->PartitionedFiles) |
| 467 | { |
| 468 | // This means the file series is a temporal file series. If so, |
| 469 | // all files providing the timestep requested are processed by the current |
| 470 | // rank. |
| 471 | return activeFiles; |
| 472 | } |
| 473 | |
| 474 | // activeFiles now tells us all the files that provide the timestep of |
| 475 | // interest. If this->PartitionedFiles, we distribute the files among ranks. |
| 476 | int piece = 0, numPieces = 1; |
| 477 | if (this->Controller) |
| 478 | { |
no test coverage detected