Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::VtkHdfV2DataWriter Class Reference
Inheritance diagram for Arcane::VtkHdfV2DataWriter:
Collaboration diagram for Arcane::VtkHdfV2DataWriter:

Classes

struct  DatasetGroupAndName
 Class to store a pair (hdf_group, dataset_name). More...
struct  DatasetInfo
 Class to store offset information. More...
struct  WritePartInfo
 Offset information for the part to write associated with a rank. More...
struct  ItemGroupCollectiveInfo
 Collective information for an ItemGroup;. More...
struct  DataInfo
 Stores info about the data to be saved and the associated offset. More...

Public Member Functions

 VtkHdfV2DataWriter (IMesh *mesh, const ItemGroupCollection &groups, bool is_collective_io)
void beginWrite (const VariableCollection &vars) override
void endWrite () override
void setMetaData (const String &meta_data) override
 Sets the metadata information.
void write (IVariable *var, IData *data) override
 Writes the data data of the variable var.
void setTimes (RealConstArrayView times)
void setDirectoryName (const String &dir_name)
void setMaxWriteSize (Int64 v)
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const
Public Member Functions inherited from Arcane::IDataWriter
virtual ~IDataWriter ()=default
 Frees resources.

Private Member Functions

void _addInt64ArrayAttribute (Hid &hid, const char *name, Span< const Int64 > values)
void _addStringAttribute (Hid &hid, const char *name, const String &value)
template<typename DataType>
void _writeDataSet1D (const DataInfo &data_info, GatherGroupInfo *gather_info, Span< const DataType > values)
template<typename DataType>
void _writeDataSet1DUsingCollectiveIO (const DataInfo &data_info, GatherGroupInfo *gather_info, Span< const DataType > values)
template<typename DataType>
void _writeDataSet1DCollective (const DataInfo &data_info, GatherGroupInfo *gather_info, Span< const DataType > values)
template<typename DataType>
void _writeDataSet2D (const DataInfo &data_info, GatherGroupInfo *gather_info, Span2< const DataType > values)
template<typename DataType>
void _writeDataSet2DUsingCollectiveIO (const DataInfo &data_info, GatherGroupInfo *gather_info, Span2< const DataType > values)
template<typename DataType>
void _writeDataSet2DCollective (const DataInfo &data_info, GatherGroupInfo *gather_info, Span2< const DataType > values)
template<typename DataType>
void _writeBasicTypeDataset (const DataInfo &data_info, GatherGroupInfo *gather_info, IData *data)
void _writeReal3Dataset (const DataInfo &data_info, GatherGroupInfo *gather_info, IData *data)
void _writeReal2Dataset (const DataInfo &data_info, GatherGroupInfo *gather_info, IData *data)
String _getFileName ()
template<typename DataType>
void _writeDataSetGeneric (const DataInfo &data_info, GatherGroupInfo *gather_info, Int32 nb_dim, Int64 dim1_size, Int64 dim2_size, const DataType *values_data, bool is_collective)
void _writeDataSetGeneric (const DataInfo &data_info, GatherGroupInfo *gather_info, Int32 nb_dim, Int64 dim1_size, Int64 dim2_size, ConstMemoryView values_data, const hid_t hdf_datatype_type, bool is_collective)
 Writes a 1D or 2D data.
void _addInt64Attribute (Hid &hid, const char *name, Int64 value)
Int64 _readInt64Attribute (Hid &hid, const char *name)
void _openOrCreateGroups ()
void _closeGroups ()
void _readAndSetOffset (DatasetInfo &offset_info, Int32 wanted_step)
void _initializeOffsets ()
void _initializeItemGroupCollectiveInfos (ItemGroupCollectiveInfo &group_info, GatherGroupInfo &gather_info)
WritePartInfo _computeWritePartInfo (Int64 local_size)
 Computes the offset of our part and the total number of elements.
void _writeConstituentsGroups ()

Private Attributes

IMeshm_mesh = nullptr
 Associated mesh.
IMeshMaterialMngm_material_mng = nullptr
 Associated material manager (may be null).
ItemGroupCollection m_groups
 List of groups to save.
UniqueArray< Realm_times
 List of times.
String m_full_filename
 Current HDF filename.
String m_directory_name
 Output directory.
HFile m_file_id
 HDF file identifier.
HGroup m_top_group
HGroup m_cell_data_group
HGroup m_node_data_group
HGroup m_steps_group
HGroup m_point_data_offsets_group
HGroup m_cell_data_offsets_group
HGroup m_field_data_offsets_group
bool m_is_parallel = false
bool m_is_collective_io = false
bool m_is_first_call = false
bool m_is_writer = false
Int32 m_writer = 0
DatasetInfo m_cell_offset_info
DatasetInfo m_point_offset_info
DatasetInfo m_connectivity_offset_info
DatasetInfo m_offset_for_cell_offset_info
DatasetInfo m_part_offset_info
DatasetInfo m_time_offset_info
std::map< DatasetInfo, Int64m_offset_info_list
StandardTypes m_standard_types { false }
ItemGroupCollectiveInfo m_all_cells_info
ItemGroupCollectiveInfo m_all_nodes_info
UniqueArray< Ref< ItemGroupCollectiveInfo > > m_materials_groups
GatherGroupInfo m_all_cells_gather_group_info
GatherGroupInfo m_all_nodes_gather_group_info
UniqueArray< Ref< GatherGroupInfo > > m_gather_info_materials_groups
Int64 m_max_write_size = 0
 Maximum size (in kilobytes) for a write operation.

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Definition at line 88 of file VtkHdfV2PostProcessor.cc.

Constructor & Destructor Documentation

◆ VtkHdfV2DataWriter()

Arcane::VtkHdfV2DataWriter::VtkHdfV2DataWriter ( IMesh * mesh,
const ItemGroupCollection & groups,
bool is_collective_io )

Definition at line 361 of file VtkHdfV2PostProcessor.cc.

Member Function Documentation

◆ _addInt64ArrayAttribute()

void Arcane::VtkHdfV2DataWriter::_addInt64ArrayAttribute ( Hid & hid,
const char * name,
Span< const Int64 > values )
private

Definition at line 996 of file VtkHdfV2PostProcessor.cc.

◆ _addInt64Attribute()

void Arcane::VtkHdfV2DataWriter::_addInt64Attribute ( Hid & hid,
const char * name,
Int64 value )
private

Definition at line 1014 of file VtkHdfV2PostProcessor.cc.

◆ _addStringAttribute()

void Arcane::VtkHdfV2DataWriter::_addStringAttribute ( Hid & hid,
const char * name,
const String & value )
private

Definition at line 1050 of file VtkHdfV2PostProcessor.cc.

◆ _closeGroups()

void Arcane::VtkHdfV2DataWriter::_closeGroups ( )
private

Definition at line 1110 of file VtkHdfV2PostProcessor.cc.

◆ _computeWritePartInfo()

VtkHdfV2DataWriter::WritePartInfo Arcane::VtkHdfV2DataWriter::_computeWritePartInfo ( Int64 local_size)
private

Computes the offset of our part and the total number of elements.

Definition at line 639 of file VtkHdfV2PostProcessor.cc.

References Arcane::IParallelMng::allGather(), Arcane::IParallelMng::commRank(), Arcane::IParallelMng::commSize(), and m_mesh.

Referenced by _writeDataSetGeneric().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getFileName()

String Arcane::VtkHdfV2DataWriter::_getFileName ( )
inlineprivate

Definition at line 334 of file VtkHdfV2PostProcessor.cc.

◆ _initializeItemGroupCollectiveInfos()

void Arcane::VtkHdfV2DataWriter::_initializeItemGroupCollectiveInfos ( ItemGroupCollectiveInfo & group_info,
GatherGroupInfo & gather_info )
private

Definition at line 670 of file VtkHdfV2PostProcessor.cc.

◆ _initializeOffsets()

void Arcane::VtkHdfV2DataWriter::_initializeOffsets ( )
private

Definition at line 1267 of file VtkHdfV2PostProcessor.cc.

◆ _openOrCreateGroups()

void Arcane::VtkHdfV2DataWriter::_openOrCreateGroups ( )
private

Definition at line 1094 of file VtkHdfV2PostProcessor.cc.

◆ _readAndSetOffset()

void Arcane::VtkHdfV2DataWriter::_readAndSetOffset ( DatasetInfo & offset_info,
Int32 wanted_step )
private

Definition at line 1250 of file VtkHdfV2PostProcessor.cc.

◆ _readInt64Attribute()

Int64 Arcane::VtkHdfV2DataWriter::_readInt64Attribute ( Hid & hid,
const char * name )
private

Definition at line 1033 of file VtkHdfV2PostProcessor.cc.

◆ _writeBasicTypeDataset()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeBasicTypeDataset ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
IData * data )
private

Definition at line 1195 of file VtkHdfV2PostProcessor.cc.

◆ _writeConstituentsGroups()

void Arcane::VtkHdfV2DataWriter::_writeConstituentsGroups ( )
private

Definition at line 605 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet1D()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet1D ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span< const DataType > values )
private

Definition at line 900 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet1DCollective()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet1DCollective ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span< const DataType > values )
private

Definition at line 918 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet1DUsingCollectiveIO()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet1DUsingCollectiveIO ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span< const DataType > values )
private

Definition at line 909 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet2D()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet2D ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span2< const DataType > values )
private

Definition at line 948 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet2DCollective()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet2DCollective ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span2< const DataType > values )
private

Definition at line 966 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSet2DUsingCollectiveIO()

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSet2DUsingCollectiveIO ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Span2< const DataType > values )
private

Definition at line 957 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSetGeneric() [1/2]

template<typename DataType>
void Arcane::VtkHdfV2DataWriter::_writeDataSetGeneric ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Int32 nb_dim,
Int64 dim1_size,
Int64 dim2_size,
const DataType * values_data,
bool is_collective )
private

Definition at line 887 of file VtkHdfV2PostProcessor.cc.

◆ _writeDataSetGeneric() [2/2]

void Arcane::VtkHdfV2DataWriter::_writeDataSetGeneric ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
Int32 nb_dim,
Int64 dim1_size,
Int64 dim2_size,
ConstMemoryView values_data,
const hid_t hdf_type,
bool is_collective )
private

Writes a 1D or 2D data.

For each time added, the data is written at the end of previous values unless rolling back, in which case the offset is in data_info.

Definition at line 705 of file VtkHdfV2PostProcessor.cc.

References _computeWritePartInfo(), ARCANE_CHECK_POINTER, ARCANE_THROW, Arcane::Hdf5Utils::HProperty::createDatasetTransfertCollectiveMPIIO(), Arcane::Hdf5Utils::HProperty::createDatasetTransfertIndependentMPIIO(), Arcane::ConstMemoryView::data(), Arcane::ConstMemoryView::datatypeSize(), Arcane::Hdf5Utils::HInit::hasParallelHdf5(), Arcane::TraceAccessor::info(), Arcane::String::localstr(), m_max_write_size, Arcane::math::min(), Arcane::GatherGroupInfo::nbWriterGlobal(), and Arcane::VtkHdfV2DataWriter::DatasetInfo::offset().

Here is the call graph for this function:

◆ _writeReal2Dataset()

void Arcane::VtkHdfV2DataWriter::_writeReal2Dataset ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
IData * data )
private

Definition at line 1228 of file VtkHdfV2PostProcessor.cc.

◆ _writeReal3Dataset()

void Arcane::VtkHdfV2DataWriter::_writeReal3Dataset ( const DataInfo & data_info,
GatherGroupInfo * gather_info,
IData * data )
private

Definition at line 1206 of file VtkHdfV2PostProcessor.cc.

◆ beginWrite()

void Arcane::VtkHdfV2DataWriter::beginWrite ( const VariableCollection & vars)
overridevirtual

Implements Arcane::IDataWriter.

Definition at line 377 of file VtkHdfV2PostProcessor.cc.

◆ endWrite()

void Arcane::VtkHdfV2DataWriter::endWrite ( )
overridevirtual

Implements Arcane::IDataWriter.

Definition at line 1070 of file VtkHdfV2PostProcessor.cc.

◆ setDirectoryName()

void Arcane::VtkHdfV2DataWriter::setDirectoryName ( const String & dir_name)
inline

Definition at line 245 of file VtkHdfV2PostProcessor.cc.

◆ setMaxWriteSize()

void Arcane::VtkHdfV2DataWriter::setMaxWriteSize ( Int64 v)
inline

Definition at line 246 of file VtkHdfV2PostProcessor.cc.

◆ setMetaData()

void Arcane::VtkHdfV2DataWriter::setMetaData ( const String & meta_data)
overridevirtual

Sets the metadata information.

Implements Arcane::IDataWriter.

Definition at line 1125 of file VtkHdfV2PostProcessor.cc.

◆ setTimes()

void Arcane::VtkHdfV2DataWriter::setTimes ( RealConstArrayView times)
inline

Definition at line 244 of file VtkHdfV2PostProcessor.cc.

◆ write()

void Arcane::VtkHdfV2DataWriter::write ( IVariable * var,
IData * data )
overridevirtual

Writes the data data of the variable var.

Implements Arcane::IDataWriter.

Definition at line 1134 of file VtkHdfV2PostProcessor.cc.

References ARCANE_CHECK_POINTER, ARCANE_FATAL, Arcane::IVariable::dataType(), Arcane::IVariable::dimension(), Arcane::DT_Int32, Arcane::DT_Int64, Arcane::DT_Real, Arcane::DT_Real2, Arcane::DT_Real3, Arcane::IK_Cell, Arcane::IK_Node, Arcane::TraceAccessor::info(), Arcane::IVariable::isPartial(), Arcane::IVariable::itemKind(), Arcane::IVariable::name(), and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

Member Data Documentation

◆ m_all_cells_gather_group_info

GatherGroupInfo Arcane::VtkHdfV2DataWriter::m_all_cells_gather_group_info
private

Definition at line 300 of file VtkHdfV2PostProcessor.cc.

◆ m_all_cells_info

ItemGroupCollectiveInfo Arcane::VtkHdfV2DataWriter::m_all_cells_info
private

Definition at line 296 of file VtkHdfV2PostProcessor.cc.

◆ m_all_nodes_gather_group_info

GatherGroupInfo Arcane::VtkHdfV2DataWriter::m_all_nodes_gather_group_info
private

Definition at line 301 of file VtkHdfV2PostProcessor.cc.

◆ m_all_nodes_info

ItemGroupCollectiveInfo Arcane::VtkHdfV2DataWriter::m_all_nodes_info
private

Definition at line 297 of file VtkHdfV2PostProcessor.cc.

◆ m_cell_data_group

HGroup Arcane::VtkHdfV2DataWriter::m_cell_data_group
private

Definition at line 272 of file VtkHdfV2PostProcessor.cc.

◆ m_cell_data_offsets_group

HGroup Arcane::VtkHdfV2DataWriter::m_cell_data_offsets_group
private

Definition at line 277 of file VtkHdfV2PostProcessor.cc.

◆ m_cell_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_cell_offset_info
private

Definition at line 286 of file VtkHdfV2PostProcessor.cc.

◆ m_connectivity_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_connectivity_offset_info
private

Definition at line 288 of file VtkHdfV2PostProcessor.cc.

◆ m_directory_name

String Arcane::VtkHdfV2DataWriter::m_directory_name
private

Output directory.

Definition at line 266 of file VtkHdfV2PostProcessor.cc.

◆ m_field_data_offsets_group

HGroup Arcane::VtkHdfV2DataWriter::m_field_data_offsets_group
private

Definition at line 278 of file VtkHdfV2PostProcessor.cc.

◆ m_file_id

HFile Arcane::VtkHdfV2DataWriter::m_file_id
private

HDF file identifier.

Definition at line 269 of file VtkHdfV2PostProcessor.cc.

◆ m_full_filename

String Arcane::VtkHdfV2DataWriter::m_full_filename
private

Current HDF filename.

Definition at line 263 of file VtkHdfV2PostProcessor.cc.

◆ m_gather_info_materials_groups

UniqueArray<Ref<GatherGroupInfo> > Arcane::VtkHdfV2DataWriter::m_gather_info_materials_groups
private

Definition at line 302 of file VtkHdfV2PostProcessor.cc.

◆ m_groups

