source: thirdparty/SZ/sz/include/VarSet.h @ 2c47b73

Revision 2c47b73, 1.9 KB checked in by Hal Finkel <hfinkel@…>, 6 years ago (diff)

more work on adding SZ (latest version)

  • Property mode set to 100644
Line 
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
14extern "C" {
15#endif
16
17#include <stdio.h>
18
19typedef 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
28typedef 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
49typedef struct SZ_VarSet
50{
51        unsigned short count;
52        struct SZ_Variable *header;
53        struct SZ_Variable *lastVar;
54} SZ_VarSet;
55
56void free_Variable_keepOriginalData(SZ_Variable* v);
57void free_Variable_keepCompressedBytes(SZ_Variable* v);
58void free_Variable_all(SZ_Variable* v);
59void 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);
62int SZ_batchDelVar_vset(SZ_VarSet* vset, char* varName);
63int SZ_batchDelVar(char* varName);
64
65SZ_Variable* SZ_searchVar(char* varName);
66void* SZ_getVarData(char* varName, size_t *r5, size_t *r4, size_t *r3, size_t *r2, size_t *r1);
67
68void free_VarSet_vset(SZ_VarSet *vset, int mode);
69void SZ_freeVarSet(int mode);
70
71void free_multisteps(sz_multisteps* multisteps);
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* ----- #ifndef _VarSet_H  ----- */
Note: See TracBrowser for help on using the repository browser.