Skip to content

Commit

Permalink
try more
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonRuonanWang committed Mar 24, 2022
1 parent 16922b7 commit 8d0ddd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions testing/adios2/engine/dataman/TestDataMan2DSz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void GenData(std::vector<T> &data, const size_t step)
{
for (size_t i = 0; i < data.size(); ++i)
{
data[i] = i + 10000 + step * 100;
data[i] = i + 10000 + step * 100 + 0.00001 * static_cast<float>(i);
}
}

Expand All @@ -63,7 +63,8 @@ void VerifyData(const std::complex<T> *data, const size_t size, size_t step)
GenData(tmpdata, step);
for (size_t i = 0; i < size; ++i)
{
ASSERT_EQ(data[i], tmpdata[i]);
ASSERT_LT(abs(data[i].real() - tmpdata[i].real()), 0.01);
ASSERT_LT(abs(data[i].imag() - tmpdata[i].imag()), 0.01);
}
}

Expand All @@ -74,7 +75,7 @@ void VerifyData(const T *data, const size_t size, size_t step)
GenData(tmpdata, step);
for (size_t i = 0; i < size; ++i)
{
ASSERT_EQ(data[i], tmpdata[i]);
ASSERT_LT(abs(static_cast<double>(data[i] - tmpdata[i])), 0.01);
}
}

Expand All @@ -93,6 +94,10 @@ void DataManWriter(const Dims &shape, const Dims &start, const Dims &count,
adios2::IO dataManIO = adios.DeclareIO("WAN");
dataManIO.SetEngine("DataMan");
dataManIO.SetParameters(engineParams);
dataManIO.AddOperation("bpFloats", "sz", {{"accuracy", "0.01"}});
dataManIO.AddOperation("bpDoubles", "sz", {{"accuracy", "0.01"}});
dataManIO.AddOperation("bpComplexes", "sz", {{"accuracy", "0.01"}});
dataManIO.AddOperation("bpDComplexes", "sz", {{"accuracy", "0.01"}});
std::vector<char> myChars(datasize);
std::vector<unsigned char> myUChars(datasize);
std::vector<short> myShorts(datasize);
Expand Down

0 comments on commit 8d0ddd9

Please sign in to comment.