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

Method RequestInformation

IO/Parallel/vtkPOpenFOAMReader.cxx:411–722  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

409
410//------------------------------------------------------------------------------
411int vtkPOpenFOAMReader::RequestInformation(
412 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
413{
414#if VTK_OPENFOAM_TIME_PROFILING
415 this->InitializeRequestInformation();
416#endif
417 const bool isRootProc = (this->ProcessId == 0);
418 const bool isParallel = (this->NumProcesses > 1);
419 int returnCode = 1;
420
421 // Set handle piece request for all cases. Even if the reconstructed case is not actually
422 // distributed, we need all processes to go through RequestData every time in order to go through
423 // "Gather" functions.
424 outputVector->GetInformationObject(0)->Set(CAN_HANDLE_PIECE_REQUEST(), 1);
425
426 if (this->CaseType == RECONSTRUCTED_CASE)
427 {
428#if VTK_OPENFOAM_TIME_PROFILING
429 auto start = std::chrono::high_resolution_clock::now();
430#endif
431 if (isRootProc)
432 {
433 returnCode = this->Superclass::RequestInformation(request, inputVector, outputVector);
434 }
435
436 if (isParallel)
437 {
438 this->Controller->Broadcast(&returnCode, 1, 0);
439
440 if (returnCode == 0)
441 {
442 // Error encountered in process 0 - abort all processes
443 vtkErrorMacro(<< "The master process returned an error.");
444 return 0;
445 }
446
447 vtkDoubleArray* timeValues = nullptr;
448 if (isRootProc)
449 {
450 timeValues = this->Superclass::GetTimeValues();
451 }
452 else
453 {
454 timeValues = vtkDoubleArray::New();
455 }
456 this->Controller->Broadcast(timeValues, 0);
457 if (!isRootProc)
458 {
459 this->Superclass::SetTimeInformation(outputVector, timeValues);
460 this->Superclass::Refresh = false;
461 timeValues->Delete();
462 }
463 }
464
465 this->GatherMetaData();
466#if VTK_OPENFOAM_TIME_PROFILING
467 auto end = std::chrono::high_resolution_clock::now();
468 std::cout << "vtkPOpenFOAMReader::RequestInformation: Elapsed time: "

Callers

nothing calls this directly

Calls 15

BroadcastMethod · 0.95
GatherMetaDataMethod · 0.95
BroadcastMetaDataMethod · 0.95
ScanForProcessorDirsFunction · 0.85
ProcessorDirNameFunction · 0.85
NewFoamReaderFunction · 0.85
GetInformationObjectMethod · 0.80
RemoveAllArraysMethod · 0.80
MakeInformationVectorMethod · 0.80

Tested by

no test coverage detected