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

Method GetActiveFiles

IO/CGNS/vtkFileSeriesHelper.cxx:421–490  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

419
420//----------------------------------------------------------------------------
421std::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 {

Callers 1

UpdateActiveFileSetMethod · 0.80

Calls 15

SplitFilesMethod · 0.95
GetTimeStepsValidMethod · 0.80
GetTimeRangeValidMethod · 0.80
GetNumberOfProcessesMethod · 0.80
GetTimeStepIndexFunction · 0.70
findFunction · 0.50
HasMethod · 0.45
GetMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected