Changeset 6461f57
- Timestamp:
- 06/15/18 15:18:49 (7 years ago)
- Branches:
- master, pympi
- Children:
- 2c47b73
- Parents:
- d6628a6
- git-author:
- Hal Finkel <hfinkel@…> (06/15/18 15:18:49)
- git-committer:
- Hal Finkel <hfinkel@…> (06/15/18 15:18:49)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GNUmakefile
rfb69232 r6461f57 58 58 -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/common \ 59 59 -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/dictBuilder \ 60 -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/decompress 60 -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/decompress \ 61 -Ithirdparty/SZ/sz/include 61 62 62 63 BASE_CPPFLAGS := $(BLOSC_CPPFLAGS) -I. -D__STDC_CONSTANT_MACROS … … 126 127 thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy.o \ 127 128 thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-sinksource.o \ 128 thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.o 129 thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.o \ 130 thirdparty/SZ/sz/src/ByteToolkit.o \ 131 thirdparty/SZ/sz/src/dataCompression.o \ 132 thirdparty/SZ/sz/src/DynamicIntArray.o \ 133 thirdparty/SZ/sz/src/iniparser.o \ 134 thirdparty/SZ/sz/src/CompressElement.o \ 135 thirdparty/SZ/sz/src/DynamicByteArray.o \ 136 thirdparty/SZ/sz/src/rw.o \ 137 thirdparty/SZ/sz/src/TightDataPointStorageI.o \ 138 thirdparty/SZ/sz/src/TightDataPointStorageD.o \ 139 thirdparty/SZ/sz/src/TightDataPointStorageF.o \ 140 thirdparty/SZ/sz/src/conf.o \ 141 thirdparty/SZ/sz/src/DynamicDoubleArray.o \ 142 thirdparty/SZ/sz/src/TypeManager.o \ 143 thirdparty/SZ/sz/src/dictionary.o \ 144 thirdparty/SZ/sz/src/DynamicFloatArray.o \ 145 thirdparty/SZ/sz/src/VarSet.o \ 146 thirdparty/SZ/sz/src/callZlib.o \ 147 thirdparty/SZ/sz/src/Huffman.o \ 148 thirdparty/SZ/sz/src/sz_float.o \ 149 thirdparty/SZ/sz/src/sz_double.o \ 150 thirdparty/SZ/sz/src/sz_int8.o \ 151 thirdparty/SZ/sz/src/sz_int16.o \ 152 thirdparty/SZ/sz/src/sz_int32.o \ 153 thirdparty/SZ/sz/src/sz_int64.o \ 154 thirdparty/SZ/sz/src/sz_uint8.o \ 155 thirdparty/SZ/sz/src/sz_uint16.o \ 156 thirdparty/SZ/sz/src/sz_uint32.o \ 157 thirdparty/SZ/sz/src/sz_uint64.o \ 158 thirdparty/SZ/sz/src/szd_uint8.o \ 159 thirdparty/SZ/sz/src/szd_uint16.o \ 160 thirdparty/SZ/sz/src/szd_uint32.o \ 161 thirdparty/SZ/sz/src/szd_uint64.o \ 162 thirdparty/SZ/sz/src/szd_float.o \ 163 thirdparty/SZ/sz/src/szd_double.o \ 164 thirdparty/SZ/sz/src/szd_int8.o \ 165 thirdparty/SZ/sz/src/szd_int16.o \ 166 thirdparty/SZ/sz/src/szd_int32.o \ 167 thirdparty/SZ/sz/src/szd_int64.o \ 168 thirdparty/SZ/sz/src/sz.o \ 169 thirdparty/SZ/sz/src/sz_float_pwr.o \ 170 thirdparty/SZ/sz/src/sz_double_pwr.o \ 171 thirdparty/SZ/sz/src/szd_float_pwr.o \ 172 thirdparty/SZ/sz/src/szd_double_pwr.o 129 173 130 174 FE_BLOSC_O := $(addprefix $(FEDIR)/,$(BLOSC_O)) -
GenericIO.cxx
rd6628a6 r6461f57 47 47 #include "blosc.h" 48 48 } 49 #include "sz.h" 49 50 50 51 #include <sstream> … … 352 353 const char *CompressName = "BLOSC"; 353 354 355 const char *LossyCompressName = "SZ"; 356 354 357 #pragma pack() 355 358 … … 363 366 364 367 static bool blosc_initialized = false; 368 static bool sz_initialized = false; 365 369 366 370 #ifndef GENERICIO_NO_MPI -
GenericIO.h
r5d57155 r6461f57 192 192 193 193 public: 194 struct LossyCompressionInfo { 195 enum LCMode { 196 LCModeNone, 197 LCModeAbs, 198 LCModeRel, 199 LCModeAbsAndRel, 200 LCModeAbsOrRel, 201 LCModePSNR 202 }; 203 204 LCMode Mode; 205 double AbsErrThreshold; 206 double RelErrThreshold; 207 double PSNRThreshold; 208 209 LossyCompressionInfo() 210 : Mode(LCModeNone), AbsErrThreshold(0.0), 211 RelErrThreshold(0.0), PSNRThreshold(0.0) {} 212 }; 213 194 214 class Variable { 195 215 private: … … 232 252 public: 233 253 template <typename T> 234 Variable(const std::string &N, T* D, unsigned Flags = 0) 254 Variable(const std::string &N, T* D, unsigned Flags = 0, 255 const LossyCompressionInfo &LCI = LossyCompressionInfo()) 235 256 : Name(N), Data((void *) D), HasExtraSpace(Flags & VarHasExtraSpace), 236 257 IsPhysCoordX(Flags & VarIsPhysCoordX), 237 258 IsPhysCoordY(Flags & VarIsPhysCoordY), 238 259 IsPhysCoordZ(Flags & VarIsPhysCoordZ), 239 MaybePhysGhost(Flags & VarMaybePhysGhost) { 260 MaybePhysGhost(Flags & VarMaybePhysGhost), 261 LCI(LCI) { 240 262 deduceTypeInfo(D); 241 263 } … … 243 265 template <typename T> 244 266 Variable(const std::string &N, std::size_t NumElements, T* D, 245 unsigned Flags = 0) 267 unsigned Flags = 0, 268 const LossyCompressionInfo &LCI = LossyCompressionInfo()) 246 269 : Name(N), Data((void *) D), HasExtraSpace(Flags & VarHasExtraSpace), 247 270 IsPhysCoordX(Flags & VarIsPhysCoordX), 248 271 IsPhysCoordY(Flags & VarIsPhysCoordY), 249 272 IsPhysCoordZ(Flags & VarIsPhysCoordZ), 250 MaybePhysGhost(Flags & VarMaybePhysGhost) { 273 MaybePhysGhost(Flags & VarMaybePhysGhost), 274 LCI(LCI) { 251 275 deduceTypeInfoFromElement(D); 252 276 Size = ElementSize*NumElements; 253 277 } 254 278 255 Variable(const VariableInfo &VI, void *D, unsigned Flags = 0) 279 Variable(const VariableInfo &VI, void *D, unsigned Flags = 0, 280 const LossyCompressionInfo &LCI = LossyCompressionInfo()) 256 281 : Name(VI.Name), Size(VI.Size), IsFloat(VI.IsFloat), 257 282 IsSigned(VI.IsSigned), Data(D), … … 261 286 IsPhysCoordZ((Flags & VarIsPhysCoordZ) || VI.IsPhysCoordZ), 262 287 MaybePhysGhost((Flags & VarMaybePhysGhost) || VI.MaybePhysGhost), 263 ElementSize(VI.ElementSize) {}288 ElementSize(VI.ElementSize), LCI(LCI) {} 264 289 265 290 std::string Name; … … 272 297 bool MaybePhysGhost; 273 298 std::size_t ElementSize; 299 300 LossyCompressionInfo LCI; 274 301 }; 275 302 … … 341 368 template <typename T> 342 369 void addVariable(const std::string &Name, T *Data, 343 unsigned Flags = 0) { 344 Vars.push_back(Variable(Name, Data, Flags)); 370 unsigned Flags = 0, 371 const LossyCompressionInfo &LCI = LossyCompressionInfo()) { 372 Vars.push_back(Variable(Name, Data, Flags, LCI)); 345 373 } 346 374 347 375 template <typename T, typename A> 348 376 void addVariable(const std::string &Name, std::vector<T, A> &Data, 349 unsigned Flags = 0) { 377 unsigned Flags = 0, 378 const LossyCompressionInfo &LCI = LossyCompressionInfo()) { 350 379 T *D = Data.empty() ? 0 : &Data[0]; 351 addVariable(Name, D, Flags );380 addVariable(Name, D, Flags, LCI); 352 381 } 353 382 354 383 void addVariable(const VariableInfo &VI, void *Data, 355 unsigned Flags = 0) { 356 Vars.push_back(Variable(VI, Data, Flags)); 384 unsigned Flags = 0, 385 const LossyCompressionInfo &LCI = LossyCompressionInfo()) { 386 Vars.push_back(Variable(VI, Data, Flags, LCI)); 357 387 } 358 388 359 389 template <typename T> 360 390 void addScalarizedVariable(const std::string &Name, T *Data, 361 std::size_t NumElements, unsigned Flags = 0) { 362 Vars.push_back(Variable(Name, NumElements, Data, Flags)); 391 std::size_t NumElements, unsigned Flags = 0, 392 const LossyCompressionInfo &LCI = LossyCompressionInfo()) { 393 Vars.push_back(Variable(Name, NumElements, Data, Flags, LCI)); 363 394 } 364 395 365 396 template <typename T, typename A> 366 397 void addScalarizedVariable(const std::string &Name, std::vector<T, A> &Data, 367 std::size_t NumElements, unsigned Flags = 0) { 398 std::size_t NumElements, unsigned Flags = 0, 399 const LossyCompressionInfo &LCI = LossyCompressionInfo()) { 368 400 T *D = Data.empty() ? 0 : &Data[0]; 369 addScalarizedVariable(Name, D, NumElements, Flags );401 addScalarizedVariable(Name, D, NumElements, Flags, LCI); 370 402 } 371 403
Note: See TracChangeset
for help on using the changeset viewer.