Skip to content

Commit

Permalink
Merge pull request #1196 from pnorbert/mgard-option
Browse files Browse the repository at this point in the history
Support option 'accuracy' in MGARD, as a synonym for tolerance
  • Loading branch information
pnorbert authored Feb 15, 2019
2 parents 6b3e87e + 873666b commit 2035c69
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions source/adios2/operator/compress/CompressMGARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,26 @@ size_t CompressMGARD::Compress(const void *dataIn, const Dims &dimensions,
}

// Parameters
bool hasTolerance = false;
double tolerance;
auto itAccuracy = parameters.find("accuracy");
if (itAccuracy != parameters.end())
{
tolerance = std::stod(itAccuracy->second);
hasTolerance = true;
}
auto itTolerance = parameters.find("tolerance");
if (m_DebugMode)
if (itTolerance != parameters.end())
{
if (itTolerance == parameters.end())
{
throw std::invalid_argument("ERROR: missing mandatory parameter "
"tolerance for MGARD compression "
"operator, in call to Put\n");
}
tolerance = std::stod(itTolerance->second);
hasTolerance = true;
}
if (!hasTolerance)
{
throw std::invalid_argument("ERROR: missing mandatory parameter "
"tolerance for MGARD compression "
"operator\n");
}

double tolerance = std::stod(itTolerance->second);

int sizeOut = 0;
unsigned char *dataOutPtr =
Expand Down

0 comments on commit 2035c69

Please sign in to comment.