diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-16 16:55:14 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-16 16:55:14 -0400 |
commit | 6ea9939e0610a809f6f47d13ec68df00d1ca0afc (patch) | |
tree | fe4a2eee3ddcf77e2367309dcd75a232b76dcd62 /dis/original | |
parent | e9285d0cdea756a2830f0ace378e4197b36869aa (diff) |
Move the DIS benchmarks up a directory and update hardcoded paths
Note that this repo does not attempt to keep a copy of the original
DIS benchmark distributions. UNC real-time has another repo for that.
Diffstat (limited to 'dis/original')
77 files changed, 0 insertions, 5810 deletions
diff --git a/dis/original/Field/DISstressmarkRNG.h b/dis/original/Field/DISstressmarkRNG.h deleted file mode 100644 index 4aa2620..0000000 --- a/dis/original/Field/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Field/field.c b/dis/original/Field/field.c deleted file mode 100644 index 8565e8c..0000000 --- a/dis/original/Field/field.c +++ /dev/null | |||
@@ -1,153 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Field Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | |||
16 | #include <stdio.h> | ||
17 | #include <time.h> | ||
18 | #include <assert.h> | ||
19 | #include <stdlib.h> | ||
20 | #include "DISstressmarkRNG.h" | ||
21 | #include "extra.h" | ||
22 | |||
23 | |||
24 | #define MIN_FIELD_SIZE 16 | ||
25 | #define MAX_FIELD_SIZE (16777216*4) // This has been quadrupled from original | ||
26 | #define MIN_SEED -2147483647 | ||
27 | #define MAX_SEED -1 | ||
28 | #define MIN_MOD_OFFSET 0 | ||
29 | #define MAX_MOD_OFFSET 65535 | ||
30 | #define MIN_TOKENS 1 | ||
31 | #define MAX_TOKENS 256 | ||
32 | #define MIN_TOKEN_LENGTH 1 | ||
33 | #define MAX_TOKEN_LENGTH 8 | ||
34 | #define MIN_TOKEN_VALUE 0 | ||
35 | #define MAX_TOKEN_VALUE 255 | ||
36 | #define MAX_SUBFIELDS 256 | ||
37 | |||
38 | /* | ||
39 | * main() | ||
40 | */ | ||
41 | |||
42 | int main(int argc, char** argv){ | ||
43 | SET_UP | ||
44 | unsigned char *field; | ||
45 | unsigned int f; | ||
46 | int seed; | ||
47 | int mod_offset; | ||
48 | unsigned int n; | ||
49 | |||
50 | time_t startTime; | ||
51 | |||
52 | struct tokenS{ | ||
53 | unsigned char delimiter[MAX_TOKEN_LENGTH]; | ||
54 | unsigned char length; | ||
55 | struct statisticS{ | ||
56 | unsigned int count; | ||
57 | unsigned char min; | ||
58 | unsigned char sum; | ||
59 | }stat[MAX_SUBFIELDS]; | ||
60 | unsigned char subfields; | ||
61 | }token[MAX_TOKENS]; | ||
62 | |||
63 | unsigned int l; | ||
64 | |||
65 | assert(fscanf(stdin, "%d %d %d %d", &f, &seed, &mod_offset, &n) == 4); | ||
66 | |||
67 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); | ||
68 | assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); | ||
69 | assert((mod_offset >= MIN_MOD_OFFSET) && (mod_offset <= MAX_MOD_OFFSET)); | ||
70 | assert((n >= MIN_TOKENS) && (n <= MAX_TOKENS)); | ||
71 | for (l=0; l<n; l++){ | ||
72 | int x; | ||
73 | int index; | ||
74 | index = 0; | ||
75 | assert(fscanf(stdin,"%x", &x) == 1); | ||
76 | while(x!=0){ | ||
77 | assert((x >= MIN_TOKEN_VALUE) && (x <= MAX_TOKEN_VALUE)); | ||
78 | token[l].delimiter[index] = (unsigned char )x; | ||
79 | index++; | ||
80 | assert(fscanf(stdin,"%x", &x) == 1); | ||
81 | } | ||
82 | assert((index >= MIN_TOKEN_LENGTH) && (index <= MAX_TOKEN_LENGTH)); | ||
83 | token[l].length = index; | ||
84 | } | ||
85 | |||
86 | if ((field = (unsigned char*)malloc(f*sizeof(unsigned char))) == NULL) | ||
87 | return (-1); | ||
88 | |||
89 | randInit(seed); | ||
90 | for (l =0; l<f; l++){ | ||
91 | field[l] = randInt(MIN_TOKEN_VALUE, MAX_TOKEN_VALUE); | ||
92 | } | ||
93 | |||
94 | startTime = time(NULL); | ||
95 | |||
96 | for (l =0; l<n; l++){ | ||
97 | START_LOOP | ||
98 | unsigned int index; | ||
99 | |||
100 | token[l].subfields = 0; | ||
101 | token[l].stat[0].count = 0; | ||
102 | token[l].stat[0].sum = 0; | ||
103 | token[l].stat[0].min = MAX_TOKEN_VALUE; | ||
104 | |||
105 | index = 0; | ||
106 | while ((index < f) && (token[l].subfields < MAX_SUBFIELDS)){ | ||
107 | unsigned char offset; | ||
108 | offset = 0; | ||
109 | while ((field[index+offset] == token[l].delimiter[offset]) && | ||
110 | (offset < token[l].length)){ | ||
111 | offset++; | ||
112 | } | ||
113 | |||
114 | if (offset == token[l].length){ | ||
115 | for (offset=0; offset<token[l].length; offset++){ | ||
116 | field[index+offset] = (field[index+offset] + | ||
117 | field[(index+offset+mod_offset) % f]) | ||
118 | %(MAX_TOKEN_VALUE+1); | ||
119 | } | ||
120 | index += token[l].length-1; | ||
121 | token[l].subfields++; | ||
122 | token[l].stat[token[l].subfields].count = 0; | ||
123 | token[l].stat[token[l].subfields].sum = 0; | ||
124 | token[l].stat[token[l].subfields].min = MAX_TOKEN_VALUE; | ||
125 | } | ||
126 | |||
127 | else{ | ||
128 | token[l].stat[token[l].subfields].count++; | ||
129 | token[l].stat[token[l].subfields].sum += field[index]; | ||
130 | if (token[l].stat[token[l].subfields].min > field[index]) | ||
131 | token[l].stat[token[l].subfields].min = field[index]; | ||
132 | } | ||
133 | index++; | ||
134 | } | ||
135 | token[l].subfields++; | ||
136 | STOP_LOOP | ||
137 | } | ||
138 | |||
139 | startTime = time(NULL) - startTime; | ||
140 | |||
141 | for (l = 0; l< n; l++){ | ||
142 | unsigned int ll; | ||
143 | fprintf(stdout, "%d subfields for token %d \n", token[l].subfields, l); | ||
144 | for ( ll =0; ll<token[l].subfields; ll++) | ||
145 | fprintf(stdout, "subfields %d:\tcount = %d\tmin= %x\tsum= %x\n", | ||
146 | ll, token[l].stat[ll].count, | ||
147 | token[l].stat[ll].min, token[l].stat[ll].sum); | ||
148 | } | ||
149 | fprintf(stdout, "total time = %d seconds.\n", (int)startTime); | ||
150 | free(field); | ||
151 | WRITE_TO_FILE | ||
152 | return(0); | ||
153 | } | ||
diff --git a/dis/original/Makefile b/dis/original/Makefile deleted file mode 100755 index 9f7286d..0000000 --- a/dis/original/Makefile +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | ||
2 | CC ?= gcc | ||
3 | override CFLAGS += -pthread -O2 -ggdb3 -I../../baseline/source | ||
4 | LDFLAGS = -lrt -lm | ||
5 | COMMON = ../../baseline/source/extra.h | ||
6 | |||
7 | # Handle cases where we're also profiling with the MMDC on the i.MX6Q | ||
8 | ifneq ($(shell grep "define MMDC 1" ../../baseline/source/extra.h),) | ||
9 | COMMON += /media/speedy/litmus/tools/mmdc/mmdc.c | ||
10 | endif | ||
11 | |||
12 | # Include all the LITMUS^RT headers if we're using it | ||
13 | ifneq ($(shell grep "define LITMUS 1" ../../baseline/source/extra.h),) | ||
14 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | ||
15 | LDFLAGS += -L${LIBLITMUS} -llitmus | ||
16 | endif | ||
17 | |||
18 | |||
19 | all: field matrix neighborhood pointer transitive update random_walk | ||
20 | |||
21 | .PHONY: clean | ||
22 | clean: | ||
23 | rm field matrix neighborhood pointer transitive update random_walk | ||
24 | |||
25 | field: ${COMMON} ./Field/field.c | ||
26 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
27 | matrix: ${COMMON} ./Matrix/ver2/matrix.c | ||
28 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
29 | neighborhood: ${COMMON} ./Neighborhood/neighborhood.c | ||
30 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
31 | pointer: ${COMMON} ./Pointer/pointer.c | ||
32 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
33 | transitive: ${COMMON} ./Transitive/transitive.c | ||
34 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
35 | update: ${COMMON} ./Update/update.c | ||
36 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
37 | random_walk: ${COMMON} random_walk.c | ||
38 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | ||
diff --git a/dis/original/Matrix/ver1/DISstressmarkRNG.h b/dis/original/Matrix/ver1/DISstressmarkRNG.h deleted file mode 100755 index 4aa2620..0000000 --- a/dis/original/Matrix/ver1/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Matrix/ver1/matrix.c b/dis/original/Matrix/ver1/matrix.c deleted file mode 100755 index 518a638..0000000 --- a/dis/original/Matrix/ver1/matrix.c +++ /dev/null | |||
@@ -1,600 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Matrix Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * The Sparse Matrix Storage is implemented by Compact Row Storage Scheme | ||
18 | * In the code, the data is first generated by randomNonzeroFloat() | ||
19 | * the data is first stored in a full-space matrix with size of dim*dim | ||
20 | * then the data is transfered to the Compact Row Matrix, | ||
21 | * the data value is kept in *value, | ||
22 | * the columns corresponding to the value are stored in *col_ind, | ||
23 | * the start element of each row is stored in *row_start. | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * Please note: | ||
28 | * the total number of data is numberNonzero +dim | ||
29 | * among which, NumberNonzero because this is symmetric matrix | ||
30 | * dim because the diagonal elements | ||
31 | */ | ||
32 | |||
33 | #include <stdio.h> | ||
34 | #include <math.h> | ||
35 | #include <stdlib.h> | ||
36 | #include <time.h> | ||
37 | #include <assert.h> | ||
38 | #include "DISstressmarkRNG.h" | ||
39 | |||
40 | #define MIN_SEED -2147483647 | ||
41 | #define MAX_SEED -1 | ||
42 | #define MIN_DIM 1 | ||
43 | #define MAX_DIM 32768 | ||
44 | #define MAX_ITERATIONS 65536 | ||
45 | #define MIN_TOLERANCE 0.000007 | ||
46 | #define MAX_TOLERANCE 0.5 | ||
47 | #define MIN_NUMBER -3.4e10/dim | ||
48 | #define MAX_NUMBER 3.4e10/dim | ||
49 | #define EPSI 1.0e-10 | ||
50 | #define MIN_DIG_NUMBER 1.0e-10 | ||
51 | #define MAX_DIG_NUMBER 3.4e10 | ||
52 | |||
53 | /* | ||
54 | * External variable, dimension | ||
55 | */ | ||
56 | |||
57 | static int dim; | ||
58 | |||
59 | /* | ||
60 | * matrix * vector | ||
61 | */ | ||
62 | |||
63 | double *matrixMulvector(double *value, | ||
64 | int *col_ind, | ||
65 | int *row_start, | ||
66 | double *vector) | ||
67 | { | ||
68 | int l, ll; | ||
69 | double *out; | ||
70 | double sum; | ||
71 | int tmp_rs, tmp_re; | ||
72 | |||
73 | out = (double *)malloc(dim*sizeof(double)); | ||
74 | |||
75 | for (l=0; l<dim; l++){ | ||
76 | *(out + l) = 0; | ||
77 | tmp_rs = row_start[l]; | ||
78 | |||
79 | if (tmp_rs != -1){ | ||
80 | tmp_re = row_start[l+1]; /* | ||
81 | *get the start and ending elements of | ||
82 | * each row | ||
83 | */ | ||
84 | for (ll=tmp_rs; ll<tmp_re; ll++){ | ||
85 | *(out + l) += value[ll]*vector[col_ind[ll]]; | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | return out; | ||
90 | } | ||
91 | |||
92 | |||
93 | /* | ||
94 | * vector1 - vector2 | ||
95 | */ | ||
96 | |||
97 | double *vectorSub(double *vector1, double *vector2){ | ||
98 | |||
99 | int l; | ||
100 | double *vector; | ||
101 | vector = (double *)malloc(dim*sizeof(double )); | ||
102 | for (l=0; l<dim; l++){ | ||
103 | *(vector + l) = *(vector1 + l) - *(vector2 + l); | ||
104 | } | ||
105 | return vector; | ||
106 | } | ||
107 | |||
108 | |||
109 | /* | ||
110 | * vector1 + vector2 | ||
111 | */ | ||
112 | |||
113 | double *vectorAdd(double *vector1, double *vector2){ | ||
114 | |||
115 | int l; | ||
116 | double *vector; | ||
117 | |||
118 | vector = (double *)malloc(dim*sizeof(double )); | ||
119 | |||
120 | for (l=0; l<dim; l++){ | ||
121 | *(vector + l) = *(vector1 + l) + *(vector2 + l); | ||
122 | } | ||
123 | return vector; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * vector1 * vector2 | ||
128 | */ | ||
129 | |||
130 | double vectorMul(double *vector1, double *vector2){ | ||
131 | |||
132 | int l; | ||
133 | double product; | ||
134 | |||
135 | product = 0; | ||
136 | |||
137 | for (l=0; l<dim; l++){ | ||
138 | product += (*(vector1 + l))*(*(vector2 + l)); | ||
139 | |||
140 | } | ||
141 | return product; | ||
142 | } | ||
143 | |||
144 | /* | ||
145 | * /vector/ | ||
146 | */ | ||
147 | |||
148 | double vectorValue(double *vector){ | ||
149 | |||
150 | double value; | ||
151 | int l; | ||
152 | |||
153 | value = 0; | ||
154 | |||
155 | for (l=0; l<dim; l++){ | ||
156 | value += (*(vector + l)) * (*(vector + l)); | ||
157 | } | ||
158 | |||
159 | return (sqrt(value)); | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * transpose(vector) | ||
164 | * In fact, we return the original vector here | ||
165 | */ | ||
166 | |||
167 | double *transpose(double *vector){ | ||
168 | |||
169 | double *vect; | ||
170 | int l; | ||
171 | |||
172 | vect = (double *)malloc(dim*sizeof(double )); | ||
173 | |||
174 | for (l=0; l<dim; l++){ | ||
175 | *(vect+l) = *(vector+l); | ||
176 | } | ||
177 | return vect; | ||
178 | } | ||
179 | |||
180 | /* | ||
181 | * value * <vector> | ||
182 | */ | ||
183 | double *valueMulvector(double value, double *vector){ | ||
184 | |||
185 | int l; | ||
186 | double *vect; | ||
187 | int lll; | ||
188 | double sum; | ||
189 | |||
190 | vect = (double *) malloc(dim * sizeof(double )); | ||
191 | |||
192 | for (l=0; l<dim; l++){ | ||
193 | *(vect + l) = (*(vector + l)) * value; | ||
194 | } | ||
195 | |||
196 | return vect; | ||
197 | } | ||
198 | |||
199 | /* | ||
200 | * generate the data distributed sparsely in matrix | ||
201 | */ | ||
202 | |||
203 | void initMatrix(double *matrix, int dim, int numberNonzero){ | ||
204 | |||
205 | int k, l, ll; | ||
206 | int i, j; | ||
207 | |||
208 | int lll; | ||
209 | double sum; | ||
210 | |||
211 | for (k=0; k< dim*dim; k++){ | ||
212 | *(matrix + k) = 0; | ||
213 | } | ||
214 | |||
215 | for (l=0; l<numberNonzero/2; l++){ | ||
216 | |||
217 | i = randomUInt(1, dim-1); | ||
218 | j = randomUInt(0, i-1); | ||
219 | |||
220 | while (*(matrix + i*dim + j) != 0){ | ||
221 | |||
222 | i++; | ||
223 | if (i == dim){ | ||
224 | j++; | ||
225 | if (j == dim-1){ | ||
226 | j = 0; | ||
227 | i = 1; | ||
228 | } | ||
229 | else{ | ||
230 | i = j+1; | ||
231 | } | ||
232 | } | ||
233 | } | ||
234 | |||
235 | if (*(matrix + i*dim + j) == 0){ | ||
236 | *(matrix + i*dim + j) = (double )randomNonZeroFloat(MIN_NUMBER, | ||
237 | MAX_NUMBER, | ||
238 | EPSI); | ||
239 | *(matrix + j*dim + i) = *(matrix + i*dim + j); | ||
240 | } | ||
241 | } | ||
242 | |||
243 | for (ll=0; ll<dim; ll++){ | ||
244 | |||
245 | |||
246 | |||
247 | *(matrix + ll*dim + ll) = (double )randomNonZeroFloat(-MAX_DIG_NUMBER, | ||
248 | MAX_DIG_NUMBER, | ||
249 | MIN_DIG_NUMBER); | ||
250 | |||
251 | sum = 0; | ||
252 | |||
253 | for (lll=0; lll<dim; lll++){ | ||
254 | if (lll != ll){ | ||
255 | sum += *(matrix + lll*dim + ll); | ||
256 | } | ||
257 | } | ||
258 | |||
259 | if (*(matrix + ll*dim + ll) < sum ){ | ||
260 | *(matrix + ll*dim + ll) += sum; | ||
261 | } | ||
262 | } | ||
263 | |||
264 | return; | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | * generate the data value in the vectors | ||
269 | */ | ||
270 | |||
271 | void initVector(double *vector, int dim){ | ||
272 | |||
273 | int l; | ||
274 | |||
275 | for (l=0; l<dim; l++){ | ||
276 | *(vector + l) = (double )randomFloat (MIN_NUMBER, MAX_NUMBER); | ||
277 | } | ||
278 | |||
279 | return; | ||
280 | } | ||
281 | |||
282 | /* | ||
283 | * make a vector contains value of zero | ||
284 | */ | ||
285 | |||
286 | void zeroVector(double *vector, int dim){ | ||
287 | int l; | ||
288 | |||
289 | for (l=0; l<dim; l++){ | ||
290 | *(vector + l) = 0; | ||
291 | } | ||
292 | return; | ||
293 | } | ||
294 | |||
295 | /* | ||
296 | * return a vector which is the copy of the vect | ||
297 | */ | ||
298 | |||
299 | double *equalVector(double *vect){ | ||
300 | |||
301 | int l; | ||
302 | double *vect1; | ||
303 | |||
304 | vect1 = (double *)malloc(dim*sizeof(double )); | ||
305 | |||
306 | for (l=0; l<dim; l++){ | ||
307 | *(vect1+l) = *(vect+l); | ||
308 | } | ||
309 | return vect1; | ||
310 | } | ||
311 | |||
312 | |||
313 | |||
314 | void biConjugateGradient(double *value, | ||
315 | int *col_ind, | ||
316 | int *row_start, | ||
317 | double *vectorB, | ||
318 | double *vectorX, | ||
319 | double errorTolerance, | ||
320 | int maxIterations, | ||
321 | double *actualError, | ||
322 | int *actualIteration, | ||
323 | int dim) | ||
324 | /* | ||
325 | * in the code, we use a lot of temparary vectors and variables | ||
326 | * this is just for simple and clear | ||
327 | * you can optimize these temporary variables and vectors | ||
328 | * based on your need | ||
329 | * | ||
330 | */ | ||
331 | { | ||
332 | double *vectorR; | ||
333 | double *vectorP, *matrixAvectorP, *nextVectorR; | ||
334 | double error; | ||
335 | int iteration; | ||
336 | double alpha, beta; | ||
337 | |||
338 | double *temp0, *temp1,*temp2, *temp3; | ||
339 | double *temp4, temp5, temp6, *temp7 ; | ||
340 | double *temp8, *temp9, temp10, *temp11; | ||
341 | double temp12, *temp13, *temp14; | ||
342 | double *temp15, *temp16, *temp17; | ||
343 | |||
344 | int l; | ||
345 | int ll; | ||
346 | |||
347 | alpha = 0; | ||
348 | beta = 0; | ||
349 | |||
350 | /* | ||
351 | * vectorR = vectorB - matrixA*vectorX | ||
352 | */ | ||
353 | temp0 = matrixMulvector(value,col_ind, row_start, vectorX); | ||
354 | vectorR = vectorSub(vectorB, temp0); | ||
355 | |||
356 | /* | ||
357 | * vectorP = vectorR | ||
358 | */ | ||
359 | vectorP = equalVector(vectorR); | ||
360 | |||
361 | /* | ||
362 | * error = |matrixA * vectorX - vectorB| / |vectorB| | ||
363 | */ | ||
364 | temp2 = vectorSub(temp0, vectorB); | ||
365 | error = vectorValue(temp2)/vectorValue(vectorB); | ||
366 | |||
367 | free(temp0); | ||
368 | free (temp2); | ||
369 | |||
370 | iteration = 0; | ||
371 | |||
372 | |||
373 | while ((iteration < maxIterations) && (error > errorTolerance)){ | ||
374 | |||
375 | /* | ||
376 | * alpha = (transpose(vectorR) * vectorR) / | ||
377 | * (transpose(vectorP) * (matrixA * vectorP) | ||
378 | */ | ||
379 | temp1 = matrixMulvector(value, col_ind, row_start, vectorP); | ||
380 | temp3 = transpose(vectorR); | ||
381 | temp4 = transpose(vectorP); | ||
382 | temp5 = vectorMul(temp4, temp1); | ||
383 | temp6 = vectorMul(temp3, vectorR); | ||
384 | alpha = temp6/temp5; | ||
385 | |||
386 | /* | ||
387 | * nextVectorR = vectorR - alpha*(matrixA * vectorP) | ||
388 | */ | ||
389 | |||
390 | temp7 = valueMulvector(alpha, temp1); | ||
391 | temp8 = vectorSub(vectorR, temp7); | ||
392 | nextVectorR = equalVector(temp8); | ||
393 | |||
394 | /* | ||
395 | * beta = (transpose(nextVectorR) * nextVectorR) / | ||
396 | * (transpose(vectorR) * vectorR) | ||
397 | */ | ||
398 | temp9 = transpose(nextVectorR); | ||
399 | temp10 = vectorMul(temp9, nextVectorR); | ||
400 | temp11 = transpose(vectorR); | ||
401 | temp12 = vectorMul(temp11, vectorR); | ||
402 | beta = temp10/temp12; | ||
403 | |||
404 | /* | ||
405 | * vectorX = vectorX + alpha * vectorP | ||
406 | */ | ||
407 | temp13 = valueMulvector(alpha, vectorP); | ||
408 | vectorX = vectorAdd(vectorX,temp13); | ||
409 | |||
410 | /* | ||
411 | *vectorP = nextVectorR + beta*vectorP | ||
412 | */ | ||
413 | temp14 = valueMulvector(beta, vectorP); | ||
414 | temp17 = vectorAdd(nextVectorR, temp14); | ||
415 | |||
416 | for (ll=0; ll<dim; ll++){ | ||
417 | *(vectorP + ll) = *(temp17 + ll); | ||
418 | } | ||
419 | |||
420 | /* | ||
421 | * vectorR = nextVectorR | ||
422 | */ | ||
423 | |||
424 | for (l=0; l<dim; l++){ | ||
425 | *(vectorR+l) = *(nextVectorR+l); | ||
426 | } | ||
427 | |||
428 | /* | ||
429 | * error = |matrixA * vectorX - vectorB| / |vectorB| | ||
430 | */ | ||
431 | temp15 = matrixMulvector(value, col_ind,row_start, vectorX); | ||
432 | temp16 = vectorSub(temp15,vectorB); | ||
433 | error = vectorValue(temp16)/vectorValue(vectorB); | ||
434 | |||
435 | free(temp1); | ||
436 | free(temp3); | ||
437 | free(temp4); | ||
438 | free(temp7); | ||
439 | free(temp8); | ||
440 | free(temp9); | ||
441 | free(temp11); | ||
442 | free(nextVectorR); | ||
443 | free(temp13); | ||
444 | free(temp14); | ||
445 | free(temp15); | ||
446 | free(temp16); | ||
447 | free(temp17); | ||
448 | |||
449 | iteration++; | ||
450 | } | ||
451 | |||
452 | *actualError = error; | ||
453 | *actualIteration = iteration; | ||
454 | |||
455 | free(vectorR); | ||
456 | free(vectorP); | ||
457 | |||
458 | return; | ||
459 | } | ||
460 | |||
461 | /* | ||
462 | * This is the function to transfer the data from the matrix of dense storage | ||
463 | * to Compact Row Storage | ||
464 | */ | ||
465 | void create_CRS(double *matrixA, | ||
466 | double *value, | ||
467 | int *col_ind, | ||
468 | int *row_start, | ||
469 | int dim, | ||
470 | int numberNonzero) | ||
471 | { | ||
472 | |||
473 | int i, j, k; | ||
474 | int cnt; | ||
475 | double tmp; | ||
476 | |||
477 | /* | ||
478 | *initialize the row_start | ||
479 | */ | ||
480 | |||
481 | for(k=0; k<dim; k++){ | ||
482 | row_start[k] = -1; | ||
483 | } | ||
484 | |||
485 | /* | ||
486 | * make the end of the last row to be numberNonzero + dim. | ||
487 | */ | ||
488 | |||
489 | row_start[dim] = numberNonzero+dim; | ||
490 | |||
491 | /* | ||
492 | * initialize the col_ind | ||
493 | */ | ||
494 | |||
495 | for (k=0; k<numberNonzero+dim; k++){ | ||
496 | col_ind[k] = -1; | ||
497 | } | ||
498 | |||
499 | |||
500 | cnt = 0; | ||
501 | |||
502 | for (i=0; (cnt<numberNonzero+dim)&&(i<dim); i++){ | ||
503 | for (j=0; (cnt<numberNonzero+dim)&&(j<dim); j++){ | ||
504 | |||
505 | tmp = *(matrixA + i*dim + j); | ||
506 | |||
507 | if (tmp!=0){ | ||
508 | |||
509 | value[cnt] = tmp; | ||
510 | col_ind[cnt] = j; | ||
511 | |||
512 | if (row_start[i] == -1) | ||
513 | row_start[i] = cnt; | ||
514 | |||
515 | cnt += 1; | ||
516 | } | ||
517 | } | ||
518 | } | ||
519 | row_start[i] = cnt; | ||
520 | |||
521 | return; | ||
522 | } | ||
523 | |||
524 | |||
525 | |||
526 | int main() | ||
527 | { | ||
528 | int seed; | ||
529 | int numberNonzero; | ||
530 | int maxIterations; | ||
531 | float errorTolerance; | ||
532 | double actualError; | ||
533 | int actualIteration; | ||
534 | |||
535 | time_t beginTime; | ||
536 | time_t endTime; | ||
537 | |||
538 | double *matrixA; | ||
539 | double *vectorB; | ||
540 | double *vectorX; | ||
541 | |||
542 | double *value; | ||
543 | int *col_ind; | ||
544 | int *row_start; | ||
545 | int sum; | ||
546 | int k; | ||
547 | |||
548 | fscanf(stdin, "%d %d %d %d %f", | ||
549 | &seed, &dim, &numberNonzero,&maxIterations,&errorTolerance); | ||
550 | assert((seed > MIN_SEED) && (seed < MAX_SEED)); | ||
551 | assert((dim > MIN_DIM) && (dim < MAX_DIM)); | ||
552 | assert((numberNonzero > dim) && (numberNonzero < dim*dim)); | ||
553 | assert((maxIterations > 0) && (maxIterations < MAX_ITERATIONS)); | ||
554 | assert((errorTolerance > MIN_TOLERANCE) && (errorTolerance < MAX_TOLERANCE)); | ||
555 | |||
556 | matrixA = (double *)malloc(dim*dim*sizeof(double )); | ||
557 | vectorB = (double *)malloc(dim*sizeof(double)); | ||
558 | vectorX = (double *)malloc(dim*sizeof(double)); | ||
559 | |||
560 | value = (double *)malloc((numberNonzero+dim)*sizeof(double)); | ||
561 | col_ind = (int *)malloc((numberNonzero+dim)*sizeof(int)); | ||
562 | row_start = (int *)malloc((dim+1)*sizeof(int)); | ||
563 | |||
564 | randInit(seed); | ||
565 | |||
566 | initMatrix(matrixA, dim, numberNonzero); | ||
567 | |||
568 | create_CRS(matrixA, value, col_ind, row_start, dim, numberNonzero); | ||
569 | |||
570 | initVector(vectorB, dim); | ||
571 | zeroVector(vectorX, dim); | ||
572 | printf(" after init\n"); | ||
573 | |||
574 | beginTime = time(NULL); | ||
575 | |||
576 | actualError = 0; | ||
577 | actualIteration = 0; | ||
578 | |||
579 | biConjugateGradient(value, col_ind, row_start, vectorB, vectorX, errorTolerance, | ||
580 | maxIterations, | ||
581 | &actualError, &actualIteration, dim); | ||
582 | |||
583 | |||
584 | |||
585 | endTime = time(NULL) - beginTime; | ||
586 | |||
587 | |||
588 | |||
589 | sum = 0; | ||
590 | for (k=1; k<dim; k++){ | ||
591 | sum += sum + *(vectorX + k); | ||
592 | } | ||
593 | |||
594 | fprintf(stdout, "sum = %d, actualError = %e, actualIteration = %d\n", sum, actualError, actualIteration); | ||
595 | fprintf(stdout, "total time = %u sec. \n", (unsigned int)endTime); | ||
596 | |||
597 | return(0); | ||
598 | } | ||
599 | |||
600 | |||
diff --git a/dis/original/Matrix/ver2/DISstressmarkRNG.h b/dis/original/Matrix/ver2/DISstressmarkRNG.h deleted file mode 100755 index 4aa2620..0000000 --- a/dis/original/Matrix/ver2/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Matrix/ver2/matrix.c b/dis/original/Matrix/ver2/matrix.c deleted file mode 100755 index 957d7c5..0000000 --- a/dis/original/Matrix/ver2/matrix.c +++ /dev/null | |||
@@ -1,594 +0,0 @@ | |||
1 | /* Please note: | ||
2 | * This code is the optimized version of the first version of Matrix | ||
3 | * Stressmark. It uses less temporary vectors and vsariables, thus reduce | ||
4 | * memory allocation/deallocation overhead. the simulation is faster | ||
5 | */ | ||
6 | /* | ||
7 | * Sample code for the DIS Matrix Stressmark | ||
8 | * | ||
9 | * This source code is the completely correct source code based on | ||
10 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
11 | * Systems Corporation, 2000. | ||
12 | * | ||
13 | * If you just compile and generate the executables from this source | ||
14 | * code, this code would be enough. However, if you wish to get a complete | ||
15 | * understanding of this stressmark, it is strongly suggested that you | ||
16 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
17 | * before going on since the detailed comments are given in this documents. | ||
18 | * the comments are not repeated here. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * The Sparse Matrix Storage is implemented by Compact Row Storage Scheme | ||
23 | * In the code, the data is first generated by randomNonzeroFloat() | ||
24 | * the data is first stored in a full-space matrix with size of dim*dim | ||
25 | * then the data is transfered to the Compact Row Matrix, | ||
26 | * the data value is kept in *value, | ||
27 | * the columns corresponding to the value are stored in *col_ind, | ||
28 | * the start element of each row is stored in *row_start. | ||
29 | */ | ||
30 | |||
31 | /* | ||
32 | * Please note: | ||
33 | * the total number of data is numberNonzero +dim | ||
34 | * among which, NumberNonzero because this is symmetric matrix | ||
35 | * dim because the diagonal elements | ||
36 | */ | ||
37 | |||
38 | #include <stdio.h> | ||
39 | #include <math.h> | ||
40 | #include <stdlib.h> | ||
41 | #include <time.h> | ||
42 | #include <assert.h> | ||
43 | #include "DISstressmarkRNG.h" | ||
44 | #include "extra.h" | ||
45 | |||
46 | #define MIN_SEED -2147483647 | ||
47 | #define MAX_SEED -1 | ||
48 | #define MIN_DIM 1 | ||
49 | #define MAX_DIM 32768 | ||
50 | #define MAX_ITERATIONS 65536 | ||
51 | #define MIN_TOLERANCE 0.000007 | ||
52 | #define MAX_TOLERANCE 0.5 | ||
53 | #define MIN_NUMBER -3.4e10/dim | ||
54 | #define MAX_NUMBER 3.4e10/dim | ||
55 | #define EPSI 1.0e-10 | ||
56 | #define MIN_DIG_NUMBER 1.0e-10 | ||
57 | #define MAX_DIG_NUMBER 3.4e10 | ||
58 | |||
59 | /* | ||
60 | * External variable, dimension | ||
61 | */ | ||
62 | |||
63 | static int dim; | ||
64 | int argc; | ||
65 | char** argv; | ||
66 | |||
67 | /* | ||
68 | * matrix * vector | ||
69 | */ | ||
70 | |||
71 | void matrixMulvector(double *value, | ||
72 | int *col_ind, | ||
73 | int *row_start, | ||
74 | double *vector, | ||
75 | double *out) | ||
76 | { | ||
77 | int l, ll; | ||
78 | double sum; | ||
79 | int tmp_rs, tmp_re; | ||
80 | |||
81 | for (l=0; l<dim; l++){ | ||
82 | *(out + l) = 0; | ||
83 | tmp_rs = row_start[l]; | ||
84 | |||
85 | if (tmp_rs != -1){ | ||
86 | tmp_re = row_start[l+1]; /* | ||
87 | *get the start and ending elements of | ||
88 | * each row | ||
89 | */ | ||
90 | for (ll=tmp_rs; ll<tmp_re; ll++){ | ||
91 | *(out + l) += value[ll]*vector[col_ind[ll]]; | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | return; | ||
96 | } | ||
97 | |||
98 | |||
99 | /* | ||
100 | * vector1 - vector2 | ||
101 | */ | ||
102 | |||
103 | void vectorSub(double *vector1, double *vector2, double *vector){ | ||
104 | |||
105 | int l; | ||
106 | |||
107 | for (l=0; l<dim; l++){ | ||
108 | *(vector + l) = *(vector1 + l) - *(vector2 + l); | ||
109 | } | ||
110 | return; | ||
111 | } | ||
112 | |||
113 | |||
114 | /* | ||
115 | * vector1 + vector2 | ||
116 | */ | ||
117 | |||
118 | void vectorAdd(double *vector1, double *vector2, double *vector){ | ||
119 | |||
120 | int l; | ||
121 | |||
122 | for (l=0; l<dim; l++){ | ||
123 | *(vector + l) = *(vector1 + l) + *(vector2 + l); | ||
124 | } | ||
125 | return; | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * vector1 * vector2 | ||
130 | */ | ||
131 | |||
132 | double vectorMul(double *vector1, double *vector2){ | ||
133 | |||
134 | int l; | ||
135 | double product; | ||
136 | |||
137 | product = 0; | ||
138 | |||
139 | for (l=0; l<dim; l++){ | ||
140 | product += (*(vector1 + l))*(*(vector2 + l)); | ||
141 | |||
142 | } | ||
143 | return product; | ||
144 | } | ||
145 | |||
146 | /* | ||
147 | * /vector/ | ||
148 | */ | ||
149 | |||
150 | double vectorValue(double *vector){ | ||
151 | |||
152 | double value; | ||
153 | int l; | ||
154 | |||
155 | value = 0; | ||
156 | |||
157 | for (l=0; l<dim; l++){ | ||
158 | value += (*(vector + l)) * (*(vector + l)); | ||
159 | } | ||
160 | |||
161 | return (sqrt(value)); | ||
162 | } | ||
163 | |||
164 | /* | ||
165 | * transpose(vector) | ||
166 | * In fact, we return the original vector here | ||
167 | */ | ||
168 | |||
169 | void transpose(double *vector, double *vect){ | ||
170 | |||
171 | int l; | ||
172 | |||
173 | for (l=0; l<dim; l++){ | ||
174 | *(vect+l) = *(vector+l); | ||
175 | } | ||
176 | return; | ||
177 | } | ||
178 | |||
179 | /* | ||
180 | * value * <vector> | ||
181 | */ | ||
182 | void valueMulvector(double value, double *vector, double *vect){ | ||
183 | |||
184 | int l; | ||
185 | int lll, i; | ||
186 | double tmp; | ||
187 | |||
188 | for (l=0; l<dim; l++){ | ||
189 | *(vect + l) = *(vector + l) * value; | ||
190 | } | ||
191 | return; | ||
192 | } | ||
193 | |||
194 | /* | ||
195 | * generate the data distributed sparsely in matrix | ||
196 | */ | ||
197 | |||
198 | void initMatrix(double *matrix, int dim, int numberNonzero){ | ||
199 | |||
200 | int k, l, ll; | ||
201 | int i, j; | ||
202 | |||
203 | int lll; | ||
204 | double sum; | ||
205 | |||
206 | for (k=0; k< dim*dim; k++){ | ||
207 | *(matrix + k) = 0; | ||
208 | } | ||
209 | |||
210 | for (l=0; l<numberNonzero/2; l++){ | ||
211 | |||
212 | i = randomUInt(1, dim-1); | ||
213 | j = randomUInt(0, i-1); | ||
214 | |||
215 | while (*(matrix + i*dim + j) != 0){ | ||
216 | |||
217 | i++; | ||
218 | if (i == dim){ | ||
219 | j++; | ||
220 | if (j == dim-1){ | ||
221 | j = 0; | ||
222 | i = 1; | ||
223 | } | ||
224 | else{ | ||
225 | i = j+1; | ||
226 | } | ||
227 | } | ||
228 | } | ||
229 | |||
230 | if (*(matrix + i*dim + j) == 0){ | ||
231 | *(matrix + i*dim + j) = (double )randomNonZeroFloat(MIN_NUMBER, | ||
232 | MAX_NUMBER, | ||
233 | EPSI); | ||
234 | *(matrix + j*dim + i) = *(matrix + i*dim + j); | ||
235 | } | ||
236 | } | ||
237 | |||
238 | for (ll=0; ll<dim; ll++){ | ||
239 | |||
240 | |||
241 | |||
242 | *(matrix + ll*dim + ll) = (double )randomNonZeroFloat(-MAX_DIG_NUMBER, | ||
243 | MAX_DIG_NUMBER, | ||
244 | MIN_DIG_NUMBER); | ||
245 | |||
246 | sum = 0; | ||
247 | |||
248 | for (lll=0; lll<dim; lll++){ | ||
249 | if (lll != ll){ | ||
250 | sum += *(matrix + lll*dim + ll); | ||
251 | } | ||
252 | } | ||
253 | |||
254 | if (*(matrix + ll*dim + ll) < sum ){ | ||
255 | *(matrix + ll*dim + ll) += sum; | ||
256 | } | ||
257 | } | ||
258 | |||
259 | return; | ||
260 | } | ||
261 | |||
262 | /* | ||
263 | * generate the data value in the vectors | ||
264 | */ | ||
265 | |||
266 | void initVector(double *vector, int dim){ | ||
267 | |||
268 | int l; | ||
269 | |||
270 | for (l=0; l<dim; l++){ | ||
271 | *(vector + l) = (double )randomFloat (MIN_NUMBER, MAX_NUMBER); | ||
272 | } | ||
273 | |||
274 | return; | ||
275 | } | ||
276 | |||
277 | /* | ||
278 | * make a vector contains value of zero | ||
279 | */ | ||
280 | |||
281 | void zeroVector(double *vector, int dim){ | ||
282 | int l; | ||
283 | |||
284 | for (l=0; l<dim; l++){ | ||
285 | *(vector + l) = 0; | ||
286 | } | ||
287 | return; | ||
288 | } | ||
289 | |||
290 | /* | ||
291 | * return a vector which is the copy of the vect | ||
292 | */ | ||
293 | |||
294 | void equalVector(double *vect, double *vect1){ | ||
295 | |||
296 | int l; | ||
297 | |||
298 | for (l=0; l<dim; l++){ | ||
299 | *(vect1+l) = *(vect+l); | ||
300 | } | ||
301 | return; | ||
302 | } | ||
303 | |||
304 | |||
305 | |||
306 | void biConjugateGradient(double *value, | ||
307 | int *col_ind, | ||
308 | int *row_start, | ||
309 | double *vectorB, | ||
310 | double *vectorX, | ||
311 | double errorTolerance, | ||
312 | int maxIterations, | ||
313 | double *actualError, | ||
314 | int *actualIteration, | ||
315 | int dim) | ||
316 | /* | ||
317 | * in the code, we use a lot of temparary vectors and variables | ||
318 | * this is just for simple and clear | ||
319 | * you can optimize these temporary variables and vectors | ||
320 | * based on your need | ||
321 | * | ||
322 | */ | ||
323 | { | ||
324 | double *vectorR; | ||
325 | double *vectorP, *matrixAvectorP, *nextVectorR; | ||
326 | double error; | ||
327 | int iteration; | ||
328 | double alpha, beta; | ||
329 | |||
330 | double *tmpVector1, *tmpVector2, *tmpVector3; | ||
331 | double tmpValue1, tmpValue2; | ||
332 | int i; | ||
333 | int l; | ||
334 | int ll; | ||
335 | SET_UP | ||
336 | |||
337 | alpha = 0; | ||
338 | beta = 0; | ||
339 | |||
340 | vectorP = (double *)malloc(dim*sizeof(double)); | ||
341 | vectorR = (double *)malloc(dim*sizeof(double)); | ||
342 | nextVectorR = (double *)malloc(dim*sizeof(double)); | ||
343 | vectorX = (double *)malloc(dim*sizeof(double)); | ||
344 | |||
345 | tmpVector1 = (double *)malloc(dim*sizeof(double)); | ||
346 | tmpVector2 = (double *)malloc(dim*sizeof(double)); | ||
347 | tmpVector3 = (double *)malloc(dim*sizeof(double)); | ||
348 | |||
349 | /* | ||
350 | * vectorR = vectorB - matrixA*vectorX | ||
351 | */ | ||
352 | matrixMulvector(value,col_ind, row_start, vectorX, tmpVector1); | ||
353 | |||
354 | vectorSub(vectorB, tmpVector1, vectorR); | ||
355 | |||
356 | /* | ||
357 | * vectorP = vectorR | ||
358 | */ | ||
359 | |||
360 | equalVector(vectorR, vectorP); | ||
361 | |||
362 | /* | ||
363 | * error = |matrixA * vectorX - vectorB| / |vectorB| | ||
364 | */ | ||
365 | vectorSub(tmpVector1, vectorB, tmpVector1); | ||
366 | |||
367 | error = vectorValue(tmpVector1)/vectorValue(vectorB); | ||
368 | |||
369 | iteration = 0; | ||
370 | |||
371 | while ((iteration < maxIterations) && (error > errorTolerance)){ | ||
372 | START_LOOP | ||
373 | |||
374 | /* | ||
375 | * alpha = (transpose(vectorR) * vectorR) / | ||
376 | * (transpose(vectorP) * (matrixA * vectorP) | ||
377 | */ | ||
378 | |||
379 | matrixMulvector(value, col_ind, row_start, vectorP, tmpVector1); | ||
380 | transpose(vectorR, tmpVector2); | ||
381 | transpose(vectorP, tmpVector3); | ||
382 | tmpValue1 = vectorMul(tmpVector3, tmpVector1); | ||
383 | tmpValue2 = vectorMul(tmpVector2, vectorR); | ||
384 | alpha = tmpValue2/tmpValue1; | ||
385 | |||
386 | /* | ||
387 | * nextVectorR = vectorR - alpha*(matrixA * vectorP) | ||
388 | */ | ||
389 | |||
390 | valueMulvector(alpha, tmpVector1, tmpVector2); | ||
391 | vectorSub(vectorR, tmpVector2, tmpVector1); | ||
392 | equalVector(tmpVector1, nextVectorR); | ||
393 | |||
394 | /* | ||
395 | * beta = (transpose(nextVectorR) * nextVectorR) / | ||
396 | * (transpose(vectorR) * vectorR) | ||
397 | */ | ||
398 | |||
399 | transpose(nextVectorR, tmpVector3); | ||
400 | tmpValue1 = vectorMul(tmpVector3, nextVectorR); | ||
401 | transpose(vectorR, tmpVector2); | ||
402 | tmpValue2 = vectorMul(tmpVector2, vectorR); | ||
403 | beta = tmpValue1/tmpValue2; | ||
404 | |||
405 | /* | ||
406 | * vectorX = vectorX + alpha * vectorP | ||
407 | */ | ||
408 | valueMulvector(alpha, vectorP, tmpVector1); | ||
409 | vectorAdd(vectorX,tmpVector1, vectorX); | ||
410 | |||
411 | /* | ||
412 | *vectorP = nextVectorR + beta*vectorP | ||
413 | */ | ||
414 | valueMulvector(beta, vectorP, tmpVector1); | ||
415 | vectorAdd(nextVectorR, tmpVector1, tmpVector1); | ||
416 | |||
417 | for (ll=0; ll<dim; ll++){ | ||
418 | *(vectorP + ll) = *(tmpVector1 + ll); | ||
419 | } | ||
420 | |||
421 | /* | ||
422 | * vectorR = nextVectorR | ||
423 | */ | ||
424 | |||
425 | for (l=0; l<dim; l++){ | ||
426 | *(vectorR+l) = *(nextVectorR+l); | ||
427 | } | ||
428 | |||
429 | /* | ||
430 | * error = |matrixA * vectorX - vectorB| / |vectorB| | ||
431 | */ | ||
432 | matrixMulvector(value, col_ind,row_start, vectorX, tmpVector1); | ||
433 | vectorSub(tmpVector1,vectorB,tmpVector1); | ||
434 | error = vectorValue(tmpVector1)/vectorValue(vectorB); | ||
435 | |||
436 | iteration++; | ||
437 | STOP_LOOP | ||
438 | } | ||
439 | |||
440 | *actualError = error; | ||
441 | *actualIteration = iteration; | ||
442 | |||
443 | free(tmpVector1); | ||
444 | free(tmpVector2); | ||
445 | free(tmpVector3); | ||
446 | |||
447 | free(vectorR); | ||
448 | free(vectorP); | ||
449 | WRITE_TO_FILE | ||
450 | |||
451 | return; | ||
452 | } | ||
453 | |||
454 | /* | ||
455 | * This is the function to transfer the data from the matrix of dense storage | ||
456 | * to Compact Row Storage | ||
457 | */ | ||
458 | void create_CRS(double *matrixA, | ||
459 | double *value, | ||
460 | int *col_ind, | ||
461 | int *row_start, | ||
462 | int dim, | ||
463 | int numberNonzero) | ||
464 | { | ||
465 | |||
466 | int i, j, k; | ||
467 | int cnt; | ||
468 | double tmp; | ||
469 | |||
470 | /* | ||
471 | *initialize the row_start | ||
472 | */ | ||
473 | |||
474 | for(k=0; k<dim; k++){ | ||
475 | row_start[k] = -1; | ||
476 | } | ||
477 | |||
478 | /* | ||
479 | * make the end of the last row to be numberNonzero + dim. | ||
480 | */ | ||
481 | |||
482 | row_start[dim] = numberNonzero+dim; | ||
483 | |||
484 | /* | ||
485 | * initialize the col_ind | ||
486 | */ | ||
487 | |||
488 | for (k=0; k<numberNonzero+dim; k++){ | ||
489 | col_ind[k] = -1; | ||
490 | } | ||
491 | |||
492 | |||
493 | cnt = 0; | ||
494 | |||
495 | for (i=0; (cnt<numberNonzero+dim)&&(i<dim); i++){ | ||
496 | for (j=0; (cnt<numberNonzero+dim)&&(j<dim); j++){ | ||
497 | |||
498 | tmp = *(matrixA + i*dim + j); | ||
499 | |||
500 | if (tmp!=0){ | ||
501 | |||
502 | value[cnt] = tmp; | ||
503 | col_ind[cnt] = j; | ||
504 | |||
505 | if (row_start[i] == -1) | ||
506 | row_start[i] = cnt; | ||
507 | |||
508 | cnt += 1; | ||
509 | } | ||
510 | } | ||
511 | } | ||
512 | row_start[i] = cnt; | ||
513 | |||
514 | return; | ||
515 | } | ||
516 | |||
517 | |||
518 | int main(int _argc, char** _argv) | ||
519 | { | ||
520 | argc = _argc; | ||
521 | argv = _argv; | ||
522 | int seed; | ||
523 | int numberNonzero; | ||
524 | int maxIterations; | ||
525 | float errorTolerance; | ||
526 | double actualError; | ||
527 | int actualIteration; | ||
528 | |||
529 | time_t beginTime; | ||
530 | time_t endTime; | ||
531 | |||
532 | double *matrixA; | ||
533 | double *vectorB; | ||
534 | double *vectorX; | ||
535 | |||
536 | double *value; | ||
537 | int *col_ind; | ||
538 | int *row_start; | ||
539 | int sum; | ||
540 | int k; | ||
541 | |||
542 | fscanf(stdin, "%d %d %d %d %f", | ||
543 | &seed, &dim, &numberNonzero,&maxIterations,&errorTolerance); | ||
544 | assert((seed > MIN_SEED) && (seed < MAX_SEED)); | ||
545 | assert((dim > MIN_DIM) && (dim < MAX_DIM)); | ||
546 | assert((numberNonzero > dim) && (numberNonzero < dim*dim)); | ||
547 | assert((maxIterations > 0) && (maxIterations < MAX_ITERATIONS)); | ||
548 | assert((errorTolerance > MIN_TOLERANCE) && (errorTolerance < MAX_TOLERANCE)); | ||
549 | |||
550 | matrixA = (double *)malloc(dim*dim*sizeof(double )); | ||
551 | vectorB = (double *)malloc(dim*sizeof(double)); | ||
552 | vectorX = (double *)malloc(dim*sizeof(double)); | ||
553 | |||
554 | value = (double *)malloc((numberNonzero+dim)*sizeof(double)); | ||
555 | col_ind = (int *)malloc((numberNonzero+dim)*sizeof(int)); | ||
556 | row_start = (int *)malloc((dim+1)*sizeof(int)); | ||
557 | |||
558 | randInit(seed); | ||
559 | |||
560 | initMatrix(matrixA, dim, numberNonzero); | ||
561 | |||
562 | create_CRS(matrixA, value, col_ind, row_start, dim, numberNonzero); | ||
563 | |||
564 | initVector(vectorB, dim); | ||
565 | zeroVector(vectorX, dim); | ||
566 | printf(" after init\n"); | ||
567 | |||
568 | beginTime = time(NULL); | ||
569 | |||
570 | actualError = 0; | ||
571 | actualIteration = 0; | ||
572 | |||
573 | biConjugateGradient(value, col_ind, row_start, vectorB, vectorX, errorTolerance, | ||
574 | maxIterations, | ||
575 | &actualError, &actualIteration, dim); | ||
576 | |||
577 | |||
578 | |||
579 | endTime = time(NULL) - beginTime; | ||
580 | |||
581 | |||
582 | |||
583 | sum = 0; | ||
584 | for (k=1; k<dim; k++){ | ||
585 | sum += sum + *(vectorX + k); | ||
586 | } | ||
587 | |||
588 | fprintf(stdout, "sum = %d, actualError = %e, actualIteration = %d\n", sum, actualError, actualIteration); | ||
589 | fprintf(stdout, "total time = %u sec. \n", (unsigned int)endTime); | ||
590 | |||
591 | return(0); | ||
592 | } | ||
593 | |||
594 | |||
diff --git a/dis/original/Neighborhood/DISstressmarkRNG.h b/dis/original/Neighborhood/DISstressmarkRNG.h deleted file mode 100644 index 4aa2620..0000000 --- a/dis/original/Neighborhood/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Neighborhood/neighborhood.c b/dis/original/Neighborhood/neighborhood.c deleted file mode 100644 index 1736d38..0000000 --- a/dis/original/Neighborhood/neighborhood.c +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Neighborhood Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | |||
16 | #include <stdio.h> | ||
17 | #include <stdlib.h> | ||
18 | #include <time.h> | ||
19 | #include<assert.h> | ||
20 | #include "DISstressmarkRNG.h" | ||
21 | #include "utili.h" | ||
22 | #include "extra.h" | ||
23 | |||
24 | /* | ||
25 | * main() | ||
26 | */ | ||
27 | int main(int argc, char** argv) | ||
28 | { | ||
29 | long int seed; | ||
30 | int dimension; | ||
31 | int numberLines; | ||
32 | int minThickness; | ||
33 | int maxThickness; | ||
34 | int distanceShort; | ||
35 | int distanceLong; | ||
36 | int bitDepth; | ||
37 | int maxPixel; | ||
38 | Pixel *image; | ||
39 | Neighborhood values; | ||
40 | |||
41 | time_t beginTime; | ||
42 | time_t endTime; | ||
43 | SET_UP | ||
44 | |||
45 | assert(fscanf(stdin, "%ld %d %d %d %d %d %d %d", | ||
46 | &seed, &bitDepth, &dimension, &numberLines, | ||
47 | &minThickness, &maxThickness, | ||
48 | &distanceShort, &distanceLong) == 8); | ||
49 | |||
50 | assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); | ||
51 | assert((dimension > 0) && (dimension <= MAX_DIMENSION)); | ||
52 | assert((numberLines > 0) && (numberLines <= MAX_NUMBER_LINES)); | ||
53 | assert((minThickness > 0) && (minThickness < dimension)); | ||
54 | assert((maxThickness >= minThickness) && (maxThickness < dimension)); | ||
55 | assert((distanceShort > 0) && (distanceShort < dimension)); | ||
56 | assert((distanceLong > 0) && (distanceLong < dimension)); | ||
57 | assert((bitDepth >= MIN_BIT_DEPTH) && (bitDepth <= MAX_BIT_DEPTH)); | ||
58 | |||
59 | randInit(seed); | ||
60 | maxPixel = (1 << bitDepth) - 1; | ||
61 | image = createImage(dimension, maxPixel, numberLines, | ||
62 | minThickness, maxThickness); | ||
63 | assert (image != NULL); | ||
64 | |||
65 | beginTime = time(NULL); | ||
66 | START_LOOP | ||
67 | neighborhoodCalculation(image, dimension, | ||
68 | distanceShort, distanceLong, &values, maxPixel); | ||
69 | STOP_LOOP | ||
70 | endTime = time(NULL); | ||
71 | WRITE_TO_FILE | ||
72 | |||
73 | // printf(" end time is %d\n", endTime); | ||
74 | |||
75 | fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", | ||
76 | values.distShort.deg0.entropy, | ||
77 | values.distShort.deg0.energy, | ||
78 | values.distShort.deg45.entropy, | ||
79 | values.distShort.deg45.energy, | ||
80 | values.distShort.deg90.entropy, | ||
81 | values.distShort.deg90.energy, | ||
82 | values.distShort.deg135.entropy, | ||
83 | values.distShort.deg135.energy); | ||
84 | |||
85 | fprintf(stdout,"%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", | ||
86 | values.distLong.deg0.entropy, | ||
87 | values.distLong.deg0.energy,values.distShort.deg45.entropy, | ||
88 | values.distLong.deg45.energy, | ||
89 | values.distLong.deg90.entropy, | ||
90 | values.distLong.deg90.energy, | ||
91 | values.distLong.deg135.entropy, | ||
92 | values.distLong.deg135.energy); | ||
93 | |||
94 | fprintf(stderr, "time for neghborhood stressmark = %f\n", | ||
95 | difftime(endTime, beginTime)); | ||
96 | |||
97 | free((Pixel *)image); | ||
98 | return (SUCCESS); | ||
99 | } | ||
100 | |||
101 | |||
102 | |||
103 | |||
diff --git a/dis/original/Neighborhood/utili.h b/dis/original/Neighborhood/utili.h deleted file mode 100644 index 2a8e2a0..0000000 --- a/dis/original/Neighborhood/utili.h +++ /dev/null | |||
@@ -1,363 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Pointer Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | |||
16 | #include <math.h> | ||
17 | |||
18 | #define TRUE 1 | ||
19 | #define FALSE !TRUE | ||
20 | #define SUCCESS TRUE | ||
21 | #define ERROR FLASE | ||
22 | |||
23 | #define MIN_PIXEL 0 | ||
24 | #define MAX_DIMENSION 32768 | ||
25 | #define MIN_SEED -2147483647 | ||
26 | #define MAX_SEED -1 | ||
27 | #define MAX_NUMBER_LINES 65536 | ||
28 | #define MIN_BIT_DEPTH 7 | ||
29 | #define MAX_BIT_DEPTH 15 | ||
30 | |||
31 | typedef struct { | ||
32 | int column; | ||
33 | int row; | ||
34 | }Coord; | ||
35 | |||
36 | /* | ||
37 | * Neighborhood structure consists of the GLCM descriptors entropy and | ||
38 | * energy for each of 2 distance and 4 angels | ||
39 | */ | ||
40 | typedef struct { | ||
41 | float entropy; | ||
42 | float energy; | ||
43 | }Descriptors; | ||
44 | |||
45 | typedef struct { | ||
46 | Descriptors deg0; | ||
47 | Descriptors deg45; | ||
48 | Descriptors deg90; | ||
49 | Descriptors deg135; | ||
50 | }Angeles; | ||
51 | |||
52 | typedef struct { | ||
53 | Angeles distShort; | ||
54 | Angeles distLong; | ||
55 | }Neighborhood; | ||
56 | |||
57 | typedef short int Pixel; /* short int;*/ | ||
58 | |||
59 | |||
60 | void drawLineSegment(Pixel *image, | ||
61 | Coord startPoint, | ||
62 | Coord endPoint, | ||
63 | int startValue, | ||
64 | int endValue, | ||
65 | int thickness, | ||
66 | int dimension) | ||
67 | { | ||
68 | int changeColumn, changeRow; | ||
69 | int delta; | ||
70 | int column, row; | ||
71 | float value, valueDelta; | ||
72 | int t; | ||
73 | |||
74 | changeColumn = endPoint.column - startPoint.column; | ||
75 | changeRow = endPoint.row - startPoint.row; | ||
76 | |||
77 | assert((changeRow != 0) || (changeColumn != 0)); | ||
78 | |||
79 | column = startPoint.column; | ||
80 | row = startPoint.row; | ||
81 | value = startValue; | ||
82 | |||
83 | if (ABS(changeColumn) > ABS(changeRow)){ | ||
84 | valueDelta = ((float) endValue - startValue)/ | ||
85 | ((float) ABS(changeColumn)); | ||
86 | delta = 2*ABS(row) - ABS(column); | ||
87 | for (column = startPoint.column; | ||
88 | column == endPoint.column+sign(changeColumn); | ||
89 | column += sign(changeColumn)){ | ||
90 | for (t = MAX(0, row-thickness/2); | ||
91 | t < MIN(dimension, row+thickness - thickness/2); | ||
92 | t++) | ||
93 | image[t*dimension + column] = (int)value; | ||
94 | value += valueDelta; | ||
95 | if (delta >= 0){ | ||
96 | row += sign(changeRow); | ||
97 | delta -= 2*ABS(changeColumn); | ||
98 | } | ||
99 | column += sign(changeColumn); | ||
100 | delta += 2*ABS(changeRow); | ||
101 | } | ||
102 | } | ||
103 | else { | ||
104 | valueDelta = ((float) endValue - startValue)/ | ||
105 | ((float) ABS(changeRow)); | ||
106 | delta = 2* ABS(column) - ABS(row); | ||
107 | for (row = startPoint.row; | ||
108 | row == endPoint.row + sign(changeRow); | ||
109 | row += sign(changeRow)){ | ||
110 | for (t = MAX(0, column-thickness/2); | ||
111 | t < MIN(dimension, row + thickness - thickness/2); | ||
112 | t++) | ||
113 | image[row*dimension + t] = (int)value; | ||
114 | if (delta >= 0){ | ||
115 | column += sign(changeColumn); | ||
116 | delta -= 2*ABS(changeRow); | ||
117 | } | ||
118 | row += sign(changeRow); | ||
119 | delta += 2*ABS(changeColumn); | ||
120 | } | ||
121 | } | ||
122 | return; | ||
123 | } | ||
124 | |||
125 | |||
126 | |||
127 | Pixel *createImage (int dimension, | ||
128 | Pixel maxPixel, | ||
129 | int numberLines, | ||
130 | int minThickness, | ||
131 | int maxThickness) | ||
132 | { | ||
133 | Pixel *image; | ||
134 | int i; | ||
135 | |||
136 | Coord startPoint; | ||
137 | Coord endPoint; | ||
138 | int thickness; | ||
139 | int startValue; | ||
140 | int endValue; | ||
141 | |||
142 | image = (Pixel *)malloc(sizeof(Pixel) * dimension * dimension); | ||
143 | assert (image != NULL); | ||
144 | for (i=0; i<dimension*dimension; i++){ | ||
145 | image[i] = 0; | ||
146 | } | ||
147 | |||
148 | for (i=0; i<numberLines; i++){ | ||
149 | float temp; | ||
150 | float prev; | ||
151 | |||
152 | temp = randomUInt(0, dimension*dimension - 1); | ||
153 | startPoint.row = (int) temp/dimension; | ||
154 | startPoint.column = (int) temp % dimension; | ||
155 | prev = temp; | ||
156 | |||
157 | while((temp = randomUInt(0, dimension*dimension -1)) == prev); | ||
158 | |||
159 | endPoint.row = (int) temp/dimension; | ||
160 | endPoint.column = (int) temp% dimension; | ||
161 | |||
162 | thickness = randomUInt(minThickness, maxThickness); | ||
163 | startValue = randomUInt(MIN_PIXEL, maxPixel); | ||
164 | endValue = randomUInt(MIN_PIXEL, maxPixel); | ||
165 | |||
166 | drawLineSegment(image, startPoint, endPoint, | ||
167 | startValue, endValue, thickness, dimension); | ||
168 | } | ||
169 | return(image); | ||
170 | } | ||
171 | |||
172 | |||
173 | void calcEntropyEnergy( | ||
174 | int *sumHist, | ||
175 | int *diffHist, | ||
176 | Pixel *image, | ||
177 | int numBins, | ||
178 | int dx, | ||
179 | int dy, | ||
180 | float *entropy, | ||
181 | float *energy, | ||
182 | int dimension, | ||
183 | Pixel maxPixel) | ||
184 | { | ||
185 | int index; | ||
186 | int totalNumPixels; | ||
187 | int rowIndex; | ||
188 | int rowLow, rowHigh; | ||
189 | int columnIndex; | ||
190 | int columnLow, columnHigh; | ||
191 | int columnForPixelAtDistance; | ||
192 | int rowForPixelAtDistance; | ||
193 | int value0RowOffset; | ||
194 | int value1RowOffset; | ||
195 | |||
196 | *entropy = 0.0; | ||
197 | *energy = 0.0; | ||
198 | |||
199 | for (index = 0; index < numBins; index++){ | ||
200 | sumHist[index] = 0; | ||
201 | diffHist[index] = 0; | ||
202 | } | ||
203 | |||
204 | if (dy < 0){ | ||
205 | rowLow = -dy; | ||
206 | rowHigh = dimension; | ||
207 | } | ||
208 | else { | ||
209 | rowLow = 0; | ||
210 | rowHigh = dimension - dy; | ||
211 | } | ||
212 | if (dx < 0){ | ||
213 | columnLow = -dx; | ||
214 | columnHigh = dimension; | ||
215 | } | ||
216 | else | ||
217 | { | ||
218 | columnLow = 0; | ||
219 | columnHigh = dimension - dx; | ||
220 | } | ||
221 | |||
222 | totalNumPixels = 0; | ||
223 | value0RowOffset = rowLow * dimension; | ||
224 | value1RowOffset = (rowLow + dy) * dimension; | ||
225 | |||
226 | for (rowIndex = rowLow; rowIndex<rowHigh; rowIndex++){ | ||
227 | for (columnIndex= columnLow; columnIndex<columnHigh; | ||
228 | columnIndex++){ | ||
229 | int value0; | ||
230 | int value1; | ||
231 | int binIndex; | ||
232 | |||
233 | rowForPixelAtDistance = rowIndex + dy; | ||
234 | columnForPixelAtDistance = columnIndex + dx; | ||
235 | |||
236 | value0 = *(image + value0RowOffset + columnIndex); | ||
237 | value1 = *(image + value1RowOffset + | ||
238 | columnForPixelAtDistance); | ||
239 | |||
240 | binIndex = value0 + value1 - 2*MIN_PIXEL; | ||
241 | assert((binIndex >= 0) && (binIndex < numBins)); | ||
242 | sumHist[binIndex] += 1; | ||
243 | binIndex = value0 - value1 + maxPixel - MIN_PIXEL; | ||
244 | |||
245 | assert((binIndex >= 0) && (binIndex < numBins)); | ||
246 | |||
247 | diffHist[binIndex] += 1; | ||
248 | totalNumPixels += 1; | ||
249 | |||
250 | } | ||
251 | |||
252 | value0RowOffset += dimension; | ||
253 | value1RowOffset += dimension; | ||
254 | |||
255 | } | ||
256 | |||
257 | |||
258 | if (totalNumPixels > 0){ | ||
259 | int index; | ||
260 | double energySum; | ||
261 | double energyDifference; | ||
262 | double entropyValue; | ||
263 | double sumNormalized; | ||
264 | double diffNormalized; | ||
265 | double scale; | ||
266 | |||
267 | energySum = (double) 0; | ||
268 | energyDifference = (double) 0; | ||
269 | entropyValue = (double) 0; | ||
270 | scale = 1.e0/totalNumPixels; | ||
271 | for (index = 0; index<numBins; index++){ | ||
272 | if (sumHist[index] > 0){ | ||
273 | sumNormalized = (double) sumHist[index]*scale; | ||
274 | entropyValue = entropyValue - sumNormalized * | ||
275 | log((double)sumNormalized); | ||
276 | energySum = energySum + sumNormalized * sumNormalized ; | ||
277 | } | ||
278 | if (diffHist[index] > 0){ | ||
279 | diffNormalized = (double)diffHist[index]*scale; | ||
280 | entropyValue = entropyValue - diffNormalized * log(diffNormalized); | ||
281 | energyDifference = energyDifference + | ||
282 | diffNormalized * diffNormalized; | ||
283 | } | ||
284 | } | ||
285 | *energy = energySum * energyDifference; | ||
286 | *entropy = entropyValue; | ||
287 | } | ||
288 | return; | ||
289 | } | ||
290 | |||
291 | |||
292 | void neighborhoodCalculation | ||
293 | (Pixel *image, | ||
294 | int dimension, | ||
295 | int distanceShort, | ||
296 | int distanceLong, | ||
297 | Neighborhood *neighborhood, | ||
298 | Pixel maxPixel) | ||
299 | { | ||
300 | int *sumHist, *diffHist; | ||
301 | int numBins; | ||
302 | |||
303 | numBins = (2 * (maxPixel - MIN_PIXEL + 1) -1); | ||
304 | sumHist = (int *) malloc(numBins * sizeof(int)); | ||
305 | assert (sumHist != NULL); | ||
306 | diffHist = (int *)malloc(numBins * sizeof(int)); | ||
307 | assert(diffHist != NULL); | ||
308 | |||
309 | printf(" before short calc deg0\n"); | ||
310 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
311 | distanceShort, 0, | ||
312 | &(neighborhood->distShort.deg0.entropy), | ||
313 | &(neighborhood->distShort.deg0.energy), dimension, | ||
314 | maxPixel); | ||
315 | |||
316 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
317 | distanceShort, distanceShort, | ||
318 | &(neighborhood->distShort.deg45.entropy), | ||
319 | &(neighborhood->distShort.deg45.energy), dimension, | ||
320 | maxPixel); | ||
321 | |||
322 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
323 | 0, distanceShort, | ||
324 | &(neighborhood->distShort.deg90.entropy), | ||
325 | &(neighborhood->distShort.deg90.energy), dimension, | ||
326 | maxPixel); | ||
327 | |||
328 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
329 | -distanceShort, distanceShort, | ||
330 | &(neighborhood->distShort.deg135.entropy), | ||
331 | &(neighborhood->distShort.deg135.energy), dimension, | ||
332 | maxPixel); | ||
333 | |||
334 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
335 | distanceLong, 0, | ||
336 | &(neighborhood->distLong.deg0.entropy), | ||
337 | &(neighborhood->distLong.deg0.energy), dimension, | ||
338 | maxPixel); | ||
339 | |||
340 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
341 | distanceLong, distanceLong, | ||
342 | &(neighborhood->distLong.deg45.entropy), | ||
343 | &(neighborhood->distLong.deg45.energy), dimension, | ||
344 | maxPixel); | ||
345 | |||
346 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
347 | 0, distanceLong, | ||
348 | &(neighborhood->distLong.deg90.entropy), | ||
349 | &(neighborhood->distLong.deg90.energy), dimension, | ||
350 | maxPixel); | ||
351 | |||
352 | calcEntropyEnergy(sumHist, diffHist, image, numBins, | ||
353 | -distanceLong, distanceLong, | ||
354 | &(neighborhood->distLong.deg135.entropy), | ||
355 | &(neighborhood->distLong.deg135.energy), dimension, | ||
356 | maxPixel); | ||
357 | |||
358 | free(sumHist); | ||
359 | free(diffHist); | ||
360 | |||
361 | return; | ||
362 | } | ||
363 | |||
diff --git a/dis/original/Pointer/DISstressmarkRNG.h b/dis/original/Pointer/DISstressmarkRNG.h deleted file mode 100644 index 4aa2620..0000000 --- a/dis/original/Pointer/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Pointer/pointer.c b/dis/original/Pointer/pointer.c deleted file mode 100644 index 5671697..0000000 --- a/dis/original/Pointer/pointer.c +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Pointer Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | #include <stdio.h> | ||
16 | #include <time.h> | ||
17 | #include <assert.h> | ||
18 | #include <stdlib.h> | ||
19 | #include "DISstressmarkRNG.h" | ||
20 | #include "extra.h" | ||
21 | |||
22 | #define MIN_FIELD_SIZE 16 | ||
23 | #define MAX_FIELD_SIZE (16777216*4) // Modifed from original | ||
24 | #define MIN_WINDOW_SIZE 1 | ||
25 | #define MAX_WINDOW_SIZE 15 | ||
26 | #define MIN_HOP_LIMIT 1 | ||
27 | |||
28 | #define MAX_HOP_LIMIT 4294967295U | ||
29 | |||
30 | #define MIN_SEED -2147483647 | ||
31 | #define MAX_SEED -1 | ||
32 | #define MIN_THREADS 1 | ||
33 | #define MAX_THREADS 256 | ||
34 | |||
35 | /* | ||
36 | * main() | ||
37 | */ | ||
38 | int main(int argc, char** argv){ | ||
39 | |||
40 | unsigned int *field; | ||
41 | unsigned int f; | ||
42 | unsigned short int w; | ||
43 | unsigned int maxhops; | ||
44 | int seed; | ||
45 | unsigned int n; | ||
46 | |||
47 | clock_t startTime; | ||
48 | |||
49 | struct threadS{ | ||
50 | unsigned int initial; | ||
51 | unsigned int minStop; | ||
52 | unsigned int maxStop; | ||
53 | unsigned int hops; | ||
54 | }*thread; | ||
55 | |||
56 | unsigned int l; | ||
57 | SET_UP | ||
58 | |||
59 | assert(fscanf(stdin, "%lu %u %lu %ld %u", | ||
60 | &f, &l, &maxhops, &seed, &n) == 5); | ||
61 | |||
62 | assert ((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); | ||
63 | w = (unsigned int) l; | ||
64 | assert ((w >= MIN_WINDOW_SIZE) && (w <= MAX_WINDOW_SIZE)); | ||
65 | assert (w % 2 == 1); | ||
66 | assert (f > w); | ||
67 | assert ((maxhops >= MIN_HOP_LIMIT) && (maxhops <= MAX_HOP_LIMIT)); | ||
68 | assert ((seed >= MIN_SEED) && (seed <= MAX_SEED)); | ||
69 | |||
70 | assert ((n >= MIN_THREADS) && (n <= MAX_THREADS)); | ||
71 | if ((thread = (struct threadS *)malloc(n*sizeof(struct threadS))) == NULL) | ||
72 | return (-1); | ||
73 | |||
74 | for (l=0; l<n; l++){ | ||
75 | assert(fscanf(stdin, "%lu %lu %lu", | ||
76 | &(thread[l].initial), &(thread[l].minStop), &(thread[l].maxStop)) == 3); | ||
77 | assert ((thread[l].initial >= 0) && (thread[l].initial < f)); | ||
78 | assert ((thread[l].minStop >= 0) && (thread[l].minStop < f)); | ||
79 | assert ((thread[l].maxStop >= 0) && (thread[l].maxStop < f)); | ||
80 | } | ||
81 | |||
82 | if ((field = (unsigned int *)malloc(f*sizeof(int))) == NULL) | ||
83 | return (-1); | ||
84 | |||
85 | randInit(seed); | ||
86 | for (l=0; l<f; l++){ | ||
87 | field[l] = randInt(0, f-w); | ||
88 | } | ||
89 | startTime = time(NULL); | ||
90 | clock(); | ||
91 | |||
92 | for (l=0; l<n; l++) | ||
93 | { | ||
94 | START_LOOP | ||
95 | unsigned int index; | ||
96 | unsigned int minStop, maxStop; | ||
97 | unsigned int hops; | ||
98 | |||
99 | hops = 0; | ||
100 | minStop = thread[l].minStop; | ||
101 | maxStop = thread[l].maxStop; | ||
102 | index = thread[l].initial; | ||
103 | while ((hops < maxhops) && | ||
104 | (!((index >= minStop) && | ||
105 | (index < maxStop)))){ | ||
106 | |||
107 | unsigned int ll, lll; | ||
108 | unsigned int max, min; | ||
109 | unsigned int partition; | ||
110 | unsigned int high; | ||
111 | |||
112 | partition = field[index]; | ||
113 | max = MAX_FIELD_SIZE; | ||
114 | min = 0; | ||
115 | high = 0; | ||
116 | |||
117 | for (ll=0; ll<w; ll++){ | ||
118 | unsigned int balance; | ||
119 | unsigned int x; | ||
120 | x = field[index+ll]; | ||
121 | |||
122 | if (x > max) high++; | ||
123 | else if (x > min){ /* start else* */ | ||
124 | partition = x; | ||
125 | balance = 0; | ||
126 | for (lll=ll+1; lll<w; lll++){ | ||
127 | if (field[index+lll] > partition) balance++; | ||
128 | }/* end for loop */ | ||
129 | |||
130 | if (balance+high == w/2) break; | ||
131 | else if (balance+high > w/2){ | ||
132 | min = partition; | ||
133 | }/* end if */ | ||
134 | else { | ||
135 | max = partition; | ||
136 | high++; | ||
137 | }/* end else */ | ||
138 | } | ||
139 | if (min == max) break; | ||
140 | } /* end else* */ | ||
141 | index = (partition+hops)%(f-w); | ||
142 | hops++; | ||
143 | }/* end loop ll */ | ||
144 | thread[l].hops = hops; | ||
145 | STOP_LOOP | ||
146 | } /* end while */ | ||
147 | |||
148 | startTime = time(NULL) - startTime; | ||
149 | |||
150 | for (l=0; l<n; l++){ | ||
151 | fprintf(stdout, "%lu hops on thread %d\n", thread[l].hops, l); | ||
152 | } | ||
153 | |||
154 | fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); | ||
155 | free (field); | ||
156 | free (thread); | ||
157 | WRITE_TO_FILE | ||
158 | |||
159 | } | ||
diff --git a/dis/original/Transitive/DISstressmarkRNG.h b/dis/original/Transitive/DISstressmarkRNG.h deleted file mode 100644 index 4aa2620..0000000 --- a/dis/original/Transitive/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Transitive/transitive.c b/dis/original/Transitive/transitive.c deleted file mode 100644 index 5fa52e8..0000000 --- a/dis/original/Transitive/transitive.c +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Transitive Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | * | ||
15 | * CHANGELOG: | ||
16 | * Joshua Bakita, 05/30/2020: Fixed out-of-bounds randInt call | ||
17 | */ | ||
18 | |||
19 | #include <stdio.h> | ||
20 | #include <time.h> | ||
21 | #include <assert.h> | ||
22 | #include <stdlib.h> | ||
23 | #include "DISstressmarkRNG.h" | ||
24 | #include "extra.h" | ||
25 | |||
26 | #define MIN_VERTICES 8 | ||
27 | #define MAX_VERTICES 16384 | ||
28 | #define MIN_EDGES 0 | ||
29 | #define MAX_EDGES 268435456 | ||
30 | #define MIN_SEED -2147483647 | ||
31 | #define MAX_SEED -1 | ||
32 | #define NO_PATH 2147483647 | ||
33 | |||
34 | #define MIN_EDGS 0 | ||
35 | #define MAX_EDGE 255 | ||
36 | |||
37 | /* | ||
38 | * main() | ||
39 | */ | ||
40 | |||
41 | int main(int argc, char** argv){ | ||
42 | unsigned int *din, *dout; | ||
43 | unsigned int n; | ||
44 | unsigned int m; | ||
45 | unsigned int i, j, k; | ||
46 | int seed; | ||
47 | |||
48 | time_t startTime; | ||
49 | unsigned int sum; | ||
50 | |||
51 | fscanf(stdin,"%d %d %d", &n, &m, &seed); | ||
52 | |||
53 | assert((n >= MIN_VERTICES) && (n <= MAX_VERTICES)); | ||
54 | assert((m >= MIN_EDGES) && (m <= MAX_EDGES)); | ||
55 | assert (m <= n*n); | ||
56 | assert ((seed >= MIN_SEED) && (seed <= MAX_SEED)); | ||
57 | |||
58 | if ((din = (unsigned int *)malloc(n*n*sizeof(unsigned int))) == NULL) | ||
59 | return (-1); | ||
60 | if ((dout = (unsigned int *)malloc(n*n*sizeof(unsigned int))) == NULL) | ||
61 | return (-1); | ||
62 | |||
63 | for (i=0; i<n*n; i++){ | ||
64 | *(din + i) = NO_PATH; | ||
65 | *(dout + i) = NO_PATH; | ||
66 | } | ||
67 | |||
68 | randInit(seed); | ||
69 | for (k=0; k<m; k++){ | ||
70 | i = randInt(0, n-1); | ||
71 | j = randInt(0, n-1); | ||
72 | *(din + j*n + i) = randInt(MIN_EDGES, MAX_EDGES); | ||
73 | } | ||
74 | |||
75 | SET_UP | ||
76 | startTime = time(NULL); | ||
77 | |||
78 | for (k=0; k<n; k++){ | ||
79 | unsigned int old; | ||
80 | unsigned int new1; | ||
81 | unsigned int *dtemp; | ||
82 | START_LOOP | ||
83 | |||
84 | for (i=0; i<n; i++){ | ||
85 | for (j=0; j<n; j++){ | ||
86 | old = *(din + j*n + i); | ||
87 | new1 = *(din + j*n + k) + *(din + k*n + i); | ||
88 | *(dout + j*n + i) = (new1 < old ? new1: old); | ||
89 | assert (*(dout + j*n + i) <= NO_PATH); | ||
90 | assert (*(dout + j*n + i) <= *(din + j*n + i)); | ||
91 | } | ||
92 | } | ||
93 | dtemp = dout; | ||
94 | dout = din; | ||
95 | din = dtemp; | ||
96 | STOP_LOOP | ||
97 | } | ||
98 | |||
99 | startTime = time(NULL) - startTime; | ||
100 | |||
101 | for (j=0; j<n; j++){ | ||
102 | sum = 0; | ||
103 | for (i=0; i<n; i++){ | ||
104 | if (*(din + j*n + i) != NO_PATH) | ||
105 | sum += *(din + j*n + i); | ||
106 | } | ||
107 | fprintf(stdout, "%u\n", sum); | ||
108 | } | ||
109 | for (i=0; i<n; i++){ | ||
110 | sum = 0; | ||
111 | for (j=0; j<n; j++){ | ||
112 | if (*(din + j*n + i) != NO_PATH) | ||
113 | sum += *(din+j*n+i); | ||
114 | } | ||
115 | |||
116 | fprintf(stdout, "%u\n", sum); | ||
117 | } | ||
118 | |||
119 | fprintf(stdout, " total time = %u seconds. \n", (unsigned int)startTime); | ||
120 | free(din); | ||
121 | free(dout); | ||
122 | WRITE_TO_FILE | ||
123 | return(0); | ||
124 | } | ||
125 | |||
126 | |||
127 | |||
128 | |||
129 | |||
130 | |||
131 | |||
diff --git a/dis/original/Update/DISstressmarkRNG.h b/dis/original/Update/DISstressmarkRNG.h deleted file mode 100644 index 4aa2620..0000000 --- a/dis/original/Update/DISstressmarkRNG.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #include <math.h> | ||
2 | |||
3 | #define IA 16807 | ||
4 | #define IM 2147483647 | ||
5 | #define AM (1.0/IM) | ||
6 | #define IQ 127773 | ||
7 | #define IR 2836 | ||
8 | #define NTAB 32 | ||
9 | #define NDIV (1+(IM-1)/NTAB) | ||
10 | #define EPS 1.2e-7 | ||
11 | #define RNMX (1.0-EPS) | ||
12 | |||
13 | static long iy=0; | ||
14 | static long iv[NTAB]; | ||
15 | static long iseed; | ||
16 | |||
17 | int ABS(int x){ | ||
18 | if (x>= 0) return x; | ||
19 | else | ||
20 | return (-x); | ||
21 | } | ||
22 | |||
23 | int sign(int x){ | ||
24 | if (x >= 0) return 1; | ||
25 | else | ||
26 | return (-1); | ||
27 | } | ||
28 | |||
29 | int MAX(int x, int y){ | ||
30 | if (x>= y) return x; | ||
31 | else | ||
32 | return y; | ||
33 | } | ||
34 | |||
35 | int MIN(int x, int y){ | ||
36 | if (x<= y) return x; | ||
37 | else | ||
38 | return y; | ||
39 | } | ||
40 | |||
41 | void randInit(long idum) | ||
42 | { | ||
43 | long j; | ||
44 | long k; | ||
45 | |||
46 | assert (idum <= 0); | ||
47 | assert (iy == 0); | ||
48 | |||
49 | iseed = idum; | ||
50 | if (-(iseed)<1){ | ||
51 | iseed = 1; | ||
52 | } | ||
53 | else { | ||
54 | iseed = -(iseed); | ||
55 | } | ||
56 | for (j=NTAB+7; j>=0; j--){ | ||
57 | k = (iseed)/IQ; | ||
58 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
59 | if (iseed < 0){ | ||
60 | iseed += IM; | ||
61 | } | ||
62 | if (j < NTAB){ | ||
63 | iv[j] = iseed; | ||
64 | } | ||
65 | } | ||
66 | iy = iv[0]; | ||
67 | } | ||
68 | |||
69 | float randNum() | ||
70 | { | ||
71 | long j; | ||
72 | long k; | ||
73 | float temp; | ||
74 | |||
75 | assert (iy != 0); | ||
76 | |||
77 | k = (iseed)/IQ; | ||
78 | iseed = IA*(iseed-k*IQ)-IR*k; | ||
79 | |||
80 | if (iseed < 0){ | ||
81 | iseed += IM; | ||
82 | } | ||
83 | j = iy/NDIV; | ||
84 | iy = iv[j]; | ||
85 | iv[j] = iseed; | ||
86 | |||
87 | temp = AM * iy; | ||
88 | |||
89 | if (temp > RNMX){ | ||
90 | return RNMX; | ||
91 | } | ||
92 | else { | ||
93 | return temp; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | |||
98 | float randomFloat(float lowest_float, float highest_float) | ||
99 | { | ||
100 | float value; | ||
101 | float range; | ||
102 | |||
103 | assert (lowest_float < highest_float); | ||
104 | |||
105 | range = highest_float - lowest_float; | ||
106 | value = randNum()*(highest_float - lowest_float) + lowest_float; | ||
107 | assert(value >= lowest_float); | ||
108 | assert(value <= highest_float); | ||
109 | |||
110 | return value; | ||
111 | |||
112 | } | ||
113 | |||
114 | float randomNonZeroFloat(float lowest_float, float highest_float, float epsilon) | ||
115 | { | ||
116 | |||
117 | double range; | ||
118 | float value; | ||
119 | |||
120 | |||
121 | assert (lowest_float < 0); | ||
122 | assert (highest_float > 0); | ||
123 | assert (epsilon > 0); | ||
124 | assert ((epsilon < -lowest_float) && (epsilon < highest_float)); | ||
125 | |||
126 | range = highest_float - lowest_float; | ||
127 | value = (randNum() * range)+lowest_float; | ||
128 | |||
129 | if (ABS(value) < epsilon) | ||
130 | { | ||
131 | if (value > 0) value = value + epsilon; | ||
132 | else if (value < 0) value = value - epsilon; | ||
133 | |||
134 | } | ||
135 | |||
136 | assert (value >= lowest_float); | ||
137 | assert (value <= highest_float); | ||
138 | |||
139 | return value; | ||
140 | } | ||
141 | |||
142 | unsigned int randomUInt(int lowest_uint, int highest_uint) | ||
143 | { | ||
144 | float range; | ||
145 | unsigned int value; | ||
146 | float temp; | ||
147 | |||
148 | range =(float)(highest_uint - lowest_uint + 1); | ||
149 | temp = randNum(); | ||
150 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
151 | |||
152 | assert (value >= lowest_uint); | ||
153 | assert (value <= highest_uint); | ||
154 | |||
155 | return value; | ||
156 | } | ||
157 | |||
158 | unsigned int randomNonZeroUInt(int lowest_uint, int highest_uint) | ||
159 | { | ||
160 | float range; | ||
161 | unsigned int value; | ||
162 | float temp; | ||
163 | |||
164 | range =(float)(highest_uint - lowest_uint + 1); | ||
165 | value = 0; | ||
166 | while(value == 0){ | ||
167 | temp = randNum(); | ||
168 | |||
169 | value =(unsigned int)( floor(temp * range) + lowest_uint); | ||
170 | } | ||
171 | |||
172 | assert (value >= lowest_uint); | ||
173 | assert (value <= highest_uint); | ||
174 | |||
175 | return value; | ||
176 | } | ||
177 | |||
178 | int randInt(int lowest_uint, int highest_uint) | ||
179 | { | ||
180 | float range; | ||
181 | int value; | ||
182 | |||
183 | range = highest_uint - lowest_uint + 1; | ||
184 | value = (int)(floor(randNum() * range) + lowest_uint); | ||
185 | |||
186 | assert (value >= lowest_uint); | ||
187 | assert (value <= highest_uint); | ||
188 | |||
189 | return value; | ||
190 | } | ||
diff --git a/dis/original/Update/update.c b/dis/original/Update/update.c deleted file mode 100644 index 1fd8197..0000000 --- a/dis/original/Update/update.c +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | /* | ||
2 | * Sample code for the DIS Update Stressmark | ||
3 | * | ||
4 | * This source code is the completely correct source code based on | ||
5 | * the example codes provided by Atlantic Aerospace Division, Titan | ||
6 | * Systems Corporation, 2000. | ||
7 | * | ||
8 | * If you just compile and generate the executables from this source | ||
9 | * code, this code would be enough. However, if you wish to get a complete | ||
10 | * understanding of this stressmark, it is strongly suggested that you | ||
11 | * read the Benchmark Analysis and Specifications Document Version 1.0 | ||
12 | * before going on since the detailed comments are given in this documents. | ||
13 | * the comments are not repeated here. | ||
14 | */ | ||
15 | |||
16 | #include <stdio.h> | ||
17 | #include <stdlib.h> | ||
18 | #include <time.h> | ||
19 | #include<assert.h> | ||
20 | #include "DISstressmarkRNG.h" | ||
21 | #include "extra.h" | ||
22 | |||
23 | #define MIN_FIELD_SIZE 16 | ||
24 | |||
25 | #define MAX_FIELD_SIZE 16777216 | ||
26 | |||
27 | #define MIN_WINDOW_SIZE 1 | ||
28 | |||
29 | #define MAX_WINDOW_SIZE 15 | ||
30 | |||
31 | #define MIN_HOP_LIMIT 1 | ||
32 | |||
33 | #define MAX_HOP_LIMIT 4294967295U | ||
34 | |||
35 | #define MIN_SEED -2147483647 | ||
36 | |||
37 | #define MAX_SEED -1 | ||
38 | |||
39 | /* | ||
40 | *main() | ||
41 | */ | ||
42 | |||
43 | int main(int argc, char** argv){ | ||
44 | |||
45 | unsigned int *field; | ||
46 | unsigned int f; | ||
47 | unsigned int index; | ||
48 | unsigned short int w; | ||
49 | unsigned int maxhops; | ||
50 | int seed; | ||
51 | time_t startTime; | ||
52 | unsigned int initial; | ||
53 | unsigned int minStop; | ||
54 | unsigned int maxStop; | ||
55 | unsigned int hops; | ||
56 | unsigned int l; | ||
57 | |||
58 | assert(fscanf(stdin, "%u %u %u %d %u %u %u", | ||
59 | &f, &l, &maxhops, &seed, &initial, &minStop, &maxStop) == 7); | ||
60 | |||
61 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); | ||
62 | w = (unsigned int )l; | ||
63 | assert((w >= MIN_WINDOW_SIZE) && (w <= MAX_WINDOW_SIZE)); | ||
64 | assert(w%2 == 1); | ||
65 | assert(f > w); | ||
66 | assert((maxhops >= MIN_HOP_LIMIT) && (maxhops <= MAX_HOP_LIMIT)); | ||
67 | assert((seed >= MIN_SEED) && (seed <= MAX_SEED)); | ||
68 | assert((initial >= 0) && (initial < f)); | ||
69 | assert((minStop >= 0) && (minStop < f)); | ||
70 | assert((maxStop >= 0) && (maxStop < f)); | ||
71 | |||
72 | if ((field = (unsigned int *)malloc(f*sizeof(int))) == NULL) | ||
73 | return (-1); | ||
74 | |||
75 | randInit(seed); | ||
76 | for (l=0; l<f; l++){ | ||
77 | field[l] = randInt(0, f-w); | ||
78 | } | ||
79 | |||
80 | SET_UP | ||
81 | startTime = time(NULL); | ||
82 | |||
83 | hops = 0; | ||
84 | index = initial; | ||
85 | |||
86 | while ((hops < maxhops) && | ||
87 | (!((index >= minStop) && | ||
88 | (index < maxStop)))){ | ||
89 | int sum; | ||
90 | |||
91 | unsigned int ll, lll; | ||
92 | unsigned int max, min; | ||
93 | unsigned int partition; | ||
94 | unsigned int high; | ||
95 | if (hops % 100 == 0) {START_LOOP} // These loops are too quick to sample individually | ||
96 | max = MAX_FIELD_SIZE; | ||
97 | min = 0; | ||
98 | high = 0; | ||
99 | sum = 0; | ||
100 | |||
101 | for (ll=0; ll<w; ll++){ | ||
102 | unsigned int balance; | ||
103 | unsigned int x; | ||
104 | x = field[index+ll]; | ||
105 | sum += x; | ||
106 | |||
107 | if (x > max) high++; | ||
108 | else if (x >min){ /* start else* */ | ||
109 | partition = x; | ||
110 | balance = 0; | ||
111 | for (lll=ll+1; lll<w; lll++){ | ||
112 | if (field[index+lll] > partition) balance++; | ||
113 | } | ||
114 | if (balance+high == w/2) break; | ||
115 | else if (balance+high>w/2){ | ||
116 | min = partition; | ||
117 | }/* end if */ | ||
118 | else{ | ||
119 | max = partition; | ||
120 | high++; | ||
121 | } /* end else */ | ||
122 | } | ||
123 | if (min == max) break; | ||
124 | }/* end else* */ | ||
125 | field[index] = sum % (f-w); | ||
126 | index = (partition+hops)%(f-w); | ||
127 | hops++; | ||
128 | if (hops % 100 == 0) {STOP_LOOP} // These loops are too quick to sample individually | ||
129 | }/* end for loop */ | ||
130 | |||
131 | startTime = time(NULL) - startTime; | ||
132 | |||
133 | fprintf(stdout, "%u hops\n", hops); | ||
134 | fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); | ||
135 | free(field); | ||
136 | WRITE_TO_FILE | ||
137 | return(1); | ||
138 | } | ||
diff --git a/dis/original/WSS_DOCS.md b/dis/original/WSS_DOCS.md deleted file mode 100644 index da5e066..0000000 --- a/dis/original/WSS_DOCS.md +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | # Documentation Mapping DIS Stressmark Parameters to WSS | ||
2 | |||
3 | ## Field | ||
4 | 1 allocation in main() | ||
5 | f = 1st input param | ||
6 | |||
7 | sizeof(unsigned char) * f | ||
8 | |||
9 | ## Matrix | ||
10 | 6 allocations in main(), 7 allocations in biConjugateGradient() | ||
11 | |||
12 | *Allocations in main()* | ||
13 | dim = 2nd input param | ||
14 | numberNonzero = 3nd input param | ||
15 | |||
16 | sizeof(double) * (dim^2+3dim+numberNonzero) + sizeof(int) * (2dim+1+numberNonzero) | ||
17 | |||
18 | *Allocations in biConjugateGradient()* | ||
19 | sizeof(double) * 7dim | ||
20 | |||
21 | ## Neighborhood | ||
22 | 1 allocation in createImage, 2 allocations in neighborhoodCalculation | ||
23 | |||
24 | *Allocations in createImage()* | ||
25 | dimension = 3rd input param | ||
26 | |||
27 | sizeof(short int) * dimension^2 | ||
28 | |||
29 | *Allocations in neighborhoodCalculation()* | ||
30 | bitDepth = 2nd param | ||
31 | |||
32 | sizeof(int) * (2^(bitDepth + 1) - 1) | ||
33 | |||
34 | ## Pointer | ||
35 | n = 5th input param | ||
36 | f = 1st input param | ||
37 | |||
38 | sizeof(unsigned int) * 4n + sizeof(int) * f | ||
39 | |||
40 | ## Transitive | ||
41 | n = 1st input param | ||
42 | |||
43 | sizeof(unsigned int) * 2n^2 | ||
44 | |||
45 | ## Update | ||
46 | f = 1st input param | ||
47 | |||
48 | sizeof(int) * f | ||
49 | |||
50 | ## Testplan | ||
51 | *Problem!* Larger WSS = more computations | ||
52 | Use testcase #1 for non-specified parameters | ||
53 | Below math computed for x86_64 | ||
54 | - Test WSS at powers of 2: 16 KiB, 32, 64, 128, 256, 512, 1MiB, 2, 4, 8, 16, 32 | ||
55 | - For each WSS, measure cache allocation of 0, 1, 2, 4, 8, 16 | ||
56 | |||
57 | ### Field | ||
58 | Just vary first param | ||
59 | |||
60 | f = WSS | ||
61 | |||
62 | ### Matrix | ||
63 | 0.3 - 16% number nonzero | ||
64 | - Fixed at 8% | ||
65 | Just vary dim (matrix size) | ||
66 | |||
67 | sizeof(double) * (dim^2+10dim+numberNonzero) + sizeof(int) * (2dim+1+numberNonzero) = WSS | ||
68 | |||
69 | |||
70 | ### Neighborhood | ||
71 | 8 or 15 bit depth | ||
72 | - Fix at 12? | ||
73 | Just vary dim (image size) | ||
74 | |||
75 | ### Pointer | ||
76 | 10 for n | ||
77 | Just vary f | ||
78 | |||
79 | ### Transitive | ||
80 | Just vary n | ||
81 | |||
82 | ### Update | ||
83 | Just vary f | ||
diff --git a/dis/original/clean.sh b/dis/original/clean.sh deleted file mode 100755 index 7c58295..0000000 --- a/dis/original/clean.sh +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | tail -n +2 $1 | tr "-" " " | sed "s/L3:0=0000;1=0000;2=0000;3=0000/0/" | sed "s/L3:0=0000;1=0000;2=0000;3=0001/1/" | sed "s/L3:0=0000;1=0000;2=0000;3=0003/2/" | sed "s/L3:0=0000;1=0000;2=0000;3=0007/3/" | sed "s/L3:0=0000;1=0000;2=0000;3=000f/4/" | sed "s/L3:0=0000;1=0000;2=0000;3=003f/6/" | sed "s/L3:0=0000;1=0000;2=0000;3=00ff/8/" | sed "s/L3:0=0000;1=0000;2=0000;3=03ff/10/" | sed "s/L3:0=0000;1=0000;2=0000;3=0fff/12/" | sed "s/L3:0=0000;1=0000;2=0000;3=3fff/14/" | sed "s/L3:0=0000;1=0000;2=0000;3=ffff/16/" > $1.clean | ||
diff --git a/dis/original/gen_input.py b/dis/original/gen_input.py deleted file mode 100755 index c7821b0..0000000 --- a/dis/original/gen_input.py +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | #!/usr/bin/python3 | ||
2 | ##### | ||
3 | # Copyright 2020 Joshua Bakita | ||
4 | # | ||
5 | # This program generates input data for the DIS benchmark suite on stdout | ||
6 | # given a requested working set size. | ||
7 | ##### | ||
8 | |||
9 | |||
10 | from ctypes import sizeof, c_double, c_int, c_short | ||
11 | from math import sqrt, floor | ||
12 | import sys # For argv and stderr | ||
13 | |||
14 | USAGE = """Usage: {} <benchmark> <template> <WSS in bytes>""" | ||
15 | |||
16 | # Check input | ||
17 | if (len(sys.argv) < 4): | ||
18 | print(USAGE.format(sys.argv[0]), file=sys.stderr) | ||
19 | exit(1); | ||
20 | |||
21 | # Don't try to understand the logic in these functions, see WSS_DOCS.md | ||
22 | def setup_field(params, wss): | ||
23 | params[0] = wss | ||
24 | return params | ||
25 | |||
26 | def setup_matrix(params, wss): | ||
27 | nnZR = 0.08 # 8% seems average | ||
28 | # This formula is out of a solver | ||
29 | si = sizeof(c_int) | ||
30 | sd = sizeof(c_double) | ||
31 | d = (sqrt((si**2) * (-(nnZR-1)) - si*sd*(nnZR-9) + si*wss*nnZR + sd*(25*sd+wss*nnZR+wss)) - si - 5*sd) / (si*nnZR + sd*nnZR + sd) | ||
32 | params[1] = floor(d); | ||
33 | params[2] = floor(d*d*nnZR); | ||
34 | if params[1] <= 0 or params[2] <= 0: | ||
35 | raise Exception("WSS too small for matrix benchmark!") | ||
36 | return params | ||
37 | |||
38 | def setup_neighborhood(params, wss): | ||
39 | bitDepth = 8 | ||
40 | bitDepthAlloc = sizeof(c_int) * (2**(bitDepth + 1) - 1) | ||
41 | dim = sqrt((wss - bitDepthAlloc) / sizeof(c_short)) | ||
42 | params[1] = bitDepth | ||
43 | params[2] = floor(dim) | ||
44 | if params[1] <= 0 or params[2] <= 0: | ||
45 | raise Exception("WSS too small for neighborhood benchmark!") | ||
46 | # Cap maximum line thinkness to the image size | ||
47 | params[5] = min(params[2]-1, int(params[5])) | ||
48 | # Cap line lengths to the image size | ||
49 | params[6] = min(params[2]-1, int(params[6])) | ||
50 | params[7] = min(params[2]-1, int(params[7])) | ||
51 | return params | ||
52 | |||
53 | def setup_pointer(params, wss): | ||
54 | n = 10; | ||
55 | f = (wss - sizeof(c_int) * 4 * n) / sizeof(c_int) | ||
56 | params[0] = floor(f) | ||
57 | params[4] = floor(n) | ||
58 | if params[0] <= 0 or params[4] <= 0: | ||
59 | raise Exception("WSS too small for pointer benchmark!") | ||
60 | return params | ||
61 | |||
62 | def setup_transitive(params, wss): | ||
63 | n = sqrt(wss / (sizeof(c_int) * 2)) | ||
64 | params[0] = floor(n) | ||
65 | # Fix edges at 50% | ||
66 | params[1] = floor(params[0] * 0.5) | ||
67 | if params[0] <= 0: | ||
68 | raise Exception("WSS too small for transitive benchmark!") | ||
69 | return params | ||
70 | |||
71 | def setup_update(params, wss): | ||
72 | f = wss / sizeof(c_int) | ||
73 | params[0] = floor(f) | ||
74 | if params[0] <= 0: | ||
75 | raise Exception("WSS too small for update benchmark!") | ||
76 | # Don't do more than 100M hops (keeps time array feasible) | ||
77 | params[2] = min(100000000, int(params[2])) | ||
78 | # Enforce size requirements | ||
79 | params[4] = min(params[0]-1, int(params[4])) | ||
80 | params[5] = min(params[0]-1, int(params[5])) | ||
81 | params[6] = min(params[0]-1, int(params[6])) | ||
82 | return params | ||
83 | |||
84 | def setup_random_walk(params, wss): | ||
85 | params[0] = wss | ||
86 | return params | ||
87 | |||
88 | BENCH_TO_PARAMS = {"field":setup_field, "matrix":setup_matrix, "neighborhood":setup_neighborhood, "pointer":setup_pointer, "transitive":setup_transitive, "update":setup_update, "random_walk":setup_random_walk} | ||
89 | |||
90 | # Main logic | ||
91 | benchmark_name = sys.argv[1] | ||
92 | if benchmark_name not in BENCH_TO_PARAMS.keys(): | ||
93 | print("Invalid benchmark name.", file=sys.stderr) | ||
94 | exit(2) | ||
95 | |||
96 | wss = int(sys.argv[3]) | ||
97 | if wss <= 0: | ||
98 | print("Invalid working set size", file=sys.stderr) | ||
99 | exit(3) | ||
100 | |||
101 | with open(sys.argv[2], "r") as template: | ||
102 | # We expect the initialization params to all be on the first line | ||
103 | params = template.readline().split() | ||
104 | mutated_params = BENCH_TO_PARAMS[benchmark_name](params, wss); | ||
105 | print(" ".join(map(lambda x: str(x), mutated_params))) | ||
106 | print(" ".join(map(lambda x: str(x), mutated_params)), file=sys.stderr) | ||
107 | if benchmark_name == "pointer": | ||
108 | # Clone the data format used in the template | ||
109 | for i in range(0,10): | ||
110 | print("10 " + str(mutated_params[0]-10) + " " + str(mutated_params[0]-10)) | ||
111 | else: | ||
112 | print(template.read()) | ||
113 | |||
diff --git a/dis/original/inputs/Field/in1 b/dis/original/inputs/Field/in1 deleted file mode 100644 index 1b87830..0000000 --- a/dis/original/inputs/Field/in1 +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | 1648577 -1 35 80 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | |||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | 1 1 22 1 c2 1 2d 0 | ||
58 | |||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | 1 1 22 1 c2 1 2d 0 | ||
68 | 1 1 22 1 c2 1 2d 0 | ||
69 | |||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | 1 1 22 1 c2 1 2d 0 | ||
79 | 1 1 22 1 c2 1 2d 0 | ||
80 | |||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | 1 1 22 1 c2 1 2d 0 | ||
90 | 1 1 22 1 c2 1 2d 0 | ||
91 | |||
92 | 1 1 22 1 c2 1 2d 0 | ||
93 | 1 1 22 1 c2 1 2d 0 | ||
94 | 1 1 22 1 c2 1 2d 0 | ||
95 | 1 1 22 1 c2 1 2d 0 | ||
96 | 1 1 22 1 c2 1 2d 0 | ||
97 | 1 1 22 1 c2 1 2d 0 | ||
98 | 1 1 22 1 c2 1 2d 0 | ||
99 | 1 1 22 1 c2 1 2d 0 | ||
100 | 1 1 22 1 c2 1 2d 0 | ||
101 | 1 1 22 1 c2 1 2d 0 | ||
102 | |||
103 | 1 1 22 1 c2 1 2d 0 | ||
104 | 1 1 22 1 c2 1 2d 0 | ||
105 | 1 1 22 1 c2 1 2d 0 | ||
106 | 1 1 22 1 c2 1 2d 0 | ||
107 | 1 1 22 1 c2 1 2d 0 | ||
108 | 1 1 22 1 c2 1 2d 0 | ||
109 | 1 1 22 1 c2 1 2d 0 | ||
110 | 1 1 22 1 c2 1 2d 0 | ||
111 | 1 1 22 1 c2 1 2d 0 | ||
112 | 1 1 22 1 c2 1 2d 0 | ||
113 | |||
114 | 1 1 22 1 c2 1 2d 0 | ||
115 | 1 1 22 1 c2 1 2d 0 | ||
116 | 1 1 22 1 c2 1 2d 0 | ||
117 | 1 1 22 1 c2 1 2d 0 | ||
118 | 1 1 22 1 c2 1 2d 0 | ||
119 | 1 1 22 1 c2 1 2d 0 | ||
120 | 1 1 22 1 c2 1 2d 0 | ||
121 | 1 1 22 1 c2 1 2d 0 | ||
122 | 1 1 22 1 c2 1 2d 0 | ||
123 | 1 1 22 1 c2 1 2d 0 | ||
124 | |||
125 | 1 1 22 1 c2 1 2d 0 | ||
126 | 1 1 22 1 c2 1 2d 0 | ||
127 | 1 1 22 1 c2 1 2d 0 | ||
128 | 1 1 22 1 c2 1 2d 0 | ||
129 | 1 1 22 1 c2 1 2d 0 | ||
130 | 1 1 22 1 c2 1 2d 0 | ||
131 | 1 1 22 1 c2 1 2d 0 | ||
132 | 1 1 22 1 c2 1 2d 0 | ||
133 | 1 1 22 1 c2 1 2d 0 | ||
134 | 1 1 22 1 c2 1 2d 0 | ||
135 | |||
136 | 1 1 22 1 c2 1 2d 0 | ||
137 | 1 1 22 1 c2 1 2d 0 | ||
138 | 1 1 22 1 c2 1 2d 0 | ||
139 | 1 1 22 1 c2 1 2d 0 | ||
140 | 1 1 22 1 c2 1 2d 0 | ||
141 | 1 1 22 1 c2 1 2d 0 | ||
142 | 1 1 22 1 c2 1 2d 0 | ||
143 | 1 1 22 1 c2 1 2d 0 | ||
144 | 1 1 22 1 c2 1 2d 0 | ||
145 | 1 1 22 1 c2 1 2d 0 | ||
146 | |||
147 | 1 1 22 1 c2 1 2d 0 | ||
148 | 1 1 22 1 c2 1 2d 0 | ||
149 | 1 1 22 1 c2 1 2d 0 | ||
150 | 1 1 22 1 c2 1 2d 0 | ||
151 | 1 1 22 1 c2 1 2d 0 | ||
152 | 1 1 22 1 c2 1 2d 0 | ||
153 | 1 1 22 1 c2 1 2d 0 | ||
154 | 1 1 22 1 c2 1 2d 0 | ||
155 | 1 1 22 1 c2 1 2d 0 | ||
156 | 1 1 22 1 c2 1 2d 0 | ||
157 | |||
158 | 1 1 22 1 c2 1 2d 0 | ||
159 | 1 1 22 1 c2 1 2d 0 | ||
160 | 1 1 22 1 c2 1 2d 0 | ||
161 | 1 1 22 1 c2 1 2d 0 | ||
162 | 1 1 22 1 c2 1 2d 0 | ||
163 | 1 1 22 1 c2 1 2d 0 | ||
164 | 1 1 22 1 c2 1 2d 0 | ||
165 | 1 1 22 1 c2 1 2d 0 | ||
166 | 1 1 22 1 c2 1 2d 0 | ||
167 | 1 1 22 1 c2 1 2d 0 | ||
168 | |||
169 | 1 1 22 1 c2 1 2d 0 | ||
170 | 1 1 22 1 c2 1 2d 0 | ||
171 | 1 1 22 1 c2 1 2d 0 | ||
172 | 1 1 22 1 c2 1 2d 0 | ||
173 | 1 1 22 1 c2 1 2d 0 | ||
174 | 1 1 22 1 c2 1 2d 0 | ||
175 | 1 1 22 1 c2 1 2d 0 | ||
176 | 1 1 22 1 c2 1 2d 0 | ||
177 | 1 1 22 1 c2 1 2d 0 | ||
178 | 1 1 22 1 c2 1 2d 0 | ||
179 | |||
diff --git a/dis/original/inputs/Field/in2 b/dis/original/inputs/Field/in2 deleted file mode 100644 index 2185e20..0000000 --- a/dis/original/inputs/Field/in2 +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | 1648577 -1 35 160 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | |||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | 1 1 22 1 c2 1 2d 0 | ||
58 | |||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | 1 1 22 1 c2 1 2d 0 | ||
68 | 1 1 22 1 c2 1 2d 0 | ||
69 | |||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | 1 1 22 1 c2 1 2d 0 | ||
79 | 1 1 22 1 c2 1 2d 0 | ||
80 | |||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | 1 1 22 1 c2 1 2d 0 | ||
90 | 1 1 22 1 c2 1 2d 0 | ||
91 | |||
92 | 1 1 22 1 c2 1 2d 0 | ||
93 | 1 1 22 1 c2 1 2d 0 | ||
94 | 1 1 22 1 c2 1 2d 0 | ||
95 | 1 1 22 1 c2 1 2d 0 | ||
96 | 1 1 22 1 c2 1 2d 0 | ||
97 | 1 1 22 1 c2 1 2d 0 | ||
98 | 1 1 22 1 c2 1 2d 0 | ||
99 | 1 1 22 1 c2 1 2d 0 | ||
100 | 1 1 22 1 c2 1 2d 0 | ||
101 | 1 1 22 1 c2 1 2d 0 | ||
102 | |||
103 | 1 1 22 1 c2 1 2d 0 | ||
104 | 1 1 22 1 c2 1 2d 0 | ||
105 | 1 1 22 1 c2 1 2d 0 | ||
106 | 1 1 22 1 c2 1 2d 0 | ||
107 | 1 1 22 1 c2 1 2d 0 | ||
108 | 1 1 22 1 c2 1 2d 0 | ||
109 | 1 1 22 1 c2 1 2d 0 | ||
110 | 1 1 22 1 c2 1 2d 0 | ||
111 | 1 1 22 1 c2 1 2d 0 | ||
112 | 1 1 22 1 c2 1 2d 0 | ||
113 | |||
114 | 1 1 22 1 c2 1 2d 0 | ||
115 | 1 1 22 1 c2 1 2d 0 | ||
116 | 1 1 22 1 c2 1 2d 0 | ||
117 | 1 1 22 1 c2 1 2d 0 | ||
118 | 1 1 22 1 c2 1 2d 0 | ||
119 | 1 1 22 1 c2 1 2d 0 | ||
120 | 1 1 22 1 c2 1 2d 0 | ||
121 | 1 1 22 1 c2 1 2d 0 | ||
122 | 1 1 22 1 c2 1 2d 0 | ||
123 | 1 1 22 1 c2 1 2d 0 | ||
124 | |||
125 | 1 1 22 1 c2 1 2d 0 | ||
126 | 1 1 22 1 c2 1 2d 0 | ||
127 | 1 1 22 1 c2 1 2d 0 | ||
128 | 1 1 22 1 c2 1 2d 0 | ||
129 | 1 1 22 1 c2 1 2d 0 | ||
130 | 1 1 22 1 c2 1 2d 0 | ||
131 | 1 1 22 1 c2 1 2d 0 | ||
132 | 1 1 22 1 c2 1 2d 0 | ||
133 | 1 1 22 1 c2 1 2d 0 | ||
134 | 1 1 22 1 c2 1 2d 0 | ||
135 | |||
136 | 1 1 22 1 c2 1 2d 0 | ||
137 | 1 1 22 1 c2 1 2d 0 | ||
138 | 1 1 22 1 c2 1 2d 0 | ||
139 | 1 1 22 1 c2 1 2d 0 | ||
140 | 1 1 22 1 c2 1 2d 0 | ||
141 | 1 1 22 1 c2 1 2d 0 | ||
142 | 1 1 22 1 c2 1 2d 0 | ||
143 | 1 1 22 1 c2 1 2d 0 | ||
144 | 1 1 22 1 c2 1 2d 0 | ||
145 | 1 1 22 1 c2 1 2d 0 | ||
146 | |||
147 | 1 1 22 1 c2 1 2d 0 | ||
148 | 1 1 22 1 c2 1 2d 0 | ||
149 | 1 1 22 1 c2 1 2d 0 | ||
150 | 1 1 22 1 c2 1 2d 0 | ||
151 | 1 1 22 1 c2 1 2d 0 | ||
152 | 1 1 22 1 c2 1 2d 0 | ||
153 | 1 1 22 1 c2 1 2d 0 | ||
154 | 1 1 22 1 c2 1 2d 0 | ||
155 | 1 1 22 1 c2 1 2d 0 | ||
156 | 1 1 22 1 c2 1 2d 0 | ||
157 | |||
158 | 1 1 22 1 c2 1 2d 0 | ||
159 | 1 1 22 1 c2 1 2d 0 | ||
160 | 1 1 22 1 c2 1 2d 0 | ||
161 | 1 1 22 1 c2 1 2d 0 | ||
162 | 1 1 22 1 c2 1 2d 0 | ||
163 | 1 1 22 1 c2 1 2d 0 | ||
164 | 1 1 22 1 c2 1 2d 0 | ||
165 | 1 1 22 1 c2 1 2d 0 | ||
166 | 1 1 22 1 c2 1 2d 0 | ||
167 | 1 1 22 1 c2 1 2d 0 | ||
168 | |||
169 | 1 1 22 1 c2 1 2d 0 | ||
170 | 1 1 22 1 c2 1 2d 0 | ||
171 | 1 1 22 1 c2 1 2d 0 | ||
172 | 1 1 22 1 c2 1 2d 0 | ||
173 | 1 1 22 1 c2 1 2d 0 | ||
174 | 1 1 22 1 c2 1 2d 0 | ||
175 | 1 1 22 1 c2 1 2d 0 | ||
176 | 1 1 22 1 c2 1 2d 0 | ||
177 | 1 1 22 1 c2 1 2d 0 | ||
178 | 1 1 22 1 c2 1 2d 0 | ||
179 | |||
diff --git a/dis/original/inputs/Field/in3 b/dis/original/inputs/Field/in3 deleted file mode 100644 index 15608d2..0000000 --- a/dis/original/inputs/Field/in3 +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | 16777216 -1 35 40 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
diff --git a/dis/original/inputs/Field/in4 b/dis/original/inputs/Field/in4 deleted file mode 100644 index 5f9ca77..0000000 --- a/dis/original/inputs/Field/in4 +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | 16777216 -1 35 80 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | |||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | 1 1 22 1 c2 1 2d 0 | ||
58 | |||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | 1 1 22 1 c2 1 2d 0 | ||
68 | 1 1 22 1 c2 1 2d 0 | ||
69 | |||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | 1 1 22 1 c2 1 2d 0 | ||
79 | 1 1 22 1 c2 1 2d 0 | ||
80 | |||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | 1 1 22 1 c2 1 2d 0 | ||
90 | 1 1 22 1 c2 1 2d 0 | ||
diff --git a/dis/original/inputs/Field/in5 b/dis/original/inputs/Field/in5 deleted file mode 100644 index 7291fc6..0000000 --- a/dis/original/inputs/Field/in5 +++ /dev/null | |||
@@ -1,198 +0,0 @@ | |||
1 | 16777216 -1 35 160 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | 1 1 22 1 c2 1 2d 0 | ||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | |||
58 | 1 1 22 1 c2 1 2d 0 | ||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | 1 1 22 1 c2 1 2d 0 | ||
68 | |||
69 | 1 1 22 1 c2 1 2d 0 | ||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | 1 1 22 1 c2 1 2d 0 | ||
79 | |||
80 | 1 1 22 1 c2 1 2d 0 | ||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | 1 1 22 1 c2 1 2d 0 | ||
90 | 1 1 22 1 c2 1 2d 0 | ||
91 | 1 1 22 1 c2 1 2d 0 | ||
92 | 1 1 22 1 c2 1 2d 0 | ||
93 | 1 1 22 1 c2 1 2d 0 | ||
94 | 1 1 22 1 c2 1 2d 0 | ||
95 | 1 1 22 1 c2 1 2d 0 | ||
96 | 1 1 22 1 c2 1 2d 0 | ||
97 | 1 1 22 1 c2 1 2d 0 | ||
98 | 1 1 22 1 c2 1 2d 0 | ||
99 | 1 1 22 1 c2 1 2d 0 | ||
100 | |||
101 | 1 1 22 1 c2 1 2d 0 | ||
102 | 1 1 22 1 c2 1 2d 0 | ||
103 | 1 1 22 1 c2 1 2d 0 | ||
104 | 1 1 22 1 c2 1 2d 0 | ||
105 | 1 1 22 1 c2 1 2d 0 | ||
106 | 1 1 22 1 c2 1 2d 0 | ||
107 | 1 1 22 1 c2 1 2d 0 | ||
108 | 1 1 22 1 c2 1 2d 0 | ||
109 | 1 1 22 1 c2 1 2d 0 | ||
110 | 1 1 22 1 c2 1 2d 0 | ||
111 | |||
112 | 1 1 22 1 c2 1 2d 0 | ||
113 | 1 1 22 1 c2 1 2d 0 | ||
114 | 1 1 22 1 c2 1 2d 0 | ||
115 | 1 1 22 1 c2 1 2d 0 | ||
116 | 1 1 22 1 c2 1 2d 0 | ||
117 | 1 1 22 1 c2 1 2d 0 | ||
118 | 1 1 22 1 c2 1 2d 0 | ||
119 | 1 1 22 1 c2 1 2d 0 | ||
120 | 1 1 22 1 c2 1 2d 0 | ||
121 | 1 1 22 1 c2 1 2d 0 | ||
122 | |||
123 | 1 1 22 1 c2 1 2d 0 | ||
124 | 1 1 22 1 c2 1 2d 0 | ||
125 | 1 1 22 1 c2 1 2d 0 | ||
126 | 1 1 22 1 c2 1 2d 0 | ||
127 | 1 1 22 1 c2 1 2d 0 | ||
128 | 1 1 22 1 c2 1 2d 0 | ||
129 | 1 1 22 1 c2 1 2d 0 | ||
130 | 1 1 22 1 c2 1 2d 0 | ||
131 | 1 1 22 1 c2 1 2d 0 | ||
132 | 1 1 22 1 c2 1 2d 0 | ||
133 | |||
134 | 1 1 22 1 c2 1 2d 0 | ||
135 | 1 1 22 1 c2 1 2d 0 | ||
136 | 1 1 22 1 c2 1 2d 0 | ||
137 | 1 1 22 1 c2 1 2d 0 | ||
138 | 1 1 22 1 c2 1 2d 0 | ||
139 | 1 1 22 1 c2 1 2d 0 | ||
140 | 1 1 22 1 c2 1 2d 0 | ||
141 | 1 1 22 1 c2 1 2d 0 | ||
142 | 1 1 22 1 c2 1 2d 0 | ||
143 | 1 1 22 1 c2 1 2d 0 | ||
144 | |||
145 | 1 1 22 1 c2 1 2d 0 | ||
146 | 1 1 22 1 c2 1 2d 0 | ||
147 | 1 1 22 1 c2 1 2d 0 | ||
148 | 1 1 22 1 c2 1 2d 0 | ||
149 | 1 1 22 1 c2 1 2d 0 | ||
150 | 1 1 22 1 c2 1 2d 0 | ||
151 | 1 1 22 1 c2 1 2d 0 | ||
152 | 1 1 22 1 c2 1 2d 0 | ||
153 | 1 1 22 1 c2 1 2d 0 | ||
154 | 1 1 22 1 c2 1 2d 0 | ||
155 | |||
156 | 1 1 22 1 c2 1 2d 0 | ||
157 | 1 1 22 1 c2 1 2d 0 | ||
158 | 1 1 22 1 c2 1 2d 0 | ||
159 | 1 1 22 1 c2 1 2d 0 | ||
160 | 1 1 22 1 c2 1 2d 0 | ||
161 | 1 1 22 1 c2 1 2d 0 | ||
162 | 1 1 22 1 c2 1 2d 0 | ||
163 | 1 1 22 1 c2 1 2d 0 | ||
164 | 1 1 22 1 c2 1 2d 0 | ||
165 | 1 1 22 1 c2 1 2d 0 | ||
166 | |||
167 | 1 1 22 1 c2 1 2d 0 | ||
168 | 1 1 22 1 c2 1 2d 0 | ||
169 | 1 1 22 1 c2 1 2d 0 | ||
170 | 1 1 22 1 c2 1 2d 0 | ||
171 | 1 1 22 1 c2 1 2d 0 | ||
172 | 1 1 22 1 c2 1 2d 0 | ||
173 | 1 1 22 1 c2 1 2d 0 | ||
174 | 1 1 22 1 c2 1 2d 0 | ||
175 | 1 1 22 1 c2 1 2d 0 | ||
176 | 1 1 22 1 c2 1 2d 0 | ||
177 | |||
178 | 1 1 22 1 c2 1 2d 0 | ||
179 | 1 1 22 1 c2 1 2d 0 | ||
180 | 1 1 22 1 c2 1 2d 0 | ||
181 | 1 1 22 1 c2 1 2d 0 | ||
182 | 1 1 22 1 c2 1 2d 0 | ||
183 | 1 1 22 1 c2 1 2d 0 | ||
184 | 1 1 22 1 c2 1 2d 0 | ||
185 | 1 1 22 1 c2 1 2d 0 | ||
186 | 1 1 22 1 c2 1 2d 0 | ||
187 | 1 1 22 1 c2 1 2d 0 | ||
188 | |||
189 | 1 1 22 1 c2 1 2d 0 | ||
190 | 1 1 22 1 c2 1 2d 0 | ||
191 | 1 1 22 1 c2 1 2d 0 | ||
192 | 1 1 22 1 c2 1 2d 0 | ||
193 | 1 1 22 1 c2 1 2d 0 | ||
194 | 1 1 22 1 c2 1 2d 0 | ||
195 | 1 1 22 1 c2 1 2d 0 | ||
196 | 1 1 22 1 c2 1 2d 0 | ||
197 | 1 1 22 1 c2 1 2d 0 | ||
198 | 1 1 22 1 c2 1 2d 0 | ||
diff --git a/dis/original/inputs/Field/in6 b/dis/original/inputs/Field/in6 deleted file mode 100644 index 4547413..0000000 --- a/dis/original/inputs/Field/in6 +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | 16777216 -1 100 160 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | 1 1 22 1 c2 1 2d 0 | ||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | |||
58 | 1 1 22 1 c2 1 2d 0 | ||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | 1 1 22 1 c2 1 2d 0 | ||
68 | |||
69 | 1 1 22 1 c2 1 2d 0 | ||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | 1 1 22 1 c2 1 2d 0 | ||
79 | |||
80 | 1 1 22 1 c2 1 2d 0 | ||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | 1 1 22 1 c2 1 2d 0 | ||
90 | |||
91 | 1 1 22 1 c2 1 2d 0 | ||
92 | 1 1 22 1 c2 1 2d 0 | ||
93 | 1 1 22 1 c2 1 2d 0 | ||
94 | 1 1 22 1 c2 1 2d 0 | ||
95 | 1 1 22 1 c2 1 2d 0 | ||
96 | 1 1 22 1 c2 1 2d 0 | ||
97 | 1 1 22 1 c2 1 2d 0 | ||
98 | 1 1 22 1 c2 1 2d 0 | ||
99 | 1 1 22 1 c2 1 2d 0 | ||
100 | 1 1 22 1 c2 1 2d 0 | ||
101 | |||
102 | 1 1 22 1 c2 1 2d 0 | ||
103 | 1 1 22 1 c2 1 2d 0 | ||
104 | 1 1 22 1 c2 1 2d 0 | ||
105 | 1 1 22 1 c2 1 2d 0 | ||
106 | 1 1 22 1 c2 1 2d 0 | ||
107 | 1 1 22 1 c2 1 2d 0 | ||
108 | 1 1 22 1 c2 1 2d 0 | ||
109 | 1 1 22 1 c2 1 2d 0 | ||
110 | 1 1 22 1 c2 1 2d 0 | ||
111 | 1 1 22 1 c2 1 2d 0 | ||
112 | |||
113 | 1 1 22 1 c2 1 2d 0 | ||
114 | 1 1 22 1 c2 1 2d 0 | ||
115 | 1 1 22 1 c2 1 2d 0 | ||
116 | 1 1 22 1 c2 1 2d 0 | ||
117 | 1 1 22 1 c2 1 2d 0 | ||
118 | 1 1 22 1 c2 1 2d 0 | ||
119 | 1 1 22 1 c2 1 2d 0 | ||
120 | 1 1 22 1 c2 1 2d 0 | ||
121 | 1 1 22 1 c2 1 2d 0 | ||
122 | 1 1 22 1 c2 1 2d 0 | ||
123 | |||
124 | 1 1 22 1 c2 1 2d 0 | ||
125 | 1 1 22 1 c2 1 2d 0 | ||
126 | 1 1 22 1 c2 1 2d 0 | ||
127 | 1 1 22 1 c2 1 2d 0 | ||
128 | 1 1 22 1 c2 1 2d 0 | ||
129 | 1 1 22 1 c2 1 2d 0 | ||
130 | 1 1 22 1 c2 1 2d 0 | ||
131 | 1 1 22 1 c2 1 2d 0 | ||
132 | 1 1 22 1 c2 1 2d 0 | ||
133 | 1 1 22 1 c2 1 2d 0 | ||
134 | |||
135 | 1 1 22 1 c2 1 2d 0 | ||
136 | 1 1 22 1 c2 1 2d 0 | ||
137 | 1 1 22 1 c2 1 2d 0 | ||
138 | 1 1 22 1 c2 1 2d 0 | ||
139 | 1 1 22 1 c2 1 2d 0 | ||
140 | 1 1 22 1 c2 1 2d 0 | ||
141 | 1 1 22 1 c2 1 2d 0 | ||
142 | 1 1 22 1 c2 1 2d 0 | ||
143 | 1 1 22 1 c2 1 2d 0 | ||
144 | 1 1 22 1 c2 1 2d 0 | ||
145 | |||
146 | 1 1 22 1 c2 1 2d 0 | ||
147 | 1 1 22 1 c2 1 2d 0 | ||
148 | 1 1 22 1 c2 1 2d 0 | ||
149 | 1 1 22 1 c2 1 2d 0 | ||
150 | 1 1 22 1 c2 1 2d 0 | ||
151 | 1 1 22 1 c2 1 2d 0 | ||
152 | 1 1 22 1 c2 1 2d 0 | ||
153 | 1 1 22 1 c2 1 2d 0 | ||
154 | 1 1 22 1 c2 1 2d 0 | ||
155 | 1 1 22 1 c2 1 2d 0 | ||
156 | |||
157 | 1 1 22 1 c2 1 2d 0 | ||
158 | 1 1 22 1 c2 1 2d 0 | ||
159 | 1 1 22 1 c2 1 2d 0 | ||
160 | 1 1 22 1 c2 1 2d 0 | ||
161 | 1 1 22 1 c2 1 2d 0 | ||
162 | 1 1 22 1 c2 1 2d 0 | ||
163 | 1 1 22 1 c2 1 2d 0 | ||
164 | 1 1 22 1 c2 1 2d 0 | ||
165 | 1 1 22 1 c2 1 2d 0 | ||
166 | 1 1 22 1 c2 1 2d 0 | ||
167 | |||
168 | 1 1 22 1 c2 1 2d 0 | ||
169 | 1 1 22 1 c2 1 2d 0 | ||
170 | 1 1 22 1 c2 1 2d 0 | ||
171 | 1 1 22 1 c2 1 2d 0 | ||
172 | 1 1 22 1 c2 1 2d 0 | ||
173 | 1 1 22 1 c2 1 2d 0 | ||
174 | 1 1 22 1 c2 1 2d 0 | ||
175 | 1 1 22 1 c2 1 2d 0 | ||
176 | 1 1 22 1 c2 1 2d 0 | ||
177 | 1 1 22 1 c2 1 2d 0 | ||
178 | |||
179 | 1 1 22 1 c2 1 2d 0 | ||
180 | 1 1 22 1 c2 1 2d 0 | ||
181 | 1 1 22 1 c2 1 2d 0 | ||
182 | 1 1 22 1 c2 1 2d 0 | ||
183 | 1 1 22 1 c2 1 2d 0 | ||
184 | 1 1 22 1 c2 1 2d 0 | ||
185 | 1 1 22 1 c2 1 2d 0 | ||
186 | 1 1 22 1 c2 1 2d 0 | ||
187 | 1 1 22 1 c2 1 2d 0 | ||
188 | 1 1 22 1 c2 1 2d 0 | ||
189 | |||
190 | 1 1 22 1 c2 1 2d 0 | ||
191 | 1 1 22 1 c2 1 2d 0 | ||
192 | 1 1 22 1 c2 1 2d 0 | ||
193 | 1 1 22 1 c2 1 2d 0 | ||
194 | 1 1 22 1 c2 1 2d 0 | ||
195 | 1 1 22 1 c2 1 2d 0 | ||
196 | 1 1 22 1 c2 1 2d 0 | ||
197 | 1 1 22 1 c2 1 2d 0 | ||
198 | 1 1 22 1 c2 1 2d 0 | ||
199 | 1 1 22 1 c2 1 2d 0 | ||
200 | |||
201 | |||
diff --git a/dis/original/inputs/Field/in7 b/dis/original/inputs/Field/in7 deleted file mode 100644 index 0d6ef06..0000000 --- a/dis/original/inputs/Field/in7 +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | 16777216 -1 200 160 | ||
2 | |||
3 | 1 1 22 1 c2 1 2d 0 | ||
4 | 1 1 22 1 c2 1 2d 0 | ||
5 | 1 1 22 1 c2 1 2d 0 | ||
6 | 1 1 22 1 c2 1 2d 0 | ||
7 | 1 1 22 1 c2 1 2d 0 | ||
8 | 1 1 22 1 c2 1 2d 0 | ||
9 | 1 1 22 1 c2 1 2d 0 | ||
10 | 1 1 22 1 c2 1 2d 0 | ||
11 | 1 1 22 1 c2 1 2d 0 | ||
12 | 1 1 22 1 c2 1 2d 0 | ||
13 | |||
14 | 1 1 22 1 c2 1 2d 0 | ||
15 | 1 1 22 1 c2 1 2d 0 | ||
16 | 1 1 22 1 c2 1 2d 0 | ||
17 | 1 1 22 1 c2 1 2d 0 | ||
18 | 1 1 22 1 c2 1 2d 0 | ||
19 | 1 1 22 1 c2 1 2d 0 | ||
20 | 1 1 22 1 c2 1 2d 0 | ||
21 | 1 1 22 1 c2 1 2d 0 | ||
22 | 1 1 22 1 c2 1 2d 0 | ||
23 | 1 1 22 1 c2 1 2d 0 | ||
24 | |||
25 | 1 1 22 1 c2 1 2d 0 | ||
26 | 1 1 22 1 c2 1 2d 0 | ||
27 | 1 1 22 1 c2 1 2d 0 | ||
28 | 1 1 22 1 c2 1 2d 0 | ||
29 | 1 1 22 1 c2 1 2d 0 | ||
30 | 1 1 22 1 c2 1 2d 0 | ||
31 | 1 1 22 1 c2 1 2d 0 | ||
32 | 1 1 22 1 c2 1 2d 0 | ||
33 | 1 1 22 1 c2 1 2d 0 | ||
34 | 1 1 22 1 c2 1 2d 0 | ||
35 | |||
36 | 1 1 22 1 c2 1 2d 0 | ||
37 | 1 1 22 1 c2 1 2d 0 | ||
38 | 1 1 22 1 c2 1 2d 0 | ||
39 | 1 1 22 1 c2 1 2d 0 | ||
40 | 1 1 22 1 c2 1 2d 0 | ||
41 | 1 1 22 1 c2 1 2d 0 | ||
42 | 1 1 22 1 c2 1 2d 0 | ||
43 | 1 1 22 1 c2 1 2d 0 | ||
44 | 1 1 22 1 c2 1 2d 0 | ||
45 | 1 1 22 1 c2 1 2d 0 | ||
46 | |||
47 | 1 1 22 1 c2 1 2d 0 | ||
48 | 1 1 22 1 c2 1 2d 0 | ||
49 | 1 1 22 1 c2 1 2d 0 | ||
50 | 1 1 22 1 c2 1 2d 0 | ||
51 | 1 1 22 1 c2 1 2d 0 | ||
52 | 1 1 22 1 c2 1 2d 0 | ||
53 | 1 1 22 1 c2 1 2d 0 | ||
54 | 1 1 22 1 c2 1 2d 0 | ||
55 | 1 1 22 1 c2 1 2d 0 | ||
56 | 1 1 22 1 c2 1 2d 0 | ||
57 | |||
58 | 1 1 22 1 c2 1 2d 0 | ||
59 | 1 1 22 1 c2 1 2d 0 | ||
60 | 1 1 22 1 c2 1 2d 0 | ||
61 | 1 1 22 1 c2 1 2d 0 | ||
62 | 1 1 22 1 c2 1 2d 0 | ||
63 | 1 1 22 1 c2 1 2d 0 | ||
64 | 1 1 22 1 c2 1 2d 0 | ||
65 | 1 1 22 1 c2 1 2d 0 | ||
66 | 1 1 22 1 c2 1 2d 0 | ||
67 | |||
68 | 1 1 22 1 c2 1 2d 0 | ||
69 | 1 1 22 1 c2 1 2d 0 | ||
70 | 1 1 22 1 c2 1 2d 0 | ||
71 | 1 1 22 1 c2 1 2d 0 | ||
72 | 1 1 22 1 c2 1 2d 0 | ||
73 | 1 1 22 1 c2 1 2d 0 | ||
74 | 1 1 22 1 c2 1 2d 0 | ||
75 | 1 1 22 1 c2 1 2d 0 | ||
76 | 1 1 22 1 c2 1 2d 0 | ||
77 | 1 1 22 1 c2 1 2d 0 | ||
78 | |||
79 | 1 1 22 1 c2 1 2d 0 | ||
80 | 1 1 22 1 c2 1 2d 0 | ||
81 | 1 1 22 1 c2 1 2d 0 | ||
82 | 1 1 22 1 c2 1 2d 0 | ||
83 | 1 1 22 1 c2 1 2d 0 | ||
84 | 1 1 22 1 c2 1 2d 0 | ||
85 | 1 1 22 1 c2 1 2d 0 | ||
86 | 1 1 22 1 c2 1 2d 0 | ||
87 | 1 1 22 1 c2 1 2d 0 | ||
88 | 1 1 22 1 c2 1 2d 0 | ||
89 | |||
90 | 1 1 22 1 c2 1 2d 0 | ||
91 | 1 1 22 1 c2 1 2d 0 | ||
92 | 1 1 22 1 c2 1 2d 0 | ||
93 | 1 1 22 1 c2 1 2d 0 | ||
94 | 1 1 22 1 c2 1 2d 0 | ||
95 | 1 1 22 1 c2 1 2d 0 | ||
96 | 1 1 22 1 c2 1 2d 0 | ||
97 | 1 1 22 1 c2 1 2d 0 | ||
98 | 1 1 22 1 c2 1 2d 0 | ||
99 | 1 1 22 1 c2 1 2d 0 | ||
100 | |||
101 | 1 1 22 1 c2 1 2d 0 | ||
102 | 1 1 22 1 c2 1 2d 0 | ||
103 | 1 1 22 1 c2 1 2d 0 | ||
104 | 1 1 22 1 c2 1 2d 0 | ||
105 | 1 1 22 1 c2 1 2d 0 | ||
106 | 1 1 22 1 c2 1 2d 0 | ||
107 | 1 1 22 1 c2 1 2d 0 | ||
108 | 1 1 22 1 c2 1 2d 0 | ||
109 | 1 1 22 1 c2 1 2d 0 | ||
110 | |||
111 | 1 1 22 1 c2 1 2d 0 | ||
112 | 1 1 22 1 c2 1 2d 0 | ||
113 | 1 1 22 1 c2 1 2d 0 | ||
114 | 1 1 22 1 c2 1 2d 0 | ||
115 | 1 1 22 1 c2 1 2d 0 | ||
116 | 1 1 22 1 c2 1 2d 0 | ||
117 | 1 1 22 1 c2 1 2d 0 | ||
118 | 1 1 22 1 c2 1 2d 0 | ||
119 | 1 1 22 1 c2 1 2d 0 | ||
120 | 1 1 22 1 c2 1 2d 0 | ||
121 | |||
122 | 1 1 22 1 c2 1 2d 0 | ||
123 | 1 1 22 1 c2 1 2d 0 | ||
124 | 1 1 22 1 c2 1 2d 0 | ||
125 | 1 1 22 1 c2 1 2d 0 | ||
126 | 1 1 22 1 c2 1 2d 0 | ||
127 | 1 1 22 1 c2 1 2d 0 | ||
128 | 1 1 22 1 c2 1 2d 0 | ||
129 | 1 1 22 1 c2 1 2d 0 | ||
130 | 1 1 22 1 c2 1 2d 0 | ||
131 | 1 1 22 1 c2 1 2d 0 | ||
132 | |||
133 | 1 1 22 1 c2 1 2d 0 | ||
134 | 1 1 22 1 c2 1 2d 0 | ||
135 | 1 1 22 1 c2 1 2d 0 | ||
136 | 1 1 22 1 c2 1 2d 0 | ||
137 | 1 1 22 1 c2 1 2d 0 | ||
138 | 1 1 22 1 c2 1 2d 0 | ||
139 | 1 1 22 1 c2 1 2d 0 | ||
140 | 1 1 22 1 c2 1 2d 0 | ||
141 | 1 1 22 1 c2 1 2d 0 | ||
142 | 1 1 22 1 c2 1 2d 0 | ||
143 | |||
144 | 1 1 22 1 c2 1 2d 0 | ||
145 | 1 1 22 1 c2 1 2d 0 | ||
146 | 1 1 22 1 c2 1 2d 0 | ||
147 | 1 1 22 1 c2 1 2d 0 | ||
148 | 1 1 22 1 c2 1 2d 0 | ||
149 | 1 1 22 1 c2 1 2d 0 | ||
150 | 1 1 22 1 c2 1 2d 0 | ||
151 | 1 1 22 1 c2 1 2d 0 | ||
152 | 1 1 22 1 c2 1 2d 0 | ||
153 | 1 1 22 1 c2 1 2d 0 | ||
154 | |||
155 | 1 1 22 1 c2 1 2d 0 | ||
156 | 1 1 22 1 c2 1 2d 0 | ||
157 | 1 1 22 1 c2 1 2d 0 | ||
158 | 1 1 22 1 c2 1 2d 0 | ||
159 | 1 1 22 1 c2 1 2d 0 | ||
160 | 1 1 22 1 c2 1 2d 0 | ||
161 | 1 1 22 1 c2 1 2d 0 | ||
162 | 1 1 22 1 c2 1 2d 0 | ||
163 | 1 1 22 1 c2 1 2d 0 | ||
164 | 1 1 22 1 c2 1 2d 0 | ||
165 | |||
166 | 1 1 22 1 c2 1 2d 0 | ||
167 | 1 1 22 1 c2 1 2d 0 | ||
168 | 1 1 22 1 c2 1 2d 0 | ||
169 | 1 1 22 1 c2 1 2d 0 | ||
170 | 1 1 22 1 c2 1 2d 0 | ||
171 | 1 1 22 1 c2 1 2d 0 | ||
172 | 1 1 22 1 c2 1 2d 0 | ||
173 | 1 1 22 1 c2 1 2d 0 | ||
174 | 1 1 22 1 c2 1 2d 0 | ||
175 | 1 1 22 1 c2 1 2d 0 | ||
176 | |||
177 | 1 1 22 1 c2 1 2d 0 | ||
178 | 1 1 22 1 c2 1 2d 0 | ||
179 | 1 1 22 1 c2 1 2d 0 | ||
180 | 1 1 22 1 c2 1 2d 0 | ||
181 | 1 1 22 1 c2 1 2d 0 | ||
182 | 1 1 22 1 c2 1 2d 0 | ||
183 | 1 1 22 1 c2 1 2d 0 | ||
184 | 1 1 22 1 c2 1 2d 0 | ||
185 | 1 1 22 1 c2 1 2d 0 | ||
186 | 1 1 22 1 c2 1 2d 0 | ||
187 | |||
188 | 1 1 22 1 c2 1 2d 0 | ||
189 | 1 1 22 1 c2 1 2d 0 | ||
190 | 1 1 22 1 c2 1 2d 0 | ||
191 | 1 1 22 1 c2 1 2d 0 | ||
192 | 1 1 22 1 c2 1 2d 0 | ||
193 | 1 1 22 1 c2 1 2d 0 | ||
194 | 1 1 22 1 c2 1 2d 0 | ||
195 | 1 1 22 1 c2 1 2d 0 | ||
196 | 1 1 22 1 c2 1 2d 0 | ||
197 | |||
diff --git a/dis/original/inputs/Matrix/in1 b/dis/original/inputs/Matrix/in1 deleted file mode 100644 index 0b15e16..0000000 --- a/dis/original/inputs/Matrix/in1 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 2500 20000 65535 0.002734 | ||
diff --git a/dis/original/inputs/Matrix/in2 b/dis/original/inputs/Matrix/in2 deleted file mode 100644 index f4a484b..0000000 --- a/dis/original/inputs/Matrix/in2 +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | -2 2000 40000 65535 0.000031 | ||
2 | |||
3 | |||
diff --git a/dis/original/inputs/Matrix/in3 b/dis/original/inputs/Matrix/in3 deleted file mode 100644 index c893b2b..0000000 --- a/dis/original/inputs/Matrix/in3 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 2500 100000 65535 0.002734 | ||
diff --git a/dis/original/inputs/Matrix/in4 b/dis/original/inputs/Matrix/in4 deleted file mode 100644 index 629a026..0000000 --- a/dis/original/inputs/Matrix/in4 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 2500 100000 65535 0.000031 | ||
diff --git a/dis/original/inputs/Matrix/in5 b/dis/original/inputs/Matrix/in5 deleted file mode 100644 index c769c74..0000000 --- a/dis/original/inputs/Matrix/in5 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 2500 1000000 65535 0.000031 | ||
diff --git a/dis/original/inputs/Matrix/in6 b/dis/original/inputs/Matrix/in6 deleted file mode 100644 index 7fd0a85..0000000 --- a/dis/original/inputs/Matrix/in6 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 3000 1000000 65535 0.000031 | ||
diff --git a/dis/original/inputs/Matrix/in7 b/dis/original/inputs/Matrix/in7 deleted file mode 100644 index ff9c6f0..0000000 --- a/dis/original/inputs/Matrix/in7 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | -2 4000 1000000 65535 0.000031 | ||
diff --git a/dis/original/inputs/Neighborhood/in1 b/dis/original/inputs/Neighborhood/in1 deleted file mode 100644 index b34be8e..0000000 --- a/dis/original/inputs/Neighborhood/in1 +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | -2 8 15001 20000 10 10000 1000 10000 | ||
2 | |||
diff --git a/dis/original/inputs/Neighborhood/in2 b/dis/original/inputs/Neighborhood/in2 deleted file mode 100644 index e8ed879..0000000 --- a/dis/original/inputs/Neighborhood/in2 +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | -2 15 15001 20000 10 10000 1000 10000 | ||
2 | |||
diff --git a/dis/original/inputs/Neighborhood/in3 b/dis/original/inputs/Neighborhood/in3 deleted file mode 100644 index a8d21bc..0000000 --- a/dis/original/inputs/Neighborhood/in3 +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | -2 15 15001 60000 10 10000 10 10000 | ||
2 | |||
diff --git a/dis/original/inputs/Neighborhood/in4 b/dis/original/inputs/Neighborhood/in4 deleted file mode 100644 index 7b11c15..0000000 --- a/dis/original/inputs/Neighborhood/in4 +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | -2 15 15001 40000 10 10000 1000 10000 | ||
2 | |||
diff --git a/dis/original/inputs/Neighborhood/in5 b/dis/original/inputs/Neighborhood/in5 deleted file mode 100644 index 4cedaff..0000000 --- a/dis/original/inputs/Neighborhood/in5 +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | -2 15 15001 65000 10 10000 1000 10000 | ||
2 | |||
diff --git a/dis/original/inputs/Pointer/in1 b/dis/original/inputs/Pointer/in1 deleted file mode 100644 index 7ffa873..0000000 --- a/dis/original/inputs/Pointer/in1 +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | 10485770 15 51200000 -2 10 | ||
2 | |||
3 | 10 10485760 10485760 | ||
4 | 10 10485760 10485760 | ||
5 | 10 10485760 10485760 | ||
6 | 10 10485760 10485760 | ||
7 | 10 10485760 10485760 | ||
8 | 10 10485760 10485760 | ||
9 | 10 10485760 10485760 | ||
10 | 10 10485760 10485760 | ||
11 | 10 10485760 10485760 | ||
12 | 10 10485760 10485760 | ||
13 | |||
diff --git a/dis/original/inputs/Pointer/in10 b/dis/original/inputs/Pointer/in10 deleted file mode 100644 index ace0ed3..0000000 --- a/dis/original/inputs/Pointer/in10 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 16777216 15 4024000000 -2 10 | ||
2 | |||
3 | 10 16777215 16777215 | ||
4 | 10 16777215 16777215 | ||
5 | 10 16777215 16777215 | ||
6 | 10 16777215 16777215 | ||
7 | 10 16777215 16777215 | ||
8 | 10 16777215 16777215 | ||
9 | 10 16777215 16777215 | ||
10 | 10 16777215 16777215 | ||
11 | 10 16777215 16777215 | ||
12 | 10 16777215 16777215 | ||
diff --git a/dis/original/inputs/Pointer/in2 b/dis/original/inputs/Pointer/in2 deleted file mode 100644 index 1dc0ad2..0000000 --- a/dis/original/inputs/Pointer/in2 +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | 16777215 15 10240000 -2 4 | ||
2 | |||
3 | 10 16777214 16777214 | ||
4 | 10 16777214 16777214 | ||
5 | 10 16777214 16777214 | ||
6 | 10 16777214 16777214 | ||
7 | |||
8 | |||
diff --git a/dis/original/inputs/Pointer/in3 b/dis/original/inputs/Pointer/in3 deleted file mode 100644 index b2000fb..0000000 --- a/dis/original/inputs/Pointer/in3 +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | 1048577 15 51200000 -2 1 | ||
2 | |||
3 | 10 1048576 1048576 | ||
4 | |||
5 | |||
diff --git a/dis/original/inputs/Pointer/in4 b/dis/original/inputs/Pointer/in4 deleted file mode 100644 index 45a8944..0000000 --- a/dis/original/inputs/Pointer/in4 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 1048577 15 10240000 -2 10 | ||
2 | |||
3 | 10 1048576 1048576 | ||
4 | 10 1048576 1048576 | ||
5 | 10 1048576 1048576 | ||
6 | 10 1048576 1048576 | ||
7 | 10 1048576 1048576 | ||
8 | 10 1048576 1048576 | ||
9 | 10 1048576 1048576 | ||
10 | 10 1048576 1048576 | ||
11 | 10 1048576 1048576 | ||
12 | 10 1048576 1048576 | ||
diff --git a/dis/original/inputs/Pointer/in5 b/dis/original/inputs/Pointer/in5 deleted file mode 100644 index 24585f2..0000000 --- a/dis/original/inputs/Pointer/in5 +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | 16777215 15 51200000 -2 4 | ||
2 | |||
3 | 10 16777214 16777214 | ||
4 | 10 16777214 16777214 | ||
5 | 10 16777214 16777214 | ||
6 | 10 16777214 16777214 | ||
7 | |||
8 | |||
diff --git a/dis/original/inputs/Pointer/in6 b/dis/original/inputs/Pointer/in6 deleted file mode 100644 index 819a79c..0000000 --- a/dis/original/inputs/Pointer/in6 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 1048577 15 51200000 -2 10 | ||
2 | |||
3 | 10 1048576 1048576 | ||
4 | 10 1048576 1048576 | ||
5 | 10 1048576 1048576 | ||
6 | 10 1048576 1048576 | ||
7 | 10 1048576 1048576 | ||
8 | 10 1048576 1048576 | ||
9 | 10 1048576 1048576 | ||
10 | 10 1048576 1048576 | ||
11 | 10 1048576 1048576 | ||
12 | 10 1048576 1048576 | ||
diff --git a/dis/original/inputs/Pointer/in7 b/dis/original/inputs/Pointer/in7 deleted file mode 100644 index c290633..0000000 --- a/dis/original/inputs/Pointer/in7 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 2108576 15 51200000 -2 10 | ||
2 | |||
3 | 10 2108575 2108575 | ||
4 | 10 2108575 2108575 | ||
5 | 10 2108575 2108575 | ||
6 | 10 2108575 2108575 | ||
7 | 10 2108575 2108575 | ||
8 | 10 2108575 2108575 | ||
9 | 10 2108575 2108575 | ||
10 | 10 2108575 2108575 | ||
11 | 10 2108575 2108575 | ||
12 | 10 2108575 2108575 | ||
diff --git a/dis/original/inputs/Pointer/in8 b/dis/original/inputs/Pointer/in8 deleted file mode 100644 index f25d6e6..0000000 --- a/dis/original/inputs/Pointer/in8 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 16777216 15 51200000 -2 10 | ||
2 | |||
3 | 10 16485760 16485760 | ||
4 | 10 16485760 16485760 | ||
5 | 10 16485760 16485760 | ||
6 | 10 16485760 16485760 | ||
7 | 10 16485760 16485760 | ||
8 | 10 16485760 16485760 | ||
9 | 10 16485760 16485760 | ||
10 | 10 16485760 16485760 | ||
11 | 10 16485760 16485760 | ||
12 | 10 16485760 16485760 | ||
diff --git a/dis/original/inputs/Pointer/in9 b/dis/original/inputs/Pointer/in9 deleted file mode 100644 index d51cd22..0000000 --- a/dis/original/inputs/Pointer/in9 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 16485771 15 51200000 -2 10 | ||
2 | |||
3 | 10 16485760 16485760 | ||
4 | 10 16485760 16485760 | ||
5 | 10 16485760 16485760 | ||
6 | 10 16485760 16485760 | ||
7 | 10 16485760 16485760 | ||
8 | 10 16485760 16485760 | ||
9 | 10 16485760 16485760 | ||
10 | 10 16485760 16485760 | ||
11 | 10 16485760 16485760 | ||
12 | 10 16485760 16485760 | ||
diff --git a/dis/original/inputs/Transitive/in1 b/dis/original/inputs/Transitive/in1 deleted file mode 100644 index aed634e..0000000 --- a/dis/original/inputs/Transitive/in1 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 800 5000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in2 b/dis/original/inputs/Transitive/in2 deleted file mode 100644 index 163072d..0000000 --- a/dis/original/inputs/Transitive/in2 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 800 500000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in3 b/dis/original/inputs/Transitive/in3 deleted file mode 100644 index fa5aecf..0000000 --- a/dis/original/inputs/Transitive/in3 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1000 5000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in4 b/dis/original/inputs/Transitive/in4 deleted file mode 100644 index 02b3317..0000000 --- a/dis/original/inputs/Transitive/in4 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1000 500000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in5 b/dis/original/inputs/Transitive/in5 deleted file mode 100644 index f109f00..0000000 --- a/dis/original/inputs/Transitive/in5 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1000 990000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in6 b/dis/original/inputs/Transitive/in6 deleted file mode 100644 index ff64c1f..0000000 --- a/dis/original/inputs/Transitive/in6 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1250 5000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in7 b/dis/original/inputs/Transitive/in7 deleted file mode 100644 index d1b5c2f..0000000 --- a/dis/original/inputs/Transitive/in7 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1250 500000 -2 | ||
diff --git a/dis/original/inputs/Transitive/in8 b/dis/original/inputs/Transitive/in8 deleted file mode 100644 index 8ac5dfd..0000000 --- a/dis/original/inputs/Transitive/in8 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1250 900000 -2 | ||
diff --git a/dis/original/inputs/Update/in1 b/dis/original/inputs/Update/in1 deleted file mode 100644 index f74d826..0000000 --- a/dis/original/inputs/Update/in1 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 1048577 15 102400000 -2 10 1048576 1048576 | ||
diff --git a/dis/original/inputs/Update/in2 b/dis/original/inputs/Update/in2 deleted file mode 100644 index a95cdab..0000000 --- a/dis/original/inputs/Update/in2 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 10485770 15 51200000 -2 10 10485760 10485760 | ||
diff --git a/dis/original/inputs/Update/in3 b/dis/original/inputs/Update/in3 deleted file mode 100644 index b5ec6d8..0000000 --- a/dis/original/inputs/Update/in3 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 102400000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/Update/in4 b/dis/original/inputs/Update/in4 deleted file mode 100644 index 873bb3a..0000000 --- a/dis/original/inputs/Update/in4 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 204800000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/Update/in5 b/dis/original/inputs/Update/in5 deleted file mode 100644 index b4011f0..0000000 --- a/dis/original/inputs/Update/in5 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 409600000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/Update/in6 b/dis/original/inputs/Update/in6 deleted file mode 100644 index bcde4af..0000000 --- a/dis/original/inputs/Update/in6 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 1000000000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/Update/in7 b/dis/original/inputs/Update/in7 deleted file mode 100644 index debcc36..0000000 --- a/dis/original/inputs/Update/in7 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 2000000000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/Update/in8 b/dis/original/inputs/Update/in8 deleted file mode 100644 index d074207..0000000 --- a/dis/original/inputs/Update/in8 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 16777215 15 4000000000 -2 10 16777214 16777214 | ||
diff --git a/dis/original/inputs/WSSS b/dis/original/inputs/WSSS deleted file mode 100644 index 8836023..0000000 --- a/dis/original/inputs/WSSS +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | 16384 | ||
2 | 32768 | ||
3 | 65536 | ||
4 | 131072 | ||
5 | 262144 | ||
6 | 524288 | ||
7 | 1048576 | ||
8 | 2097152 | ||
9 | 4194304 | ||
10 | 8388608 | ||
11 | 16777216 | ||
12 | 33554432 | ||
diff --git a/dis/original/inputs/WSSS_maxstride4mb b/dis/original/inputs/WSSS_maxstride4mb deleted file mode 100644 index f402c01..0000000 --- a/dis/original/inputs/WSSS_maxstride4mb +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | 16384 | ||
2 | 32768 | ||
3 | 65536 | ||
4 | 131072 | ||
5 | 262144 | ||
6 | 524288 | ||
7 | 1048576 | ||
8 | 2097152 | ||
9 | 4194304 | ||
10 | 8388608 | ||
11 | 12582912 | ||
12 | 16777216 | ||
13 | 20971520 | ||
14 | 25165824 | ||
15 | 29360120 | ||
16 | 33554432 | ||
diff --git a/dis/original/inputs/caches b/dis/original/inputs/caches deleted file mode 100644 index f2293da..0000000 --- a/dis/original/inputs/caches +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | L3:0=0000;1=0000;2=0000;3=0000 | ||
2 | L3:0=0000;1=0000;2=0000;3=0001 | ||
3 | L3:0=0000;1=0000;2=0000;3=0003 | ||
4 | L3:0=0000;1=0000;2=0000;3=0007 | ||
5 | L3:0=0000;1=0000;2=0000;3=000f | ||
6 | L3:0=0000;1=0000;2=0000;3=00ff | ||
7 | L3:0=0000;1=0000;2=0000;3=ffff | ||
diff --git a/dis/original/inputs/caches_maxstride2ways b/dis/original/inputs/caches_maxstride2ways deleted file mode 100644 index d5346b1..0000000 --- a/dis/original/inputs/caches_maxstride2ways +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | L3:0=0000;1=0000;2=0000;3=0000 | ||
2 | L3:0=0000;1=0000;2=0000;3=0001 | ||
3 | L3:0=0000;1=0000;2=0000;3=0003 | ||
4 | L3:0=0000;1=0000;2=0000;3=0007 | ||
5 | L3:0=0000;1=0000;2=0000;3=000f | ||
6 | L3:0=0000;1=0000;2=0000;3=003f | ||
7 | L3:0=0000;1=0000;2=0000;3=00ff | ||
8 | L3:0=0000;1=0000;2=0000;3=03ff | ||
9 | L3:0=0000;1=0000;2=0000;3=0fff | ||
10 | L3:0=0000;1=0000;2=0000;3=3fff | ||
11 | L3:0=0000;1=0000;2=0000;3=ffff | ||
diff --git a/dis/original/inputs/random_walk/in1 b/dis/original/inputs/random_walk/in1 deleted file mode 100644 index a50f416..0000000 --- a/dis/original/inputs/random_walk/in1 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 0 5 0 | ||
diff --git a/dis/original/postproc.sh b/dis/original/postproc.sh deleted file mode 100755 index c5dd1c9..0000000 --- a/dis/original/postproc.sh +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | ./summarize.py $1.txt > $1-pp.txt | ||
3 | ./clean.sh $1-pp.txt | ||
diff --git a/dis/original/random_walk.c b/dis/original/random_walk.c deleted file mode 100644 index 9f907bb..0000000 --- a/dis/original/random_walk.c +++ /dev/null | |||
@@ -1,550 +0,0 @@ | |||
1 | #include <sys/time.h> | ||
2 | #include <sys/mman.h> | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <stdlib.h> | ||
6 | #include <unistd.h> | ||
7 | #include <time.h> | ||
8 | #include <string.h> | ||
9 | #include <inttypes.h> | ||
10 | #include <assert.h> | ||
11 | #include <limits.h> | ||
12 | #include <fcntl.h> | ||
13 | #include <errno.h> | ||
14 | /* | ||
15 | #include "litmus.h" | ||
16 | #include "common.h" | ||
17 | */ | ||
18 | /* CPU time consumed so far in seconds */ | ||
19 | double cputime(void) | ||
20 | { | ||
21 | struct timespec ts; | ||
22 | int err; | ||
23 | err = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); | ||
24 | if (err != 0) | ||
25 | perror("clock_gettime"); | ||
26 | return (ts.tv_sec + 1E-9 * ts.tv_nsec); | ||
27 | } | ||
28 | |||
29 | /* wall-clock time in seconds */ | ||
30 | double wctime(void) | ||
31 | { | ||
32 | struct timeval tv; | ||
33 | gettimeofday(&tv, NULL); | ||
34 | return (tv.tv_sec + 1E-6 * tv.tv_usec); | ||
35 | } | ||
36 | |||
37 | void bail_out(const char* msg) | ||
38 | { | ||
39 | perror(msg); | ||
40 | exit(-1 * errno); | ||
41 | } | ||
42 | |||
43 | #include "extra.h" | ||
44 | |||
45 | #define PAGE_SIZE (4096) | ||
46 | #define CACHELINE_SIZE 64 | ||
47 | #define INTS_IN_CACHELINE (CACHELINE_SIZE/sizeof(int)) | ||
48 | #define CACHELINES_IN_1KB (1024 / sizeof(cacheline_t)) | ||
49 | #define INTS_IN_1KB (1024 / sizeof(int)) | ||
50 | |||
51 | typedef struct cacheline | ||
52 | { | ||
53 | int line[INTS_IN_CACHELINE]; | ||
54 | } __attribute__((aligned(CACHELINE_SIZE))) cacheline_t; | ||
55 | |||
56 | static volatile cacheline_t* arena = NULL; | ||
57 | |||
58 | #define UNCACHE_DEV "/dev/litmus/uncache" | ||
59 | #define FAKE_DEV "/dev/litmus/fakedev0" | ||
60 | |||
61 | static cacheline_t* alloc_arena(size_t size, int use_huge_pages, int use_uncache_pages) | ||
62 | { | ||
63 | int flags = MAP_PRIVATE | MAP_POPULATE; | ||
64 | cacheline_t* arena = NULL; | ||
65 | int fd; | ||
66 | |||
67 | if(use_huge_pages) | ||
68 | flags |= MAP_HUGETLB; | ||
69 | |||
70 | if(use_uncache_pages == 1) { | ||
71 | fd = open(UNCACHE_DEV, O_RDWR|O_SYNC); | ||
72 | if (fd == -1) | ||
73 | bail_out("Failed to open uncache device. Are you running the LITMUS^RT kernel?"); | ||
74 | } else if (use_uncache_pages == 2) { | ||
75 | fd = open(FAKE_DEV, O_RDWR|O_SYNC); | ||
76 | if (fd == -1) | ||
77 | bail_out("Failed to open fake device. Are you running the LITMUS^RT kernel?"); | ||
78 | } else { | ||
79 | fd = -1; | ||
80 | flags |= MAP_ANONYMOUS; | ||
81 | } | ||
82 | |||
83 | arena = (cacheline_t*)mmap(0, size, PROT_READ | PROT_WRITE, flags, fd, 0); | ||
84 | |||
85 | if(use_uncache_pages) | ||
86 | close(fd); | ||
87 | |||
88 | assert(arena); | ||
89 | |||
90 | return arena; | ||
91 | } | ||
92 | |||
93 | static void dealloc_arena(cacheline_t* arena, size_t size) | ||
94 | { | ||
95 | int ret = munmap((void*)arena, size); | ||
96 | if(ret != 0) | ||
97 | bail_out("munmap() error"); | ||
98 | } | ||
99 | |||
100 | static int randrange(int min, int max) | ||
101 | { | ||
102 | // Range is [min, max) | ||
103 | assert(max - min - 1 <= RAND_MAX); | ||
104 | return rand() % (max - min) + min; | ||
105 | //return (rand() % (max - min + 1)) + min; | ||
106 | /* generate a random number on the range [min, max) w/o skew */ | ||
107 | /*int limit = max - min; | ||
108 | int devisor = RAND_MAX/limit; | ||
109 | int retval; | ||
110 | |||
111 | do { | ||
112 | retval = rand() / devisor; | ||
113 | } while(retval == limit); | ||
114 | retval += min; | ||
115 | |||
116 | return retval;*/ | ||
117 | } | ||
118 | |||
119 | static void init_arena(volatile cacheline_t* arena, size_t size) | ||
120 | { | ||
121 | int i; | ||
122 | size_t num_arena_elem = size / sizeof(cacheline_t); | ||
123 | |||
124 | /* Generate a cycle among the cache lines using Sattolo's algorithm. | ||
125 | Every int in the cache line points to the same cache line. | ||
126 | Note: Sequential walk doesn't care about these values. */ | ||
127 | for (i = 0; i < num_arena_elem; i++) { | ||
128 | int j; | ||
129 | for(j = 0; j < INTS_IN_CACHELINE; j++) | ||
130 | arena[i].line[j] = i; | ||
131 | arena[i].line[1] = 0; | ||
132 | } | ||
133 | /*while(1 < i--) { | ||
134 | int j = randrange(0, i); | ||
135 | cacheline_t temp = arena[j]; | ||
136 | arena[j] = arena[i]; | ||
137 | arena[i] = temp; | ||
138 | }*/ | ||
139 | for (int j = 0; j < num_arena_elem-1; j++) { | ||
140 | int k = randrange(j+1, num_arena_elem); | ||
141 | cacheline_t temp = arena[j]; | ||
142 | arena[j] = arena[k]; | ||
143 | arena[k] = temp; | ||
144 | } | ||
145 | } | ||
146 | |||
147 | /* Random walk around the arena in cacheline-sized chunks. | ||
148 | Cacheline-sized chucks ensures the same utilization of each | ||
149 | hit line as sequential read. (Otherwise, our utilization | ||
150 | would only be 1/INTS_IN_CACHELINE.) */ | ||
151 | static int random_walk(volatile cacheline_t *mem, int wss, int write_cycle) | ||
152 | { | ||
153 | /* a random cycle among the cache lines was set up by init_arena(). */ | ||
154 | int sum, i, next; | ||
155 | |||
156 | // Always do the same number of hops | ||
157 | int numlines = 33554432 / CACHELINE_SIZE;//wss * CACHELINES_IN_1KB; | ||
158 | |||
159 | sum = 0; | ||
160 | |||
161 | /* contents of arena is structured s.t. offsets are all | ||
162 | w.r.t. to start of arena, so compute the initial offset */ | ||
163 | next = mem - arena; | ||
164 | |||
165 | if (write_cycle == 0) { | ||
166 | for (i = 0; i < numlines; i++) { | ||
167 | next = arena[next].line[0]; | ||
168 | arena[next].line[1] = 1; // Record that we touched this line | ||
169 | sum += next; | ||
170 | for (int j = 2; j < INTS_IN_CACHELINE; j++) | ||
171 | arena[next].line[j]++; | ||
172 | } | ||
173 | } else { | ||
174 | int w, which_line; | ||
175 | for (i = 0, w = 0; i < numlines; i++) { | ||
176 | which_line = next; | ||
177 | next = arena[next].line[0]; | ||
178 | if((w % write_cycle) != (write_cycle - 1)) { // This is equivalent to 1 % 1 != 1 - 1 which is always false | ||
179 | sum += next; | ||
180 | } | ||
181 | else { | ||
182 | // I /think/ that this just writes back to the address it read from | ||
183 | arena[which_line].line[0] = next; | ||
184 | } | ||
185 | } | ||
186 | } | ||
187 | return sum; | ||
188 | } | ||
189 | |||
190 | volatile static cacheline_t* random_start(int wss) | ||
191 | { | ||
192 | return arena + randrange(0, ((wss * 1024)/sizeof(cacheline_t))); | ||
193 | } | ||
194 | /* | ||
195 | static int sequential_walk(cacheline_t *_mem, int wss, int write_cycle) | ||
196 | { | ||
197 | int sum = 0, i; | ||
198 | int* mem = (int*)_mem; // treat as raw buffer of ints | ||
199 | int num_ints = wss * INTS_IN_1KB; | ||
200 | |||
201 | if (write_cycle > 0) { | ||
202 | for (i = 0; i < num_ints; i++) { | ||
203 | if (i % write_cycle == (write_cycle - 1)) | ||
204 | mem[i]++; | ||
205 | else | ||
206 | sum += mem[i]; | ||
207 | } | ||
208 | } else { | ||
209 | // sequential access, pure read | ||
210 | for (i = 0; i < num_ints; i++) | ||
211 | sum += mem[i]; | ||
212 | } | ||
213 | return sum; | ||
214 | } | ||
215 | |||
216 | static cacheline_t* sequential_start(int wss) | ||
217 | { | ||
218 | static int pos = 0; | ||
219 | |||
220 | int num_cachelines = wss * CACHELINES_IN_1KB; | ||
221 | |||
222 | cacheline_t *mem; | ||
223 | |||
224 | * Don't allow re-use between allocations. | ||
225 | * At most half of the arena may be used | ||
226 | * at any one time. | ||
227 | * | ||
228 | if (num_cachelines * 2 > ((wss * 1024)/sizeof(cacheline_t))) | ||
229 | ;//bail_out("static memory arena too small"); | ||
230 | |||
231 | if (pos + num_cachelines > ((wss * 1024)/sizeof(cacheline_t))) { | ||
232 | // wrap to beginning | ||
233 | mem = arena; | ||
234 | pos = num_cachelines; | ||
235 | } else { | ||
236 | mem = arena + pos; | ||
237 | pos += num_cachelines; | ||
238 | } | ||
239 | |||
240 | return mem; | ||
241 | } | ||
242 | */ | ||
243 | static volatile int dont_optimize_me = 0; | ||
244 | |||
245 | #define RANDOM_WALK 1 | ||
246 | static int loop_once(int wss, int write) | ||
247 | { | ||
248 | volatile cacheline_t *mem; | ||
249 | int temp; | ||
250 | |||
251 | #ifdef RANDOM_WALK | ||
252 | mem = random_start(wss); | ||
253 | // printf("Using start offset %ld. Data here is %d. data size: %ld\n", mem-arena, mem->line[0], sizeof(mem->line[0])); | ||
254 | temp = random_walk(mem, wss, write); | ||
255 | #else | ||
256 | mem = sequential_start(wss); | ||
257 | temp = sequential_walk(mem, wss, write); | ||
258 | #endif | ||
259 | dont_optimize_me = temp; | ||
260 | // printf("%d", dont_optimize_me); | ||
261 | return dont_optimize_me; | ||
262 | } | ||
263 | |||
264 | int main(int argc, char** argv) { | ||
265 | SET_UP | ||
266 | int write; | ||
267 | long wss; | ||
268 | double duration; | ||
269 | double program_end; | ||
270 | // Reads in benchmark params from stdin | ||
271 | // <long: wss in bytes> <float: duration in seconds> <bool: if we should also write> | ||
272 | if (scanf("%ld %lf %d", &wss, &duration, &write) != 3) { | ||
273 | fprintf(stderr, "Bad input, please enter 3 parameters: <WSS (Int)> <Duration (Double)> <Write (Bool)>.\n"); | ||
274 | exit(1); | ||
275 | } | ||
276 | printf("random_walk: Using parameters: %ld, %lf, %d\n", wss, duration, write); | ||
277 | wss /= 1024; | ||
278 | program_end = duration + wctime(); | ||
279 | // Initialize memory | ||
280 | size_t arena_sz = wss*1024; | ||
281 | arena = alloc_arena(arena_sz*2, 0, 0); | ||
282 | init_arena(arena, arena_sz); | ||
283 | loop_once(wss, write); | ||
284 | // This loop contains the original content of job(int wss, int write, double exec_time, double program_end) | ||
285 | while (1) { | ||
286 | double emergency_exit = program_end + 1; | ||
287 | |||
288 | if (wctime() > program_end) { | ||
289 | break; | ||
290 | } else { | ||
291 | double last_loop = 0, loop_start; | ||
292 | int tmp = 0; | ||
293 | |||
294 | double start = cputime(); | ||
295 | double now = cputime(); | ||
296 | |||
297 | //while (now + last_loop < start) {// + exec_time) { | ||
298 | loop_start = now; | ||
299 | START_LOOP | ||
300 | tmp += loop_once(wss, write); | ||
301 | STOP_LOOP | ||
302 | now = cputime(); | ||
303 | last_loop = now - loop_start; | ||
304 | if (emergency_exit && wctime() > emergency_exit) { | ||
305 | /* Oops --- this should only be possible if the execution time tracking | ||
306 | * is broken in the LITMUS^RT kernel. */ | ||
307 | fprintf(stderr, "!!! rtspin/%d emergency exit!\n", getpid()); | ||
308 | fprintf(stderr, "Something is seriously wrong! Do not ignore this.\n"); | ||
309 | break; | ||
310 | } | ||
311 | long sum = 0; | ||
312 | // Verify that we actually traversed the whole wss | ||
313 | for (volatile cacheline_t* loc = arena; loc < arena + (wss*1024)/sizeof(cacheline_t); loc++) { | ||
314 | sum += loc->line[1]; | ||
315 | } | ||
316 | if (sum != wss * CACHELINES_IN_1KB) { | ||
317 | fprintf(stderr, "We hopped the wrong number of times! Hops: %ld, should have been: %ld\n", sum, wss * CACHELINES_IN_1KB); | ||
318 | } | ||
319 | //} | ||
320 | |||
321 | //sleep_next_period(); | ||
322 | continue; | ||
323 | } | ||
324 | } | ||
325 | WRITE_TO_FILE | ||
326 | printf("random_walk: done walking %ldKiB.\n", wss); | ||
327 | return 0; | ||
328 | } | ||
329 | /* | ||
330 | #define OPTSTR "p:wl:m:i:b:k:u:r:" | ||
331 | int main(int argc, char** argv) | ||
332 | { | ||
333 | int ret; | ||
334 | lt_t wcet, period, budget; | ||
335 | double wcet_ms, period_ms, budget_ms; | ||
336 | unsigned int priority = LITMUS_NO_PRIORITY; | ||
337 | int migrate = 0; | ||
338 | int cluster = 0; | ||
339 | int opt; | ||
340 | int wait = 0; | ||
341 | double duration = 0, start = 0; | ||
342 | struct rt_task param; | ||
343 | struct mc2_task mc2_param; | ||
344 | struct reservation_config config; | ||
345 | int res_type = PERIODIC_POLLING; | ||
346 | size_t arena_sz; | ||
347 | int wss; | ||
348 | int uncacheable = 0; | ||
349 | int read_access = 0, write; | ||
350 | int verbose = 0; | ||
351 | unsigned int job_no; | ||
352 | struct control_page* cp; | ||
353 | |||
354 | * default for reservation * | ||
355 | config.id = 0; | ||
356 | config.cpu = -1; | ||
357 | |||
358 | mc2_param.crit = CRIT_LEVEL_C; | ||
359 | |||
360 | budget_ms = 1000; | ||
361 | wss = 32; | ||
362 | |||
363 | while ((opt = getopt(argc, argv, OPTSTR)) != -1) { | ||
364 | switch (opt) { | ||
365 | case 'w': | ||
366 | wait = 1; | ||
367 | break; | ||
368 | case 'p': | ||
369 | cluster = atoi(optarg); | ||
370 | migrate = 1; | ||
371 | config.cpu = cluster; | ||
372 | break; | ||
373 | case 'k': | ||
374 | wss = atoi(optarg); | ||
375 | break; | ||
376 | case 'm': | ||
377 | mc2_param.crit = atoi(optarg); | ||
378 | if ((mc2_param.crit >= CRIT_LEVEL_A) && (mc2_param.crit <= CRIT_LEVEL_C)) { | ||
379 | res_type = PERIODIC_POLLING; | ||
380 | } | ||
381 | else | ||
382 | usage("Invalid criticality level."); | ||
383 | break; | ||
384 | case 'b': | ||
385 | budget_ms = atof(optarg); | ||
386 | break; | ||
387 | case 'r': | ||
388 | read_access = atoi(optarg); | ||
389 | break; | ||
390 | case 'q': | ||
391 | priority = want_non_negative_int(optarg, "-q"); | ||
392 | if (!litmus_is_valid_fixed_prio(priority)) | ||
393 | usage("Invalid priority"); | ||
394 | config.priority = atoi(optarg); | ||
395 | break; | ||
396 | case 'u': | ||
397 | uncacheable = atoi(optarg); | ||
398 | break; | ||
399 | case 'v': | ||
400 | verbose = 1; | ||
401 | break; | ||
402 | case ':': | ||
403 | usage("Argument missing."); | ||
404 | break; | ||
405 | case '?': | ||
406 | default: | ||
407 | usage("Bad argument."); | ||
408 | break; | ||
409 | } | ||
410 | } | ||
411 | srand(getpid()); | ||
412 | if (read_access == 1) | ||
413 | write = 0; | ||
414 | else | ||
415 | write = 1; | ||
416 | * | ||
417 | * We need three parameters | ||
418 | * | ||
419 | if (argc - optind < 3) | ||
420 | usage("Arguments missing."); | ||
421 | |||
422 | wcet_ms = atof(argv[optind + 0]); | ||
423 | period_ms = atof(argv[optind + 1]); | ||
424 | |||
425 | wcet = ms2ns(wcet_ms); | ||
426 | period = ms2ns(period_ms); | ||
427 | budget = ms2ns(budget_ms); | ||
428 | if (wcet <= 0) | ||
429 | usage("The worst-case execution time must be a " | ||
430 | "positive number."); | ||
431 | if (period <= 0) | ||
432 | usage("The period must be a positive number."); | ||
433 | if (wcet > period) { | ||
434 | usage("The worst-case execution time must not " | ||
435 | "exceed the period."); | ||
436 | } | ||
437 | |||
438 | duration = atof(argv[optind + 2]); | ||
439 | |||
440 | if (migrate) { | ||
441 | ret = be_migrate_to_domain(cluster); | ||
442 | if (ret < 0) | ||
443 | bail_out("could not migrate to target partition or cluster."); | ||
444 | } | ||
445 | |||
446 | * reservation config * | ||
447 | config.id = gettid(); | ||
448 | config.priority = priority; | ||
449 | config.polling_params.budget = budget; | ||
450 | config.polling_params.period = period; | ||
451 | config.polling_params.offset = 0; | ||
452 | config.polling_params.relative_deadline = 0; | ||
453 | |||
454 | if (config.polling_params.budget > config.polling_params.period) { | ||
455 | usage("The budget must not exceed the period."); | ||
456 | } | ||
457 | |||
458 | * create a reservation * | ||
459 | ret = reservation_create(res_type, &config); | ||
460 | if (ret < 0) { | ||
461 | bail_out("failed to create reservation."); | ||
462 | } | ||
463 | |||
464 | init_rt_task_param(¶m); | ||
465 | param.exec_cost = wcet; | ||
466 | param.period = period; | ||
467 | param.phase = 0; | ||
468 | param.relative_deadline = 0; | ||
469 | param.priority = priority == LITMUS_NO_PRIORITY ? LITMUS_LOWEST_PRIORITY : priority; | ||
470 | param.cls = RT_CLASS_HARD; | ||
471 | param.budget_policy = NO_ENFORCEMENT; | ||
472 | param.release_policy = TASK_PERIODIC; | ||
473 | if (migrate) { | ||
474 | param.cpu = gettid(); | ||
475 | } | ||
476 | ret = set_rt_task_param(gettid(), ¶m); | ||
477 | if (ret < 0) | ||
478 | bail_out("could not setup rt task params"); | ||
479 | |||
480 | mc2_param.res_id = gettid(); | ||
481 | ret = set_mc2_task_param(gettid(), &mc2_param); | ||
482 | if (ret < 0) | ||
483 | bail_out("could not setup mc2 task params"); | ||
484 | |||
485 | arena_sz = wss*1024; | ||
486 | arena = alloc_arena(arena_sz*2, 0, uncacheable); | ||
487 | init_arena(arena, arena_sz); | ||
488 | loop_once(wss, write); | ||
489 | |||
490 | ret = init_litmus(); | ||
491 | if (ret != 0) | ||
492 | bail_out("init_litmus() failed\n"); | ||
493 | |||
494 | mlockall(MCL_CURRENT | MCL_FUTURE); | ||
495 | |||
496 | if (mc2_param.crit == CRIT_LEVEL_C) | ||
497 | set_page_color(-1); | ||
498 | else | ||
499 | set_page_color(config.cpu); | ||
500 | |||
501 | start = wctime(); | ||
502 | ret = task_mode(LITMUS_RT_TASK); | ||
503 | if (ret != 0) | ||
504 | bail_out("could not become RT task"); | ||
505 | |||
506 | if (wait) { | ||
507 | ret = wait_for_ts_release(); | ||
508 | if (ret != 0) | ||
509 | bail_out("wait_for_ts_release()"); | ||
510 | start = wctime(); | ||
511 | } | ||
512 | cp = get_ctrl_page(); | ||
513 | |||
514 | while (job(wss, write, wcet_ms * 0.001, start + duration)) { | ||
515 | if (verbose) { | ||
516 | get_job_no(&job_no); | ||
517 | fprintf(stderr, "rtspin/%d:%u @ %.4fms\n", gettid(), | ||
518 | job_no, (wctime() - start) * 1000); | ||
519 | if (cp) { | ||
520 | double deadline, current, release; | ||
521 | lt_t now = litmus_clock(); | ||
522 | deadline = ns2s((double) cp->deadline); | ||
523 | current = ns2s((double) now); | ||
524 | release = ns2s((double) cp->release); | ||
525 | fprintf(stderr, | ||
526 | "\trelease: %" PRIu64 "ns (=%.2fs)\n", | ||
527 | (uint64_t) cp->release, release); | ||
528 | fprintf(stderr, | ||
529 | "\tdeadline: %" PRIu64 "ns (=%.2fs)\n", | ||
530 | (uint64_t) cp->deadline, deadline); | ||
531 | fprintf(stderr, | ||
532 | "\tcur time: %" PRIu64 "ns (=%.2fs)\n", | ||
533 | (uint64_t) now, current); | ||
534 | fprintf(stderr, | ||
535 | "\ttime until deadline: %.2fms\n", | ||
536 | (deadline - current) * 1000); | ||
537 | } | ||
538 | } | ||
539 | }; | ||
540 | |||
541 | ret = task_mode(BACKGROUND_TASK); | ||
542 | if (ret != 0) | ||
543 | bail_out("could not become regular task (huh?)"); | ||
544 | |||
545 | reservation_destroy(gettid(), config.cpu); | ||
546 | dealloc_arena(arena, arena_sz*2); | ||
547 | printf("%s finished.\n", argv[0]); | ||
548 | return 0; | ||
549 | } | ||
550 | */ | ||
diff --git a/dis/original/runDIS1.sh b/dis/original/runDIS1.sh deleted file mode 100755 index 88d2989..0000000 --- a/dis/original/runDIS1.sh +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | cat inputs/Field/in1 | ./field field 80 3 May20-fieldtest 1 | ||
diff --git a/dis/original/runDIS2.sh b/dis/original/runDIS2.sh deleted file mode 100755 index 9471319..0000000 --- a/dis/original/runDIS2.sh +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | cat inputs/Matrix/in0 | ./matrix matrix 1000 3 Nov27-matrixtest 1 | ||
diff --git a/dis/original/runDIS4.sh b/dis/original/runDIS4.sh deleted file mode 100755 index 58072a5..0000000 --- a/dis/original/runDIS4.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | cat inputs/Neighborhood/in0 | ./neighborhood neighborhood 1 3 Oct19-neighborhoodtest 1 | ||
3 | cat inputs/Pointer/in0 | ./pointer pointer 10 3 Oct19-pointertest 1 | ||
4 | cat inputs/Transitive/in1 | ./transitive transitive 800 3 Oct19-transitivetest 1 | ||
5 | cat inputs/Update/in0 | ./update update 1000 3 Oct19-updatetest 1 | ||
diff --git a/dis/original/run_dis.sh b/dis/original/run_dis.sh deleted file mode 100755 index 3e82bfb..0000000 --- a/dis/original/run_dis.sh +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | core=$1 | ||
4 | maxJobs=$2 | ||
5 | runID=$3 | ||
6 | benchmark=${4,} | ||
7 | template_input=inputs/$4/in1 | ||
8 | wss_settings=inputs/WSSS | ||
9 | cache_settings=inputs/caches | ||
10 | |||
11 | if [ $# -lt 4 ]; then | ||
12 | echo "Usage $0 <core ID> <number of iterations> <run ID> <benchmark> [template input] [DIS WSS file] [DIS cache file]" | ||
13 | exit | ||
14 | fi | ||
15 | |||
16 | if [ $# -gt 4 ]; then | ||
17 | echo "Using alternate input template from $5" | ||
18 | template_input=$5 | ||
19 | fi | ||
20 | |||
21 | if [ $# -gt 5 ]; then | ||
22 | echo "Using alternate WSS settings from $6" | ||
23 | wss_settings=$6 | ||
24 | fi | ||
25 | |||
26 | if [ $# -gt 6 ]; then | ||
27 | echo "Using alternate cache settings from $7" | ||
28 | cache_settings=$7 | ||
29 | fi | ||
30 | |||
31 | echo "Making sure that binary is up to date..." | ||
32 | make $benchmark | ||
33 | echo "Done. Disabling real-time throttling..." | ||
34 | |||
35 | # Turn off rt throttling | ||
36 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
37 | echo "Done. Redirecting all interrupts to core 0..." | ||
38 | |||
39 | # TODO: Make this cleaner | ||
40 | # Redirect all interrupts to core 0 | ||
41 | i=0 | ||
42 | for IRQ in /proc/irq/* | ||
43 | do | ||
44 | # Skip default_smp_affinity | ||
45 | if [ -d $IRQ ]; then | ||
46 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
47 | echo 0 > $IRQ/smp_affinity_list | ||
48 | fi | ||
49 | i=$(( $i + 1 )) | ||
50 | done | ||
51 | echo "Done. Beginning benchmarks..." | ||
52 | |||
53 | # Setup cache control group | ||
54 | mount -t resctrl resctrl /sys/fs/resctrl | ||
55 | mkdir /sys/fs/resctrl/benchmarks | ||
56 | sleep 1 # Wait a second for the group to initialize | ||
57 | echo $core > /sys/fs/resctrl/benchmarks/cpus_list | ||
58 | |||
59 | # Execute the benchmark for each WSS and cache config | ||
60 | while read j; do | ||
61 | echo $j > /sys/fs/resctrl/benchmarks/schemata | ||
62 | while read i; do | ||
63 | if grep -q "#define LITMUS 1" ../../baseline/source/extra.h; then | ||
64 | echo "Using LITMUS-RT!" | ||
65 | ./gen_input.py $benchmark $template_input $i | ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
66 | else | ||
67 | ./gen_input.py $benchmark $template_input $i | chrt -r 97 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
68 | fi | ||
69 | done < $wss_settings | ||
70 | done < $cache_settings | ||
71 | |||
72 | # Put IRQs back as they were | ||
73 | i=0 | ||
74 | for IRQ in /proc/irq/* | ||
75 | do | ||
76 | if [ -d $IRQ ]; then | ||
77 | echo ${irqList[$i]} > $IRQ/smp_affinity_list | ||
78 | fi | ||
79 | i=$(( $i + 1 )) | ||
80 | done | ||
81 | |||
diff --git a/dis/original/setup_mem_and_global.sh b/dis/original/setup_mem_and_global.sh deleted file mode 100755 index 56d6219..0000000 --- a/dis/original/setup_mem_and_global.sh +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | # Setup group | ||
2 | mkdir -p /sys/fs/resctrl/benchmarks | ||
3 | echo 15 > /sys/fs/resctrl/benchmarks/cpus_list | ||
4 | # Remove mem from global domain | ||
5 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
6 | # Remove bandwidth from global domain | ||
7 | echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata | ||
8 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
9 | echo "=== Global Config ===" | ||
10 | cat /sys/fs/resctrl/schemata | ||
11 | echo "=== Core 15 Config ===" | ||
12 | cat /sys/fs/resctrl/benchmarks/schemata | ||
13 | |||
diff --git a/dis/original/summarize.py b/dis/original/summarize.py deleted file mode 100755 index f8f6929..0000000 --- a/dis/original/summarize.py +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | #!/usr/bin/python3 | ||
2 | import sys | ||
3 | |||
4 | f = sys.argv[1] | ||
5 | res = {} | ||
6 | mem_res = {} | ||
7 | memw_res = {} | ||
8 | samples = {} | ||
9 | max_res = {} | ||
10 | |||
11 | with open(f) as fp: | ||
12 | for line in fp: | ||
13 | s = line.split() | ||
14 | if s[0] not in res: | ||
15 | # print(s[0]) | ||
16 | res[s[0]] = list([int(s[5])])#)int(s[5]) | ||
17 | mem_res[s[0]] = int(s[8]) | ||
18 | memw_res[s[0]] = int(s[9]) | ||
19 | samples[s[0]] = int(s[4]) | ||
20 | max_res[s[0]] = int(s[5]) | ||
21 | else: | ||
22 | res[s[0]].append(int(s[5])) | ||
23 | mem_res[s[0]] += int(s[8]) | ||
24 | memw_res[s[0]] += int(s[9]) | ||
25 | max_res[s[0]] = max(int(s[5]), max_res[s[0]]) | ||
26 | ## {{{ http://code.activestate.com/recipes/511478/ (r1) | ||
27 | import math | ||
28 | import functools | ||
29 | |||
30 | def percentile(N, percent, key=lambda x:x): | ||
31 | """ | ||
32 | Find the percentile of a list of values. | ||
33 | |||
34 | @parameter N - is a list of values. Note N MUST BE already sorted. | ||
35 | @parameter percent - a float value from 0.0 to 1.0. | ||
36 | @parameter key - optional key function to compute value from each element of N. | ||
37 | |||
38 | @return - the percentile of the values | ||
39 | """ | ||
40 | if not N: | ||
41 | return None | ||
42 | k = (len(N)-1) * percent | ||
43 | f = math.floor(k) | ||
44 | c = math.ceil(k) | ||
45 | if f == c: | ||
46 | return key(N[int(k)]) | ||
47 | d0 = key(N[int(f)]) * (c-k) | ||
48 | d1 = key(N[int(c)]) * (k-f) | ||
49 | return d0+d1 | ||
50 | ## end of http://code.activestate.com/recipes/511478/ }}} | ||
51 | """ | ||
52 | print("Average times:") | ||
53 | for r in res.keys(): | ||
54 | print(res[r]/samples[r]) | ||
55 | |||
56 | print("Average memory read:") | ||
57 | for r in mem_res.keys(): | ||
58 | print(mem_res[r]/samples[r]) | ||
59 | |||
60 | print("Average memory write:") | ||
61 | for r in memw_res.keys(): | ||
62 | print(memw_res[r]/samples[r]) | ||
63 | |||
64 | print("Max times:") | ||
65 | for r in max_res.keys(): | ||
66 | print(max_res[r]) | ||
67 | """ | ||
68 | print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") | ||
69 | for r in res.keys(): | ||
70 | # print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) | ||
71 | print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | ||