...
 
Commits (3)
This diff is collapsed.
......@@ -32,7 +32,9 @@ public:
/// @brief Set the filename.
///
/// Default value is "sensei.bp"
void SetFileName(const std::string &filename) { this->m_FileName = filename; }
void SetStreamName(const std::string &filename) {
this->m_FileName = filename;
}
void SetStreaming(bool streamOption) { this->m_DoStreaming = streamOption; }
......
......@@ -15,6 +15,7 @@
#include <vtkObjectFactory.h>
#include <vtkSmartPointer.h>
#include <pugixml.hpp>
#include <sstream>
namespace sensei {
......@@ -33,6 +34,32 @@ void HDF5DataAdaptor::SetStreamName(const std::string &name) {
m_StreamName = name;
}
int HDF5DataAdaptor::Initialize(pugi::xml_node &node) {
timer::MarkEvent mark("HDF5DataAdaptor::Initialize");
this->InTransitDataAdaptor::Initialize(node);
pugi::xml_attribute filename = node.attribute("filename");
pugi::xml_attribute methodAttr = node.attribute("method");
if (filename)
SetStreamName(filename.value());
if (methodAttr) {
std::string method = methodAttr.value();
if (method.size() > 0) {
bool doStreaming = ('s' == method[0]);
bool doCollectiveTxf = ((method.size() > 1) && ('c' == method[1]));
SetStreaming(doStreaming);
SetCollective(doCollectiveTxf);
}
}
return 0;
}
//----------------------------------------------------------------------------
// int HDF5DataAdaptor::Open(const std::string& fileName)
int HDF5DataAdaptor::OpenStream() {
......
......@@ -55,6 +55,7 @@ public:
int CloseStream() override;
int AdvanceStream() override;
int StreamGood() override;
int Initialize(pugi::xml_node &parent) override;
int Finalize() override;
int GetSenderMeshMetadata(unsigned int id,
MeshMetadataPtr &metadata) override;
......
if (BUILD_TESTING)
senseiAddTest(testHDF5Write
COMMAND testHDF5 w 4 n h5test
SOURCES testHDF5.cpp LIBS sensei)
senseiAddTest(testHDF5Read
COMMAND testHDF5 r h5test.n1)
senseiAddTest(testHistogramSerial
COMMAND testHistogram EXEC_NAME testHistogram
......
This diff is collapsed.