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

Method ProcessRequest

IO/CGNS/vtkCGNSFileSeriesReader.cxx:137–205  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

135
136//----------------------------------------------------------------------------
137vtkTypeBool vtkCGNSFileSeriesReader::ProcessRequest(
138 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
139{
140 if (!this->Reader)
141 {
142 vtkErrorMacro("`Reader` cannot be NULL.");
143 return 0;
144 }
145
146 int requestFromPort = request->Has(vtkStreamingDemandDrivenPipeline::FROM_OUTPUT_PORT())
147 ? request->Get(vtkStreamingDemandDrivenPipeline::FROM_OUTPUT_PORT())
148 : 0;
149 assert(requestFromPort < this->GetNumberOfOutputPorts());
150 vtkInformation* outInfo = outputVector->GetInformationObject(requestFromPort);
151
152 assert(this->InProcessRequest == false);
153 SCOPED_SET<bool> markInProgress(this->InProcessRequest, true);
154
155 // Since we are dealing with potentially temporal or partitioned fileseries, a
156 // single rank may have to read more than 1 file. Before processing any
157 // pipeline pass, let's make sure we have built up the set of active files.
158 if (!this->UpdateActiveFileSet(outInfo))
159 {
160 return 0;
161 }
162
163 // Before we continue processing the request, let's decide what mode should
164 // the internal vtkCGNSReader work i.e. should it handle parallel processing
165 // by splitting blocks across ranks, or are we letting
166 // vtkCGNSReaderFileSeriesReader split files among ranks.
167 if (this->FileSeriesHelper->GetPartitionedFiles())
168 {
169 this->Reader->SetController(nullptr);
170 this->Reader->SetDistributeBlocks(false);
171 }
172 else
173 {
174 this->Reader->SetController(this->Controller);
175 this->Reader->SetDistributeBlocks(true);
176 }
177
178 if (this->FileSeriesHelper->GetPartitionedFiles() &&
179 request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_DATA()))
180 {
181 // For REQUEST_DATA(), we need to iterate over all files in the active
182 // set.
183 if (!this->RequestData(request, inputVector, outputVector))
184 {
185 return 0;
186 }
187 }
188 else
189 {
190 // For most pipeline passes, it's sufficient to choose the first file in the
191 // active set, if any, and then pass the request to the internal reader.
192 if (!this->ActiveFiles.empty())
193 {
194 this->ChooseActiveFile(0);

Callers 2

RequestInformationMethod · 0.45
RequestDataMethod · 0.45

Calls 11

UpdateActiveFileSetMethod · 0.95
RequestDataMethod · 0.95
ChooseActiveFileMethod · 0.95
GetInformationObjectMethod · 0.80
FillTimeInformationMethod · 0.80
assertFunction · 0.50
HasMethod · 0.45
GetMethod · 0.45
SetControllerMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected