[2c47b73] | 1 | /** |
---|
| 2 | * @file VarSet.h |
---|
| 3 | * @author Sheng Di |
---|
| 4 | * @date July, 2016 |
---|
| 5 | * @brief Header file for the Variable.c. |
---|
| 6 | * (C) 2016 by Mathematics and Computer Science (MCS), Argonne National Laboratory. |
---|
| 7 | * See COPYRIGHT in top-level directory. |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #ifndef _VarSet_H |
---|
| 11 | #define _VarSet_H |
---|
| 12 | |
---|
| 13 | #ifdef __cplusplus |
---|
| 14 | extern "C" { |
---|
| 15 | #endif |
---|
| 16 | |
---|
| 17 | #include <stdio.h> |
---|
| 18 | |
---|
| 19 | typedef struct sz_multisteps |
---|
| 20 | { |
---|
| 21 | char compressionType; |
---|
| 22 | int predictionMode; |
---|
| 23 | int lastSnapshotStep; //the previous snapshot step |
---|
| 24 | unsigned int currentStep; //current time step of the execution/simulation |
---|
| 25 | void* hist_data; //historical data in past time steps |
---|
| 26 | } sz_multisteps; |
---|
| 27 | |
---|
| 28 | typedef struct SZ_Variable |
---|
| 29 | { |
---|
| 30 | char* varName; |
---|
| 31 | char compressType; //102 means HZ; 101 means SZ |
---|
| 32 | int dataType; //SZ_FLOAT or SZ_DOUBLE |
---|
| 33 | size_t r5; |
---|
| 34 | size_t r4; |
---|
| 35 | size_t r3; |
---|
| 36 | size_t r2; |
---|
| 37 | size_t r1; |
---|
| 38 | int errBoundMode; |
---|
| 39 | double absErrBound; |
---|
| 40 | double relBoundRatio; |
---|
| 41 | double pwRelBoundRatio; |
---|
| 42 | void* data; |
---|
| 43 | sz_multisteps *multisteps; |
---|
| 44 | unsigned char* compressedBytes; |
---|
| 45 | size_t compressedSize; |
---|
| 46 | struct SZ_Variable* next; |
---|
| 47 | } SZ_Variable; |
---|
| 48 | |
---|
| 49 | typedef struct SZ_VarSet |
---|
| 50 | { |
---|
| 51 | unsigned short count; |
---|
| 52 | struct SZ_Variable *header; |
---|
| 53 | struct SZ_Variable *lastVar; |
---|
| 54 | } SZ_VarSet; |
---|
| 55 | |
---|
| 56 | void free_Variable_keepOriginalData(SZ_Variable* v); |
---|
| 57 | void free_Variable_keepCompressedBytes(SZ_Variable* v); |
---|
| 58 | void free_Variable_all(SZ_Variable* v); |
---|
| 59 | void SZ_batchAddVar(char* varName, int dataType, void* data, |
---|
| 60 | int errBoundMode, double absErrBound, double relBoundRatio, double pwRelBoundRatio, |
---|
| 61 | size_t r5, size_t r4, size_t r3, size_t r2, size_t r1); |
---|
| 62 | int SZ_batchDelVar_vset(SZ_VarSet* vset, char* varName); |
---|
| 63 | int SZ_batchDelVar(char* varName); |
---|
| 64 | |
---|
| 65 | SZ_Variable* SZ_searchVar(char* varName); |
---|
| 66 | void* SZ_getVarData(char* varName, size_t *r5, size_t *r4, size_t *r3, size_t *r2, size_t *r1); |
---|
| 67 | |
---|
| 68 | void free_VarSet_vset(SZ_VarSet *vset, int mode); |
---|
| 69 | void SZ_freeVarSet(int mode); |
---|
| 70 | |
---|
| 71 | void free_multisteps(sz_multisteps* multisteps); |
---|
| 72 | |
---|
| 73 | #ifdef __cplusplus |
---|
| 74 | } |
---|
| 75 | #endif |
---|
| 76 | |
---|
| 77 | #endif /* ----- #ifndef _VarSet_H ----- */ |
---|