Skip to content

Commit

Permalink
Merge pull request #2961 from JasonRuonanWang/operator
Browse files Browse the repository at this point in the history
rename OperatorType enum
  • Loading branch information
JasonRuonanWang authored Nov 30, 2021
2 parents 25f91bb + 9910596 commit a8d119a
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions source/adios2/core/Operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ class Operator

enum OperatorType : char
{
BLOSC = 0,
BZIP2 = 1,
LIBPRESSIO = 2,
MGARD = 3,
PNG = 4,
SIRIUS = 5,
Sz = 6,
ZFP = 7
COMPRESS_BLOSC = 0,
COMPRESS_BZIP2 = 1,
COMPRESS_LIBPRESSIO = 2,
COMPRESS_MGARD = 3,
COMPRESS_PNG = 4,
COMPRESS_SIRIUS = 5,
COMPRESS_SZ = 6,
COMPRESS_ZFP = 7
};

protected:
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressBZIP2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ size_t CompressBZIP2::Operate(const char *dataIn, const Dims &blockStart,
unsigned int destOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, destOffset, OperatorType::BZIP2);
PutParameter(bufferOut, destOffset, OperatorType::COMPRESS_BZIP2);
PutParameter(bufferOut, destOffset, bufferVersion);
PutParameter(bufferOut, destOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressBlosc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ size_t CompressBlosc::Operate(const char *dataIn, const Dims &blockStart,
const uint8_t bufferVersion = 1;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::BLOSC);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_BLOSC);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressLibPressio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ size_t CompressLibPressio::Operate(const char *dataIn, const Dims &blockStart,
size_t bufferOutOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::LIBPRESSIO);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_LIBPRESSIO);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressMGARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ size_t CompressMGARD::Operate(const char *dataIn, const Dims &blockStart,
size_t bufferOutOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::MGARD);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_MGARD);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressPNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ size_t CompressPNG::Operate(const char *dataIn, const Dims &blockStart,
const uint8_t bufferVersion = 1;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::PNG);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_PNG);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressSZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ size_t CompressSZ::Operate(const char *dataIn, const Dims &blockStart,
size_t bufferOutOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::Sz);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_SZ);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressSirius.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ size_t CompressSirius::Operate(const char *dataIn, const Dims &blockStart,
size_t bufferOutOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::SIRIUS);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_SIRIUS);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/operator/compress/CompressZFP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ size_t CompressZFP::Operate(const char *dataIn, const Dims &blockStart,
size_t bufferOutOffset = 0;

// Universal operator metadata
PutParameter(bufferOut, bufferOutOffset, OperatorType::ZFP);
PutParameter(bufferOut, bufferOutOffset, OperatorType::COMPRESS_ZFP);
PutParameter(bufferOut, bufferOutOffset, bufferVersion);
PutParameter(bufferOut, bufferOutOffset, static_cast<uint16_t>(0));
// Universal operator metadata end
Expand Down
16 changes: 8 additions & 8 deletions source/adios2/operator/compress/CompressorFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
Operator::OperatorType compressorType;
std::memcpy(&compressorType, bufferIn, 1);

if (compressorType == Operator::OperatorType::BLOSC)
if (compressorType == Operator::OperatorType::COMPRESS_BLOSC)
{
#ifdef ADIOS2_HAVE_BLOSC
compress::CompressBlosc op({});
Expand All @@ -184,7 +184,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with BLOSC, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::BZIP2)
else if (compressorType == Operator::OperatorType::COMPRESS_BZIP2)
{
#ifdef ADIOS2_HAVE_BZIP2
compress::CompressBZIP2 op({});
Expand All @@ -194,7 +194,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with BZIP2, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::LIBPRESSIO)
else if (compressorType == Operator::OperatorType::COMPRESS_LIBPRESSIO)
{
#ifdef ADIOS2_HAVE_LIBPRESSIO
compress::CompressLibPressio op({});
Expand All @@ -204,7 +204,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with LibPressio, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::MGARD)
else if (compressorType == Operator::OperatorType::COMPRESS_MGARD)
{
#ifdef ADIOS2_HAVE_MGARD
compress::CompressMGARD op({});
Expand All @@ -214,7 +214,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with MGARD, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::PNG)
else if (compressorType == Operator::OperatorType::COMPRESS_PNG)
{
#ifdef ADIOS2_HAVE_PNG
compress::CompressPNG op({});
Expand All @@ -224,7 +224,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with PNG, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::SIRIUS)
else if (compressorType == Operator::OperatorType::COMPRESS_SIRIUS)
{
#ifdef ADIOS2_HAVE_MHS
compress::CompressSirius op({});
Expand All @@ -234,7 +234,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with MHS, can't use Sirius compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::Sz)
else if (compressorType == Operator::OperatorType::COMPRESS_SZ)
{
#ifdef ADIOS2_HAVE_SZ
compress::CompressSZ op({});
Expand All @@ -244,7 +244,7 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn,
"with SZ, can't use compressor\n");
#endif
}
else if (compressorType == Operator::OperatorType::ZFP)
else if (compressorType == Operator::OperatorType::COMPRESS_ZFP)
{
#ifdef ADIOS2_HAVE_ZFP
compress::CompressZFP op({});
Expand Down

0 comments on commit a8d119a

Please sign in to comment.