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

Method WriteDistributedMetafile

IO/HDF/vtkHDFWriter.cxx:314–353  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

312
313//------------------------------------------------------------------------------
314void 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//------------------------------------------------------------------------------
356void vtkHDFWriter::DispatchDataObject(hid_t group, vtkDataObject* input, unsigned int partId)

Callers 1

WriteDataMethod · 0.95

Calls 9

DispatchDataObjectMethod · 0.95
GetExternalBlockFileNameFunction · 0.85
OpenSubfileMethod · 0.80
to_stringFunction · 0.50
stringClass · 0.50
CloseFileMethod · 0.45
BarrierMethod · 0.45
CreateFileMethod · 0.45
GetRootMethod · 0.45

Tested by

no test coverage detected