VTK  9.7.20261204
vtkHDFWriterImplementationData Namespace Reference

VTKHDF Writer helpers for partition offsets, subfile metadata, and virtual mappings. More...

Classes

struct  GeometryOffset
 Store absolute file offsets for a partition in the current time step. More...
struct  PartitionedOffsets
struct  Subfile
struct  SubfilePartRange
struct  VirtualDataset

Typedefs

using Subfiles = std::vector<Subfile>

Enumerations

enum class  IndexingMode {
  Points , Cells , Connectivity , FaceConnectivity ,
  FaceOffsets , PolyhedronToFaces , PolyhedronOffsets , TreeDepths ,
  Trees , Descriptor , HTGCoords , MetaData ,
  Undefined
}

Functions

bool CollectOffsets (hid_t group, vtkDataObject *input, vtkMultiProcessController *controller, bool distributed, PartitionedOffsets &offsets)
 Collect temporal file extents, then add the current partition offsets.
bool CollectTemporalOffsets (hid_t group, GeometryOffset &offsets)
 Collect temporal offsets from the file currently open.
vtkSmartPointer< vtkDataObject > CreateEmptyPartition (vtkSmartPointer< vtkDataObject > input, vtkMultiProcessController *controller)
 Create placeholders for empty inputs to make sure all ranks have the same data type, and synchronize point/cell array names on all ranks.
bool CollectSubfileAttributes (const Subfiles &subfiles, const std::string &basePath, vtkDataObject *data)
 Add schemas for point/cell arrays found in any subfile during metafile assembly.
bool HasDataset (const Subfiles &subfiles, const std::string &path)
 Return true if at least one registered subfile contains the given path.
vtkHDF::ScopedH5GHandle GetSubfileNonNullPart (const Subfiles &subfiles, const std::string &blockPath, int &type)
 Find the first non null part for the given path in all subfiles.
bool CreateRepresentativeFromSubfile (const Subfiles &subfiles, const std::string &blockPath, vtkSmartPointer< vtkDataObject > &representative)
 Recover a block type, attributes, and field arrays from subfiles.
bool CreateArraysFromNonNullPart (hid_t group, vtkDataObject *data)
 Initialize empty data object array structures from a base group.
int ReadNumberOfTimeSteps (hid_t root)
 Read the existing timestep count, including composite leaves.
bool IsMissingPartition (const PartitionedOffsets &offsets, unsigned int partId, int rank, bool distributed)
 Return true if the current partition in the current rank is a placeholder used only for collective writing.
bool UsesDistributedOffsets (const PartitionedOffsets &offsets, const std::string &path, bool distributed)
 Return true if a given path can use distributed offsets and writing.
hsize_t GetDatasetValueOffset (const PartitionedOffsets &offsets, std::size_t partition, const std::string &datasetPath, IndexingMode mode)
 Get offset value from a file-absolute partition number and path, using computed offsets from the collective offset pass.
hsize_t GetDistributedDatasetSize (const PartitionedOffsets &offsets, const std::string &datasetPath)
 Return the total number of rows for the given dataset.
IndexingMode GetDatasetIndexationMode (const std::string &path)
 Return the indexation mode of dataset at the given path: when the dataset adds 1 component for every new time step or part, return Single.
hsize_t GetDatasetPadding (const std::string &datasetPath, IndexingMode mode, hsize_t partitions)
 Number of extra offset entries stored for the given partitions.
bool GetSubfilePartRange (const Subfiles &subfiles, const std::string &basePath, std::size_t file, hsize_t step, SubfilePartRange &range)
 Locate the partitions belonging to a subfile timestep.
hsize_t GetNumberOfCellsSubfile (const Subfiles &subfiles, const std::string &basePath, std::size_t subfileId, hsize_t part, bool isPolyData, const std::string &groupName)
 Look into subfile subfileId and return the number of cells in part part.
hsize_t GetSubfileNumberOf (const Subfiles &subfiles, const std::string &base, const std::string_view &qualifier, std::size_t subfileId, hsize_t part, int primitive=-1)
 Retrieve a single value from the 1-dimensional (usually meta-data) group name in a given subfile subfileId.
hsize_t GetSubfileDatasetSize (const Subfiles &subfiles, const std::string &datasetPath, std::size_t file, hsize_t part, bool isPolyData, hsize_t defaultSize=0)
 Read the extent contributed by one subfile partition.
bool GetSubFilesDatasetSize (const Subfiles &subfiles, const std::string &datasetPath, const std::string &groupName, hsize_t &totalSize, const std::string &fallbackPath="")
 Set totalSize as the the sum of the subfiles dataset's size given a path to the dataset.
hsize_t GetSubfileFieldSize (const Subfiles &subfiles, const std::string &datasetPath, std::size_t file, hsize_t partOffset, hsize_t parts)
 Return the number of tuples for all a given number of parts in a subfile, starting at offset partOffset.
vtkHDF::ScopedH5THandle GetSubfileDataType (const Subfiles &subfiles, const std::string &datasetPath)
 Copy the datatype from dataset in subfile.
bool BuildVirtualMappings (const Subfiles &subfiles, const VirtualDataset &dataset, hsize_t numberOfSteps)
 Build HDF5 virtual dataset mappings from a VirtualDataset description.

Detailed Description

VTKHDF Writer helpers for partition offsets, subfile metadata, and virtual mappings.

Typedef Documentation

◆ Subfiles

Definition at line 64 of file vtkHDFWriterImplementationData.h.

Enumeration Type Documentation

◆ IndexingMode

Enumerator
Points 
Cells 
Connectivity 
FaceConnectivity 
FaceOffsets 
PolyhedronToFaces 
PolyhedronOffsets 
TreeDepths 
Trees 
Descriptor 
HTGCoords 
MetaData 
Undefined 

Definition at line 66 of file vtkHDFWriterImplementationData.h.

Function Documentation

◆ CollectOffsets()

bool vtkHDFWriterImplementationData::CollectOffsets ( hid_t group,
vtkDataObject * input,
vtkMultiProcessController * controller,
bool distributed,
PartitionedOffsets & offsets )

Collect temporal file extents, then add the current partition offsets.

Return false on failure.

◆ CollectTemporalOffsets()

bool vtkHDFWriterImplementationData::CollectTemporalOffsets ( hid_t group,
GeometryOffset & offsets )

Collect temporal offsets from the file currently open.

Return false on failure.

◆ CreateEmptyPartition()

vtkSmartPointer< vtkDataObject > vtkHDFWriterImplementationData::CreateEmptyPartition ( vtkSmartPointer< vtkDataObject > input,
vtkMultiProcessController * controller )

Create placeholders for empty inputs to make sure all ranks have the same data type, and synchronize point/cell array names on all ranks.

This is used to make sure that all ranks share the same structure before collective writes. At least 1 rank should have a non null partition.

◆ CollectSubfileAttributes()

bool vtkHDFWriterImplementationData::CollectSubfileAttributes ( const Subfiles & subfiles,
const std::string & basePath,
vtkDataObject * data )

Add schemas for point/cell arrays found in any subfile during metafile assembly.

◆ HasDataset()

bool vtkHDFWriterImplementationData::HasDataset ( const Subfiles & subfiles,
const std::string & path )

Return true if at least one registered subfile contains the given path.

◆ GetSubfileNonNullPart()

vtkHDF::ScopedH5GHandle vtkHDFWriterImplementationData::GetSubfileNonNullPart ( const Subfiles & subfiles,
const std::string & blockPath,
int & type )

Find the first non null part for the given path in all subfiles.

◆ CreateRepresentativeFromSubfile()

bool vtkHDFWriterImplementationData::CreateRepresentativeFromSubfile ( const Subfiles & subfiles,
const std::string & blockPath,
vtkSmartPointer< vtkDataObject > & representative )

Recover a block type, attributes, and field arrays from subfiles.

Null when no subfiles have the dataset.

◆ CreateArraysFromNonNullPart()

bool vtkHDFWriterImplementationData::CreateArraysFromNonNullPart ( hid_t group,
vtkDataObject * data )

Initialize empty data object array structures from a base group.

Used to get meta information for composite subfiles when all subfiles do not have non-null data.

◆ ReadNumberOfTimeSteps()

int vtkHDFWriterImplementationData::ReadNumberOfTimeSteps ( hid_t root)

Read the existing timestep count, including composite leaves.

Return -1 on failure.

◆ IsMissingPartition()

bool vtkHDFWriterImplementationData::IsMissingPartition ( const PartitionedOffsets & offsets,
unsigned int partId,
int rank,
bool distributed )

Return true if the current partition in the current rank is a placeholder used only for collective writing.

This happens when a rank has more non-null partitions than others, but all write must be collective. Ranks with a "missing partition" participate in collective operations but don't write anything.

◆ UsesDistributedOffsets()

