------------------------------------------------------------------------------
| 312 | |
| 313 | //------------------------------------------------------------------------------ |
| 314 | void vtkHDFWriter::WriteDistributedMetafile(vtkDataObject* input) |
| 315 | { |
| 316 | // Only relevant on the last time step |
| 317 | if (this->IsTemporal && this->CurrentTimeIndex != this->NumberOfTimeSteps - 1) |
| 318 | { |
| 319 | return; |
| 320 | } |
| 321 | |
| 322 | this->Impl->CloseFile(); |
| 323 | |
| 324 | // Make sure all processes have written and closed their associated subfile |
| 325 | this->Controller->Barrier(); |
| 326 | |
| 327 | if (this->CurrentPiece == 0) |
| 328 | { |
| 329 | this->Impl->CreateFile(this->Overwrite, this->FileName); |
| 330 | for (int i = 0; i < this->NbPieces; i++) |
| 331 | { |
| 332 | const std::string partitionSuffix = "part" + vtk::to_string(i); |
| 333 | const std::string subFilePath = |
| 334 | ::GetExternalBlockFileName(std::string(this->FileName), partitionSuffix); |
| 335 | if (!this->Impl->OpenSubfile(subFilePath)) |
| 336 | { |
| 337 | vtkErrorMacro(<< "Could not open subfile" << subFilePath); |
| 338 | } |
| 339 | } |
| 340 | this->Impl->SetSubFilesReady(true); |
| 341 | this->CurrentTimeIndex = 0; // Reset time so that datasets are initialized properly |
| 342 | |
| 343 | /* This is a special writing pass. The dataset will be processed and go through writing |
| 344 | all datasets for its type, except that write operations will be different: |
| 345 | instead of writing the data actually associated to the input data object, |
| 346 | write commands will instead gather information from all previously written distributed |
| 347 | pieces, and create virtual datasets referencing them. */ |
| 348 | this->DispatchDataObject(this->Impl->GetRoot(), input); |
| 349 | } |
| 350 | |
| 351 | // Set the time value back to where it was, to stop executing |
| 352 | this->CurrentTimeIndex = this->NumberOfTimeSteps - 1; |
| 353 | } |
| 354 | |
| 355 | //------------------------------------------------------------------------------ |
| 356 | void vtkHDFWriter::DispatchDataObject(hid_t group, vtkDataObject* input, unsigned int partId) |
no test coverage detected