WriteMultiData< T > Class Template Reference

#include <CH_HDF5.H>

List of all members.


Detailed Description

template<class T>
class WriteMultiData< T >

Methods for writing multiple LevelData to an HDF5 file.

While the write functions can be used to write a single LevelData, they do not support writing intervals from multiple LevelData. This is often the case when you want to add diagnostic information to the output file. The purpose of this class is to handle writing multiple LevelData to a single file. The dataset for the LevelData is created during construction, when the boxes are written. Any number of intervals from LevelData can then be written.

Special behavior can be selected with the policy flags:

With MPI-everywhere on x86 architectures, it is highly likely that the default policy CH_HDF5::IOPolicyDefault gives the best performance (i.e., use internal linearization and independent I/O). In some limited testing (2 procs, 20 cores each): IOPolicyDefault - 6.77 IOPolicyCollectiveWrite - 33.33 IOPolicyMultiDimHyperslab - 168.14 IOPolicyCollectiveWrite | IOPolicyMultiDimHyperslab - 30.94 which is difficult to make sense of.

Note:
  • Users are resposible for matching the total number of components used to allocate the dataset match the number of levelData added to the dataset
  • Only a single datatype is supported per file
  • Since the dataset must be created in advance, T can only be statically allocatable (T::preAllocatable() == 0)
  • API 1.6 is not supported

Public Member Functions

 WriteMultiData (HDF5Handle &a_handle, const BoxLayout &a_layout, const int a_numIntv, const string &a_name, const int a_policyFlags=CH_HDF5::IOPolicyDefault, const IntVect &a_outputGhost=IntVect::Zero, const bool a_newForm=false)
 Constructor writes boxes and allocates dataset for LevelData.
 ~WriteMultiData ()
 Destructor.
int writeData (const BoxLayoutData< T > &a_data, const Interval &a_intvMem, const Interval &a_intvFile)
 Write an interval of LevelData to the dataset.

Protected Attributes

const int m_policyFlags
 Policies.
const IntVect m_outputGhost
 Number of ghost cells written.
const bool m_newForm
 ?
char m_dataname [128]
 Name for level data dataset.
hid_t m_dataSet
 Dataset for level data.
Interval m_allIntvFile
 Interval for components in file.
long m_maxBoxPerProc
 Maximum boxes written by any proc.
Vector< Vector< long long > > m_offsets
Vector< hid_t > m_types
 Type of data written.

Private Member Functions

 WriteMultiData (const WriteMultiData &)
WriteMultiDataoperator= (const WriteMultiData)

Constructor & Destructor Documentation

template<class T>
WriteMultiData< T >::WriteMultiData ( HDF5Handle a_handle,
const BoxLayout a_layout,
const int  a_numIntv,
const string &  a_name,
const int  a_policyFlags = CH_HDF5::IOPolicyDefault,
const IntVect a_outputGhost = IntVect::Zero,
const bool  a_newForm = false 
) [inline]

Constructor writes boxes and allocates dataset for LevelData.

Write boxes, processors, attributes and creates a dataset for all the level data to be written. The dataset is closed on destruction.

Parameters:
[in] a_handle Chombo HDF5 handle holding open file for writing
[in] a_layout Box layout for all data to be written
[in] a_numIntv Total number of components that will be written from all BoxLayoutData or LevelData
[in] a_name Name of the dataset for the level data.
[in] a_policyFlags Either CH_HDF5::IOPolicyDefault - Use internal T.linearOut(...) to linearize data and processes independently write to file, but still in parallel. or a union (|) of the following flags: CH_HDF5::IOPolicyMultiDimHyperslab - The memory dataspace will be set up so that HDF5 linearizes the data. Using this requires T.dataPtr() and contiguous memory (so things like T=FluxBox will not work). CH_HDF5::IOPolicyCollectiveWrite - The write for each dataset will be collective.
[in] a_outputGhost Number of ghost cells that will be written to the data file. Any data written must have this many ghosts
[in] a_newForm ?

References CH_assert, CH_TIME, Interval::define(), HDF5Handle::getGroup(), HDF5Handle::groupID(), WriteMultiData< T >::m_allIntvFile, WriteMultiData< T >::m_dataname, WriteMultiData< T >::m_dataSet, HDF5HeaderData::m_int, HDF5HeaderData::m_intvect, WriteMultiData< T >::m_maxBoxPerProc, WriteMultiData< T >::m_newForm, WriteMultiData< T >::m_offsets, WriteMultiData< T >::m_outputGhost, HDF5HeaderData::m_string, WriteMultiData< T >::m_types, name(), procID(), HDF5Handle::setGroup(), Interval::size(), BoxLayout::size(), write(), and HDF5HeaderData::writeToFile().

template<class T>
WriteMultiData< T >::~WriteMultiData (  )  [inline]

Destructor.

References WriteMultiData< T >::m_dataSet.

template<class T>
WriteMultiData< T >::WriteMultiData ( const WriteMultiData< T > &   )  [private]


Member Function Documentation

template<class T>
WriteMultiData& WriteMultiData< T >::operator= ( const   WriteMultiData  )  [private]

template<class T>
int WriteMultiData< T >::writeData ( const BoxLayoutData< T > &  a_data,
const Interval a_intvMem,
const Interval a_intvFile 
) [inline]


Member Data Documentation

template<class T>
const int WriteMultiData< T >::m_policyFlags [protected]

Policies.

Referenced by WriteMultiData< T >::writeData().

template<class T>
const IntVect WriteMultiData< T >::m_outputGhost [protected]

Number of ghost cells written.

Referenced by WriteMultiData< T >::writeData(), and WriteMultiData< T >::WriteMultiData().

template<class T>
const bool WriteMultiData< T >::m_newForm [protected]

template<class T>
char WriteMultiData< T >::m_dataname[128] [protected]

Name for level data dataset.

Referenced by WriteMultiData< T >::WriteMultiData().

template<class T>
hid_t WriteMultiData< T >::m_dataSet [protected]

template<class T>
Interval WriteMultiData< T >::m_allIntvFile [protected]

template<class T>
long WriteMultiData< T >::m_maxBoxPerProc [protected]

Maximum boxes written by any proc.

Referenced by WriteMultiData< T >::writeData(), and WriteMultiData< T >::WriteMultiData().

template<class T>
Vector<Vector<long long> > WriteMultiData< T >::m_offsets [protected]

Offset in file for each process to write to

Referenced by WriteMultiData< T >::writeData(), and WriteMultiData< T >::WriteMultiData().

template<class T>
Vector<hid_t> WriteMultiData< T >::m_types [protected]


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

Generated on Sun Apr 30 03:27:30 2017 for Chombo + EB + MF by  doxygen 1.5.5