bool vtkHDFWriterImplementationData::UsesDistributedOffsets ( const PartitionedOffsets & offsets,
const std::string & path,
bool distributed )

Return true if a given path can use distributed offsets and writing.

Temporary utility while everything does not support distributed writing.

◆ GetDatasetValueOffset()

hsize_t vtkHDFWriterImplementationData::GetDatasetValueOffset ( const PartitionedOffsets & offsets,
std::size_t partition,
const std::string & datasetPath,
IndexingMode mode )

Get offset value from a file-absolute partition number and path, using computed offsets from the collective offset pass.

◆ GetDistributedDatasetSize()

hsize_t vtkHDFWriterImplementationData::GetDistributedDatasetSize ( const PartitionedOffsets & offsets,
const std::string & datasetPath )

Return the total number of rows for the given dataset.

This is computed using collected offsets from all ranks.

◆ GetDatasetIndexationMode()

IndexingMode vtkHDFWriterImplementationData::GetDatasetIndexationMode ( const std::string & path)

Return the indexation mode of dataset at the given path: when the dataset adds 1 component for every new time step or part, return Single.

If we add a number of values equivalent to the number of points of the dataset every step/part, return Points. The same goes for Cells and Connectivity. This is used when creating virtual datasets from different parts, to know how to interleave virtual mappings.

◆ GetDatasetPadding()

hsize_t vtkHDFWriterImplementationData::GetDatasetPadding ( const std::string & datasetPath,
IndexingMode mode,
hsize_t partitions )

Number of extra offset entries stored for the given partitions.

1 for offset arrays, 0 for others

◆ GetSubfilePartRange()

bool vtkHDFWriterImplementationData::GetSubfilePartRange ( const Subfiles & subfiles,
const std::string & basePath,
std::size_t file,
hsize_t step,
SubfilePartRange & range )

Locate the partitions belonging to a subfile timestep.

◆ GetNumberOfCellsSubfile()

hsize_t vtkHDFWriterImplementationData::GetNumberOfCellsSubfile ( const Subfiles & subfiles,
const std::string & basePath,
std::size_t subfileId,
hsize_t part,
bool isPolyData,
const std::string & groupName )

Look into subfile subfileId and return the number of cells in part part.

Supports UnstructuredGrid and PolyData subfiles.

◆ GetSubfileNumberOf()

hsize_t vtkHDFWriterImplementationData::GetSubfileNumberOf ( const Subfiles & subfiles,
const std::string & base,
const std::string_view & qualifier,
std::size_t subfileId,
hsize_t part,
int primitive = -1 )

Retrieve a single value from the 1-dimensional (usually meta-data) group name in a given subfile subfileId.

part indicates the line (dimension 0) offset to read in the group. primitive is the column offset to use when reading into a 2-D meta-data array for Poly Data. Unless primitive is specified, assume that the array is 1-D.

◆ GetSubfileDatasetSize()

hsize_t vtkHDFWriterImplementationData::GetSubfileDatasetSize ( const Subfiles & subfiles,
const std::string & datasetPath,
std::size_t file,
hsize_t part,
bool isPolyData,
hsize_t defaultSize = 0 )

Read the extent contributed by one subfile partition.

◆ GetSubFilesDatasetSize()

bool vtkHDFWriterImplementationData::GetSubFilesDatasetSize ( const Subfiles & subfiles,
const std::string & datasetPath,
const std::string & groupName,
hsize_t & totalSize,
const std::string & fallbackPath = "" )

Set totalSize as the the sum of the subfiles dataset's size given a path to the dataset.

If provided, use fallbackPath's row count for missing datasets. Return false on failure (dataset does not exist on every subfile). totalSize value should not be used in this case.

◆ GetSubfileFieldSize()

hsize_t vtkHDFWriterImplementationData::GetSubfileFieldSize ( const Subfiles & subfiles,
const std::string & datasetPath,
std::size_t file,
hsize_t partOffset,
hsize_t parts )

Return the number of tuples for all a given number of parts in a subfile, starting at offset partOffset.

◆ GetSubfileDataType()

vtkHDF::ScopedH5THandle vtkHDFWriterImplementationData::GetSubfileDataType ( const Subfiles & subfiles,
const std::string & datasetPath )

Copy the datatype from dataset in subfile.

◆ BuildVirtualMappings()

bool vtkHDFWriterImplementationData::BuildVirtualMappings ( const Subfiles & subfiles,
const VirtualDataset & dataset,
hsize_t numberOfSteps )

Build HDF5 virtual dataset mappings from a VirtualDataset description.