Skip to content

Commit

Permalink
modified compression parameter form in dataman serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonRuonanWang committed Oct 26, 2020
1 parent eeda865 commit 84f58b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
9 changes: 3 additions & 6 deletions source/adios2/toolkit/format/dataman/DataManSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,10 @@ void DataManSerializer::JsonToVarMap(nlohmann::json &metaJ, VecPtr pack)
var.compression = it->get<std::string>();
}

for (auto i = varBlock.begin(); i != varBlock.end(); ++i)
it = varBlock.find("ZP");
if (it != varBlock.end())
{
auto pos = i.key().find(":");
if (pos != std::string::npos)
{
var.params[i.key().substr(pos + 1)] = i.value();
}
var.params = it->get<Params>();
}

if (m_DataManVarMap[var.step] == nullptr)
Expand Down
19 changes: 6 additions & 13 deletions source/adios2/toolkit/format/dataman/DataManSerializer.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ void DataManSerializer::PutData(
{
compressed = PutZfp<T>(metaj, datasize, inputData, varCount,
ops[0].Parameters);
if (compressed)
{
metaj["Z"] = "zfp";
}
}
}
else if (compressionMethod == "sz")
Expand All @@ -182,10 +178,6 @@ void DataManSerializer::PutData(
{
compressed = PutSz<T>(metaj, datasize, inputData, varCount,
ops[0].Parameters);
if (compressed)
{
metaj["Z"] = "sz";
}
}
}
else if (compressionMethod == "bzip2")
Expand All @@ -195,10 +187,6 @@ void DataManSerializer::PutData(
{
compressed = PutBZip2<T>(metaj, datasize, inputData, varCount,
ops[0].Parameters);
if (compressed)
{
metaj["Z"] = "bzip2";
}
}
}
else
Expand All @@ -208,7 +196,12 @@ void DataManSerializer::PutData(
}
}

if (compressed == false)
if (compressed)
{
metaj["Z"] = compressionMethod;
metaj["ZP"] = ops[0].Parameters;
}
else
{
datasize = std::accumulate(varCount.begin(), varCount.end(), sizeof(T),
std::multiplies<size_t>());
Expand Down

0 comments on commit 84f58b0

Please sign in to comment.