| [f2eb077] | 1 | #if !adc_h
|
|---|
| 2 | #define adc_h 1
|
|---|
| 3 |
|
|---|
| 4 | /* For checking of L2-cache performance influence */
|
|---|
| 5 | /*#define IN_CORE_*/
|
|---|
| 6 | /*#define VIEW_FILE_OUTPUT*/ /* it can be used with IN_CORE only */
|
|---|
| 7 |
|
|---|
| 8 | /* Optimizations: prefixed views and share-sorted views */
|
|---|
| 9 | /*#define OPTIMIZATION*/
|
|---|
| 10 |
|
|---|
| 11 | #ifdef WINNT
|
|---|
| 12 | #ifndef HAS_INT64
|
|---|
| 13 | typedef __int64 int64;
|
|---|
| 14 | typedef int int32;
|
|---|
| 15 | #endif
|
|---|
| 16 | typedef unsigned __int64 uint64;
|
|---|
| 17 | typedef unsigned int uint32;
|
|---|
| 18 | #else
|
|---|
| 19 | #ifndef HAS_INT64
|
|---|
| 20 | typedef long long int64;
|
|---|
| 21 | typedef int int32;
|
|---|
| 22 | #endif
|
|---|
| 23 | typedef unsigned long long uint64;
|
|---|
| 24 | typedef unsigned int uint32;
|
|---|
| 25 | #endif
|
|---|
| 26 |
|
|---|
| 27 | #include "adcc.h"
|
|---|
| 28 | #include "rbt.h"
|
|---|
| 29 |
|
|---|
| 30 | static int measbound=31415; /* upper limit on a view measre bound */
|
|---|
| 31 |
|
|---|
| 32 | enum { smallestParent, prefixedParent, sharedSortParent, noneParent };
|
|---|
| 33 |
|
|---|
| 34 | static const char* adcKeyword[]={
|
|---|
| 35 | "attrNum",
|
|---|
| 36 | "measuresNum",
|
|---|
| 37 | "tuplesNum",
|
|---|
| 38 | "INVERSE_ENDIAN",
|
|---|
| 39 | "fileName",
|
|---|
| 40 | "class",
|
|---|
| 41 | NULL
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 | typedef struct ADCpar{
|
|---|
| 45 | int ndid;
|
|---|
| 46 | int dim;
|
|---|
| 47 | int mnum;
|
|---|
| 48 | long long int tuplenum;
|
|---|
| 49 | int inverse_endian;
|
|---|
| 50 | const char *filename;
|
|---|
| 51 | char clss;
|
|---|
| 52 | } ADC_PAR;
|
|---|
| 53 |
|
|---|
| 54 | typedef struct {
|
|---|
| 55 | int32 ndid;
|
|---|
| 56 | char clss;
|
|---|
| 57 | char adcName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 58 | char adcInpFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 59 | uint32 nd;
|
|---|
| 60 | uint32 nm;
|
|---|
| 61 | uint32 nInputRecs;
|
|---|
| 62 | uint32 memoryLimit;
|
|---|
| 63 | uint32 nTasks;
|
|---|
| 64 | /* FILE *statf; */
|
|---|
| 65 | } ADC_VIEW_PARS;
|
|---|
| 66 |
|
|---|
| 67 | typedef struct job_pool{
|
|---|
| 68 | uint32 grpb;
|
|---|
| 69 | uint32 nv;
|
|---|
| 70 | uint32 nRows;
|
|---|
| 71 | int64 viewOffset;
|
|---|
| 72 | } JOB_POOL;
|
|---|
| 73 |
|
|---|
| 74 | typedef struct layer{
|
|---|
| 75 | uint32 layerIndex;
|
|---|
| 76 | uint32 layerQuantityLimit;
|
|---|
| 77 | uint32 layerCurrentPopulation;
|
|---|
| 78 | } LAYER;
|
|---|
| 79 |
|
|---|
| 80 | typedef struct chunks{
|
|---|
| 81 | uint32 curChunkNum;
|
|---|
| 82 | int64 chunkOffset;
|
|---|
| 83 | uint32 posSubChunk;
|
|---|
| 84 | uint32 curSubChunk;
|
|---|
| 85 | } CHUNKS;
|
|---|
| 86 |
|
|---|
| 87 | typedef struct tuplevsize {
|
|---|
| 88 | uint64 viewsize;
|
|---|
| 89 | uint64 tuple;
|
|---|
| 90 | } TUPLE_VIEWSIZE;
|
|---|
| 91 |
|
|---|
| 92 | typedef struct tupleones {
|
|---|
| 93 | uint32 nOnes;
|
|---|
| 94 | uint64 tuple;
|
|---|
| 95 | } TUPLE_ONES;
|
|---|
| 96 |
|
|---|
| 97 | typedef struct {
|
|---|
| 98 | char adcName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 99 | uint32 retCode;
|
|---|
| 100 | uint32 verificationFailed;
|
|---|
| 101 | uint32 swapIt;
|
|---|
| 102 | uint32 nTasks;
|
|---|
| 103 | uint32 taskNumber;
|
|---|
| 104 | int32 ndid;
|
|---|
| 105 |
|
|---|
| 106 | uint32 nTopDims; /* given number of dimension attributes */
|
|---|
| 107 | uint32 nm; /* number of measures */
|
|---|
| 108 | uint32 nd; /* number of parent's dimensions */
|
|---|
| 109 | uint32 nv; /* number of child's dimensions */
|
|---|
| 110 |
|
|---|
| 111 | uint32 nInputRecs;
|
|---|
| 112 | uint32 nViewRows;
|
|---|
| 113 | uint32 totalOfViewRows;
|
|---|
| 114 | uint32 nParentViewRows;
|
|---|
| 115 |
|
|---|
| 116 | int64 viewOffset;
|
|---|
| 117 | int64 accViewFileOffset;
|
|---|
| 118 |
|
|---|
| 119 | uint32 inpRecSize;
|
|---|
| 120 | uint32 outRecSize;
|
|---|
| 121 |
|
|---|
| 122 | uint32 memoryLimit;
|
|---|
| 123 | unsigned char * memPool;
|
|---|
| 124 | uint32 * inpDataBuffer;
|
|---|
| 125 |
|
|---|
| 126 | RBTree *tree;
|
|---|
| 127 |
|
|---|
| 128 | uint32 numberOfChunks;
|
|---|
| 129 | CHUNKS *chunksParams;
|
|---|
| 130 |
|
|---|
| 131 | char adcLogFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 132 | char inpFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 133 | char viewFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 134 | char chunksFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 135 | char groupbyFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 136 | char adcViewSizesFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 137 | char viewSizesFileName[MAX_FILE_FULL_PATH_SIZE];
|
|---|
| 138 |
|
|---|
| 139 | FILE *logf;
|
|---|
| 140 | FILE *inpf;
|
|---|
| 141 | FILE *viewFile;
|
|---|
| 142 | FILE *fileOfChunks;
|
|---|
| 143 | FILE *groupbyFile;
|
|---|
| 144 | FILE *adcViewSizesFile;
|
|---|
| 145 | FILE *viewSizesFile;
|
|---|
| 146 |
|
|---|
| 147 | int64 mSums[MAX_NUM_OF_MEAS];
|
|---|
| 148 | uint32 selection[MAX_NUM_OF_DIMS];
|
|---|
| 149 | int64 checksums[MAX_NUM_OF_MEAS]; /* view checksums */
|
|---|
| 150 | int64 totchs[MAX_NUM_OF_MEAS]; /* checksums of a group of views */
|
|---|
| 151 |
|
|---|
| 152 | JOB_POOL *jpp;
|
|---|
| 153 | LAYER *lpp;
|
|---|
| 154 | uint32 nViewLimit;
|
|---|
| 155 | uint32 groupby;
|
|---|
| 156 | uint32 smallestParentLevel;
|
|---|
| 157 | uint32 parBinRepTuple;
|
|---|
| 158 | uint32 nRowsToRead;
|
|---|
| 159 | uint32 fromParent;
|
|---|
| 160 |
|
|---|
| 161 | uint64 totalViewFileSize; /* in bytes */
|
|---|
| 162 | uint32 numberOfMadeViews;
|
|---|
| 163 | uint32 numberOfViewsMadeFromInput;
|
|---|
| 164 | uint32 numberOfPrefixedGroupbys;
|
|---|
| 165 | uint32 numberOfSharedSortGroupbys;
|
|---|
| 166 | } ADC_VIEW_CNTL;
|
|---|
| 167 | #endif /* adc_h */
|
|---|