ItemGroupCollection Arcane::VtkHdfV2DataWriter::m_groups
private

List of groups to save.

Definition at line 257 of file VtkHdfV2PostProcessor.cc.

◆ m_is_collective_io

bool Arcane::VtkHdfV2DataWriter::m_is_collective_io = false
private

Definition at line 281 of file VtkHdfV2PostProcessor.cc.

◆ m_is_first_call

bool Arcane::VtkHdfV2DataWriter::m_is_first_call = false
private

Definition at line 282 of file VtkHdfV2PostProcessor.cc.

◆ m_is_parallel

bool Arcane::VtkHdfV2DataWriter::m_is_parallel = false
private

Definition at line 280 of file VtkHdfV2PostProcessor.cc.

◆ m_is_writer

bool Arcane::VtkHdfV2DataWriter::m_is_writer = false
private

Definition at line 283 of file VtkHdfV2PostProcessor.cc.

◆ m_material_mng

IMeshMaterialMng* Arcane::VtkHdfV2DataWriter::m_material_mng = nullptr
private

Associated material manager (may be null).

Definition at line 254 of file VtkHdfV2PostProcessor.cc.

◆ m_materials_groups

UniqueArray<Ref<ItemGroupCollectiveInfo> > Arcane::VtkHdfV2DataWriter::m_materials_groups
private

Definition at line 298 of file VtkHdfV2PostProcessor.cc.

◆ m_max_write_size

Int64 Arcane::VtkHdfV2DataWriter::m_max_write_size = 0
private

Maximum size (in kilobytes) for a write operation.

If the write exceeds this size, it is split into multiple writes. This may be necessary with MPI-IO for large volumes.

Definition at line 310 of file VtkHdfV2PostProcessor.cc.

Referenced by _writeDataSetGeneric().

◆ m_mesh

IMesh* Arcane::VtkHdfV2DataWriter::m_mesh = nullptr
private

Associated mesh.

Definition at line 251 of file VtkHdfV2PostProcessor.cc.

Referenced by _computeWritePartInfo().

◆ m_node_data_group

HGroup Arcane::VtkHdfV2DataWriter::m_node_data_group
private

Definition at line 273 of file VtkHdfV2PostProcessor.cc.

◆ m_offset_for_cell_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_offset_for_cell_offset_info
private

Definition at line 289 of file VtkHdfV2PostProcessor.cc.

◆ m_offset_info_list

std::map<DatasetInfo, Int64> Arcane::VtkHdfV2DataWriter::m_offset_info_list
private

Definition at line 292 of file VtkHdfV2PostProcessor.cc.

◆ m_part_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_part_offset_info
private

Definition at line 290 of file VtkHdfV2PostProcessor.cc.

◆ m_point_data_offsets_group

HGroup Arcane::VtkHdfV2DataWriter::m_point_data_offsets_group
private

Definition at line 276 of file VtkHdfV2PostProcessor.cc.

◆ m_point_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_point_offset_info
private

Definition at line 287 of file VtkHdfV2PostProcessor.cc.

◆ m_standard_types

StandardTypes Arcane::VtkHdfV2DataWriter::m_standard_types { false }
private

Definition at line 294 of file VtkHdfV2PostProcessor.cc.

◆ m_steps_group

HGroup Arcane::VtkHdfV2DataWriter::m_steps_group
private

Definition at line 275 of file VtkHdfV2PostProcessor.cc.

◆ m_time_offset_info

DatasetInfo Arcane::VtkHdfV2DataWriter::m_time_offset_info
private

Definition at line 291 of file VtkHdfV2PostProcessor.cc.

◆ m_times

UniqueArray<Real> Arcane::VtkHdfV2DataWriter::m_times
private

List of times.

Definition at line 260 of file VtkHdfV2PostProcessor.cc.

◆ m_top_group

HGroup Arcane::VtkHdfV2DataWriter::m_top_group
private

Definition at line 271 of file VtkHdfV2PostProcessor.cc.

◆ m_writer

Int32 Arcane::VtkHdfV2DataWriter::m_writer = 0
private

Definition at line 284 of file VtkHdfV2PostProcessor.cc.


The documentation for this class was generated from the following file: