Skip to content
Snippets Groups Projects
Commit 2003879c authored by Wang, Ruonan's avatar Wang, Ruonan
Browse files

Added entry in DataManWriter engine for bp format

parent 055634d2
No related branches found
No related tags found
1 merge request!340for BP buffer over WAN
...@@ -33,6 +33,7 @@ public: ...@@ -33,6 +33,7 @@ public:
void Close(const int transportIndex = -1) final; void Close(const int transportIndex = -1) final;
private: private:
std::string m_UseFormat = "json";
bool m_DoRealTime = false; bool m_DoRealTime = false;
bool m_DoMonitor = false; bool m_DoMonitor = false;
transportman::DataMan m_Man; transportman::DataMan m_Man;
......
...@@ -22,13 +22,8 @@ namespace adios2 ...@@ -22,13 +22,8 @@ namespace adios2
template <class T> template <class T>
void DataManWriter::PutSyncCommon(Variable<T> &variable, const T *values) void DataManWriter::PutSyncCommon(Variable<T> &variable, const T *values)
{ {
// here comes your magic at Writing now variable.m_UserValues has the
// data
// passed by the user
// set variable
variable.SetData(values);
// This part will go away, this is just to monitor variables per rank variable.SetData(values);
if (variable.m_Shape.empty()) if (variable.m_Shape.empty())
{ {
...@@ -43,19 +38,28 @@ void DataManWriter::PutSyncCommon(Variable<T> &variable, const T *values) ...@@ -43,19 +38,28 @@ void DataManWriter::PutSyncCommon(Variable<T> &variable, const T *values)
variable.m_Start.assign(variable.m_Count.size(), 0); variable.m_Start.assign(variable.m_Count.size(), 0);
} }
nlohmann::json jmsg; if(m_UseFormat == "json"){
jmsg["doid"] = m_Name;
jmsg["var"] = variable.m_Name; nlohmann::json jmsg;
jmsg["dtype"] = GetType<T>(); jmsg["doid"] = m_Name;
jmsg["putshape"] = variable.m_Count; jmsg["var"] = variable.m_Name;
jmsg["varshape"] = variable.m_Shape; jmsg["dtype"] = GetType<T>();
jmsg["offset"] = variable.m_Start; jmsg["putshape"] = variable.m_Count;
jmsg["timestep"] = 0; jmsg["varshape"] = variable.m_Shape;
jmsg["bytes"] = jmsg["offset"] = variable.m_Start;
std::accumulate(variable.m_Shape.begin(), variable.m_Shape.end(), jmsg["timestep"] = 0;
sizeof(T), std::multiplies<size_t>()); jmsg["bytes"] =
std::accumulate(variable.m_Shape.begin(), variable.m_Shape.end(),
m_Man.WriteWAN(values, jmsg); sizeof(T), std::multiplies<size_t>());
m_Man.WriteWAN(values, jmsg);
}
if(m_UseFormat == "bp"){
// add bp serialization
}
if (m_DoMonitor) if (m_DoMonitor)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment