diff options
-rw-r--r-- | SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 12 | ||||
-rw-r--r-- | SD-VBS/common/c/extra.h | 239 | ||||
-rw-r--r-- | SD-VBS/common/makefiles/Makefile.common | 5 | ||||
-rwxr-xr-x | all_pairs/bin/anagram | bin | 0 -> 185080 bytes | |||
-rwxr-xr-x | all_pairs/bin/audiobeam | bin | 0 -> 129064 bytes | |||
-rwxr-xr-x | all_pairs/bin/g723_enc | bin | 0 -> 101816 bytes | |||
-rwxr-xr-x | all_pairs/bin/huff_dec | bin | 0 -> 96112 bytes | |||
-rwxr-xr-x | baseline/bin/anagram | bin | 0 -> 179832 bytes | |||
-rwxr-xr-x | baseline/bin/audiobeam | bin | 0 -> 123816 bytes | |||
-rwxr-xr-x | baseline/bin/g723_enc | bin | 0 -> 100656 bytes | |||
-rwxr-xr-x | baseline/bin/huff_dec | bin | 0 -> 94944 bytes | |||
-rwxr-xr-x | dis/Makefile | 2 | ||||
-rw-r--r-- | dis/sudo | 180 | ||||
-rw-r--r-- | run_case_study.py | 119 |
14 files changed, 438 insertions, 119 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index b7611f1..9310048 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c | |||
@@ -23,6 +23,12 @@ int main(int argc, char* argv[]) | |||
23 | cols = Icur->width; | 23 | cols = Icur->width; |
24 | 24 | ||
25 | for_each_job { | 25 | for_each_job { |
26 | iFreeHandle(Icur); | ||
27 | fFreeHandle(v); | ||
28 | fFreeHandle(interestPnts); | ||
29 | fFreeHandle(int1); | ||
30 | fFreeHandle(int2); | ||
31 | fFreeHandle(Fcur); | ||
26 | v = harris(Icur); | 32 | v = harris(Icur); |
27 | interestPnts = getANMS(v, 24); | 33 | interestPnts = getANMS(v, 24); |
28 | int1 = fMallocHandle(interestPnts->height, 1); | 34 | int1 = fMallocHandle(interestPnts->height, 1); |
@@ -49,12 +55,6 @@ int main(int argc, char* argv[]) | |||
49 | printf("Error in Stitch\n"); | 55 | printf("Error in Stitch\n"); |
50 | } | 56 | } |
51 | #endif | 57 | #endif |
52 | iFreeHandle(Icur); | ||
53 | fFreeHandle(v); | ||
54 | fFreeHandle(interestPnts); | ||
55 | fFreeHandle(int1); | ||
56 | fFreeHandle(int2); | ||
57 | fFreeHandle(Fcur); | ||
58 | WRITE_TO_FILE | 58 | WRITE_TO_FILE |
59 | return 0; | 59 | return 0; |
60 | } | 60 | } |
diff --git a/SD-VBS/common/c/extra.h b/SD-VBS/common/c/extra.h index 8c67b33..9c72064 100644 --- a/SD-VBS/common/c/extra.h +++ b/SD-VBS/common/c/extra.h | |||
@@ -29,8 +29,8 @@ extern int sched_getcpu(); | |||
29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | // This is a proxy for "case study mode" now | ||
32 | #define LITMUS 1 | 33 | #define LITMUS 1 |
33 | #define MC2 0 | ||
34 | #define MMDC_PROF 0 | 34 | #define MMDC_PROF 0 |
35 | 35 | ||
36 | #if LITMUS | 36 | #if LITMUS |
@@ -41,18 +41,6 @@ extern int sched_getcpu(); | |||
41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" | 41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #if LITMUS | ||
45 | #define SET_UP LOAD_PARAMS SETUP_LITMUS | ||
46 | #else | ||
47 | #define SET_UP LOAD_PARAMS | ||
48 | #endif | ||
49 | |||
50 | #if MMDC_PROF | ||
51 | #define LOAD_PARAMS LOAD_PARAMS_ITRL SETUP_MMDC | ||
52 | #else | ||
53 | #define LOAD_PARAMS LOAD_PARAMS_ITRL | ||
54 | #endif | ||
55 | |||
56 | // Store state globally so that the job can be outside main() | 44 | // Store state globally so that the job can be outside main() |
57 | // Arrays use float as a comprimise between overflow and size | 45 | // Arrays use float as a comprimise between overflow and size |
58 | // Paired arrays use long longs as precision is more important for those times | 46 | // Paired arrays use long longs as precision is more important for those times |
@@ -82,50 +70,72 @@ char *_rt_other_core; | |||
82 | char *_rt_barrier; | 70 | char *_rt_barrier; |
83 | sem_t *_rt_first_sem, *_rt_second_sem; | 71 | sem_t *_rt_first_sem, *_rt_second_sem; |
84 | int _rt_lock_id; | 72 | int _rt_lock_id; |
73 | #define _ID_SZ 128 | ||
74 | char _rt_sem1_name[_ID_SZ] = "/_libextra_first_sem-"; | ||
75 | char _rt_sem2_name[_ID_SZ] = "/_libextra_second_sem-"; | ||
76 | char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-"; | ||
77 | #endif /* PAIRED */ | ||
78 | |||
79 | #if LITMUS | ||
80 | long unsigned int _rt_period; | ||
85 | #endif | 81 | #endif |
86 | 82 | ||
87 | static void _rt_load_params_itrl(int argc, char **argv) { | 83 | static void _rt_load_params_itrl(int argc, char **argv) { |
88 | #ifdef PAIRED | 84 | #ifdef PAIRED |
89 | if (argc != 8) { | 85 | if (argc != (8 + LITMUS*2) && argc != (9 + LITMUS*2)) { |
90 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <lockID>", argv[0]); | 86 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?>", argv[0]); |
91 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | ||
92 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | ||
93 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | ||
94 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
95 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
96 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | ||
97 | fprintf(stderr, " <lockID> 1 to indicate this is pair member 1, otherwise pair member 2.\n"); | ||
98 | exit(1); | ||
99 | } | ||
100 | #else | 87 | #else |
101 | if (argc != 6) { | 88 | if (argc != (6 + LITMUS*2)) { |
102 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); | 89 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); |
90 | #endif /* PAIRED */ | ||
103 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | 91 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); |
104 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | 92 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); |
105 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | 93 | fprintf(stderr, " <my core> integer core number. Only used for LITMUS-RT.\n"); |
94 | #ifdef PAIRED | ||
95 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
96 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
97 | #endif /* PAIRED */ | ||
106 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | 98 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); |
107 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); | 99 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); |
100 | #ifdef PAIRED | ||
101 | fprintf(stderr, " <pairID> (optional).\n"); | ||
102 | #endif | ||
103 | #if LITMUS | ||
104 | fprintf(stderr, " <task period> in ms\n"); | ||
105 | fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); | ||
106 | #endif /* LITMUS */ | ||
108 | exit(1); | 107 | exit(1); |
109 | } | 108 | } |
110 | #endif | ||
111 | _rt_our_prog_name = argv[1]; | 109 | _rt_our_prog_name = argv[1]; |
112 | _rt_max_jobs = atol(argv[2]); | 110 | _rt_max_jobs = atol(argv[2]); |
111 | #if !LITMUS | ||
113 | _rt_core = sched_getcpu(); | 112 | _rt_core = sched_getcpu(); |
113 | #else | ||
114 | _rt_core = atoi(argv[3]); | ||
115 | #endif | ||
114 | #ifdef PAIRED | 116 | #ifdef PAIRED |
115 | _rt_other_core = argv[4]; | 117 | _rt_other_core = argv[4]; |
116 | _rt_other_prog_name = argv[5]; | 118 | _rt_other_prog_name = argv[5]; |
117 | _rt_run_id = argv[6]; | 119 | _rt_run_id = argv[6]; |
118 | _rt_lock_id = atoi(argv[7]); | 120 | _rt_will_output = atoi(argv[7]); |
119 | // The paired version doesn't support disabling output (legacy compatibility) | 121 | char *pairId; |
120 | _rt_will_output = 1; | 122 | int end; |
123 | if (argc > 8) { | ||
124 | pairId = argv[8]; | ||
125 | end = 8; | ||
126 | } else { | ||
127 | pairId = "none"; | ||
128 | end = 9; | ||
129 | } | ||
121 | #else | 130 | #else |
122 | _rt_other_core = "none"; | 131 | _rt_other_core = "none"; |
123 | _rt_other_prog_name = "none"; | 132 | _rt_other_prog_name = "none"; |
124 | _rt_run_id = argv[4]; | 133 | _rt_run_id = argv[4]; |
125 | _rt_will_output = atoi(argv[5]); | 134 | _rt_will_output = atoi(argv[5]); |
135 | int end = 6; | ||
126 | #endif /* PAIRED */ | 136 | #endif /* PAIRED */ |
127 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { | 137 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { |
128 | fprintf(stderr, "Infinite loops only supported when _rt_will_output is disabled!\n"); | 138 | fprintf(stderr, "Infinite loops only supported when output is disabled!\n"); |
129 | exit(1); | 139 | exit(1); |
130 | } | 140 | } |
131 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { | 141 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { |
@@ -133,32 +143,54 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
133 | exit(1); | 143 | exit(1); |
134 | } | 144 | } |
135 | #ifdef PAIRED | 145 | #ifdef PAIRED |
146 | // __rt_sem2_name happens to be the longest | ||
147 | if (strlen(pairId) + strlen(_rt_sem2_name) > _ID_SZ) { | ||
148 | fprintf(stderr, "PairID is too long! Maximum length is %ld characters.\n", _ID_SZ - strlen(_rt_sem2_name)); | ||
149 | exit(1); | ||
150 | } | ||
136 | _rt_start_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | 151 | _rt_start_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); |
137 | _rt_end_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | 152 | _rt_end_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); |
138 | if (!_rt_end_time || !_rt_start_time) { | 153 | if (!_rt_end_time || !_rt_start_time) { |
139 | perror("Unable to allocate buffers for execution times"); | 154 | perror("Unable to allocate buffers for execution times"); |
140 | exit(1); | 155 | exit(1); |
141 | } | 156 | } |
142 | _rt_first_sem = sem_open("/_libextra_first_sem", O_CREAT, 644, 0); | 157 | // Use PairID to create unique semaphore and shared memory paths |
143 | _rt_second_sem = sem_open("/_libextra_second_sem", O_CREAT, 644, 0); | 158 | strcat(_rt_sem1_name, pairId); |
159 | strcat(_rt_sem2_name, pairId); | ||
160 | strcat(_rt_shm_name, pairId); | ||
161 | _rt_first_sem = sem_open(_rt_sem1_name, O_CREAT, 644, 0); | ||
162 | _rt_second_sem = sem_open(_rt_sem2_name, O_CREAT, 644, 0); | ||
144 | if (_rt_first_sem == SEM_FAILED || _rt_second_sem == SEM_FAILED) { | 163 | if (_rt_first_sem == SEM_FAILED || _rt_second_sem == SEM_FAILED) { |
145 | perror("Error while creating semaphores"); | 164 | perror("Error while creating semaphores"); |
146 | exit(1); | 165 | exit(1); |
147 | } | 166 | } |
148 | int barrier_file = shm_open("/_libextra_barrier", O_CREAT | O_RDWR, 644); | 167 | // Create shared memory for barrier synchronization and infer lock ID |
168 | int barrier_file = shm_open(_rt_shm_name, O_CREAT | O_RDWR | O_EXCL, 644); | ||
169 | if (barrier_file == -1) { | ||
170 | // File already existed - we're the 2nd program and thus lock ID 2 | ||
171 | _rt_lock_id = 2; | ||
172 | barrier_file = shm_open(_rt_shm_name, O_CREAT | O_RDWR, 644); | ||
173 | } else { | ||
174 | _rt_lock_id = 1; | ||
175 | } | ||
149 | if (barrier_file == -1) { | 176 | if (barrier_file == -1) { |
150 | perror("Error while creating shared memory for barrier synchronization"); | 177 | perror("Error while creating shared memory for barrier synchronization"); |
151 | exit(1); | 178 | exit(1); |
152 | } | 179 | } |
153 | if (ftruncate(barrier_file, 1) == -1) { | 180 | if (ftruncate(barrier_file, 2) == -1) { |
154 | perror("Error while setting size of shared memory for barrier synchronization"); | 181 | perror("Error while setting size of shared memory for barrier synchronization"); |
155 | exit(1); | 182 | exit(1); |
156 | } | 183 | } |
157 | _rt_barrier = mmap(NULL, 1, PROT_WRITE, MAP_SHARED, barrier_file, 0); | 184 | _rt_barrier = mmap(NULL, 2, PROT_WRITE, MAP_SHARED, barrier_file, 0); |
158 | if (_rt_barrier == MAP_FAILED) { | 185 | if (_rt_barrier == MAP_FAILED) { |
159 | perror("Error while mapping shared memory for barrier synchronization"); | 186 | perror("Error while mapping shared memory for barrier synchronization"); |
160 | exit(1); | 187 | exit(1); |
161 | } | 188 | } |
189 | // If we're the 2nd user of this barrier, mark it as in-use | ||
190 | if (_rt_lock_id == 2 && !__sync_bool_compare_and_swap(_rt_barrier+1, 0, 1)) { | ||
191 | fprintf(stderr, "Pair ID already in use!\n"); | ||
192 | exit(1); | ||
193 | } | ||
162 | *_rt_barrier = 0; | 194 | *_rt_barrier = 0; |
163 | #else | 195 | #else |
164 | _rt_exec_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(float)); | 196 | _rt_exec_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(float)); |
@@ -169,8 +201,47 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
169 | #endif /* PAIRED */ | 201 | #endif /* PAIRED */ |
170 | _rt_jobs_complete = 0; | 202 | _rt_jobs_complete = 0; |
171 | mlockall(MCL_CURRENT || MCL_FUTURE); | 203 | mlockall(MCL_CURRENT || MCL_FUTURE); |
204 | #if LITMUS | ||
205 | _rt_period = strtoul(argv[end], NULL, 10); | ||
206 | unsigned int crit = atoi(argv[end+1]); | ||
207 | unsigned int wait = 1; | ||
208 | if (be_migrate_to_domain(_rt_core) < 0) { | ||
209 | perror("Unable to migrate to specified CPU"); | ||
210 | exit(1); | ||
211 | } | ||
212 | struct rt_task rt_param; | ||
213 | init_rt_task_param(&rt_param); | ||
214 | // Fake exec cost - this value ignored by the MC^2 scheduler | ||
215 | rt_param.exec_cost = _rt_period; | ||
216 | rt_param.period = ms2ns(_rt_period); | ||
217 | rt_param.relative_deadline = 0; | ||
218 | rt_param.phase = 0; | ||
219 | rt_param.priority = LITMUS_LOWEST_PRIORITY; | ||
220 | rt_param.cls = crit; | ||
221 | rt_param.release_policy = TASK_PERIODIC; | ||
222 | rt_param.budget_policy = NO_ENFORCEMENT; | ||
223 | rt_param.cpu = _rt_core; | ||
224 | if (set_rt_task_param(gettid(), &rt_param) < 0) { | ||
225 | perror("Unable to set real-time parameters"); | ||
226 | exit(1); | ||
227 | } | ||
228 | if (init_litmus() != 0) { | ||
229 | perror("init_litmus failed"); | ||
230 | exit(1); | ||
231 | } | ||
232 | if (task_mode(LITMUS_RT_TASK) != 0) { | ||
233 | perror("Unable to become real-time task"); | ||
234 | exit(1); | ||
235 | } | ||
236 | if (wait && wait_for_ts_release() != 0) { | ||
237 | perror("Unable to wait for taskset release"); | ||
238 | exit(1); | ||
239 | } | ||
240 | #endif /* LITMUS */ | ||
241 | #if MMDC_PROF | ||
242 | SETUP_MMDC | ||
243 | #endif | ||
172 | } | 244 | } |
173 | #define LOAD_PARAMS_ITRL _rt_load_params_itrl(argc, argv); | ||
174 | 245 | ||
175 | #define SETUP_MMDC \ | 246 | #define SETUP_MMDC \ |
176 | _rt_mmdc_read = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ | 247 | _rt_mmdc_read = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ |
@@ -194,54 +265,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
194 | mmdc->madpcr1 = axi_arm1;\ | 265 | mmdc->madpcr1 = axi_arm1;\ |
195 | msync(&(mmdc->madpcr1),4,MS_SYNC); | 266 | msync(&(mmdc->madpcr1),4,MS_SYNC); |
196 | 267 | ||
197 | #define SETUP_LITMUS \ | ||
198 | unsigned int wait = 0; \ | ||
199 | if (be_migrate_to_domain(_rt_core) < 0) { \ | ||
200 | perror("Unable to migrate to specified CPU"); \ | ||
201 | exit(1); \ | ||
202 | } \ | ||
203 | struct rt_task rt_param; \ | ||
204 | init_rt_task_param(&rt_param); \ | ||
205 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | ||
206 | rt_param.exec_cost = ms2ns(999); \ | ||
207 | rt_param.period = ms2ns(1000); \ | ||
208 | rt_param.priority = LITMUS_HIGHEST_PRIORITY; \ | ||
209 | rt_param.cls = RT_CLASS_HARD; \ | ||
210 | rt_param.release_policy = TASK_PERIODIC; \ | ||
211 | rt_param.budget_policy = NO_ENFORCEMENT; \ | ||
212 | rt_param.cpu = _rt_core; \ | ||
213 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ | ||
214 | perror("Unable to set real-time parameters"); \ | ||
215 | exit(1); \ | ||
216 | } \ | ||
217 | if (init_litmus() != 0) { \ | ||
218 | perror("init_litmus failed"); \ | ||
219 | exit(1); \ | ||
220 | } \ | ||
221 | MC2_SETUP \ | ||
222 | if (task_mode(LITMUS_RT_TASK) != 0) { \ | ||
223 | perror("Unable to become real-time task"); \ | ||
224 | exit(1); \ | ||
225 | } \ | ||
226 | if (wait && wait_for_ts_release() != 0) { \ | ||
227 | perror("Unable to wait for taskset release"); \ | ||
228 | exit(1); \ | ||
229 | } | ||
230 | |||
231 | #if MC2 | ||
232 | #define MC2_SETUP \ | ||
233 | |||
234 | set_page_color(rt_param.cpu); | ||
235 | #else | ||
236 | #define MC2_SETUP | ||
237 | #endif | ||
238 | |||
239 | #define CLEANUP_LITMUS \ | ||
240 | if (task_mode(BACKGROUND_TASK) != 0) { \ | ||
241 | perror("Unable to become a real-time task"); \ | ||
242 | exit(1); \ | ||
243 | } \ | ||
244 | |||
245 | #if __arm__ | 268 | #if __arm__ |
246 | // On ARM, manually flush the cache | 269 | // On ARM, manually flush the cache |
247 | #define FLUSH_CACHES \ | 270 | #define FLUSH_CACHES \ |
@@ -305,28 +328,28 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
305 | 328 | ||
306 | // Buffer timing result from a single job | 329 | // Buffer timing result from a single job |
307 | static void _rt_save_job_result() { | 330 | static void _rt_save_job_result() { |
331 | if (!_rt_will_output) | ||
332 | return; | ||
308 | if (_rt_jobs_complete >= _rt_max_jobs) { | 333 | if (_rt_jobs_complete >= _rt_max_jobs) { |
309 | fprintf(stderr, "Max jobs setting too small! Trying to record job #%ld when we only have space for %ld jobs. Exiting...\n", _rt_jobs_complete, _rt_max_jobs); | 334 | fprintf(stderr, "Max jobs setting too small! Trying to record job #%ld when we only have space for %ld jobs. Exiting...\n", _rt_jobs_complete, _rt_max_jobs); |
310 | exit(1); | 335 | exit(1); |
311 | } | 336 | } |
312 | if (_rt_jobs_complete > -1 && _rt_will_output) { | ||
313 | #ifdef PAIRED | 337 | #ifdef PAIRED |
314 | _rt_start_time[_rt_jobs_complete] = _rt_start.tv_sec; | 338 | _rt_start_time[_rt_jobs_complete] = _rt_start.tv_sec; |
315 | _rt_start_time[_rt_jobs_complete] *= _BILLION; | 339 | _rt_start_time[_rt_jobs_complete] *= _BILLION; |
316 | _rt_start_time[_rt_jobs_complete] += _rt_start.tv_nsec; | 340 | _rt_start_time[_rt_jobs_complete] += _rt_start.tv_nsec; |
317 | _rt_end_time[_rt_jobs_complete] = _rt_end.tv_sec; | 341 | _rt_end_time[_rt_jobs_complete] = _rt_end.tv_sec; |
318 | _rt_end_time[_rt_jobs_complete] *= _BILLION; | 342 | _rt_end_time[_rt_jobs_complete] *= _BILLION; |
319 | _rt_end_time[_rt_jobs_complete] += _rt_end.tv_nsec; | 343 | _rt_end_time[_rt_jobs_complete] += _rt_end.tv_nsec; |
320 | #else | 344 | #else |
321 | _rt_exec_time[_rt_jobs_complete] = _rt_end.tv_sec - _rt_start.tv_sec; | 345 | _rt_exec_time[_rt_jobs_complete] = _rt_end.tv_sec - _rt_start.tv_sec; |
322 | _rt_exec_time[_rt_jobs_complete] *= _BILLION; | 346 | _rt_exec_time[_rt_jobs_complete] *= _BILLION; |
323 | _rt_exec_time[_rt_jobs_complete] += _rt_end.tv_nsec - _rt_start.tv_nsec; | 347 | _rt_exec_time[_rt_jobs_complete] += _rt_end.tv_nsec - _rt_start.tv_nsec; |
324 | #endif /* PAIRED */ | 348 | #endif /* PAIRED */ |
325 | #if MMDC_PROF | 349 | #if MMDC_PROF |
326 | _rt_mmdc_read[_rt_jobs_complete] = mmdc_res.read_bytes; | 350 | _rt_mmdc_read[_rt_jobs_complete] = mmdc_res.read_bytes; |
327 | _rt_mmdc_write[_rt_jobs_complete] = mmdc_res.write_bytes; | 351 | _rt_mmdc_write[_rt_jobs_complete] = mmdc_res.write_bytes; |
328 | #endif | 352 | #endif /* MMDC_PROF */ |
329 | } | ||
330 | } | 353 | } |
331 | 354 | ||
332 | // Save all buffered timing results to disk | 355 | // Save all buffered timing results to disk |
@@ -365,13 +388,16 @@ static void _rt_write_to_file() { | |||
365 | fclose(fp); | 388 | fclose(fp); |
366 | out: | 389 | out: |
367 | #if LITMUS | 390 | #if LITMUS |
368 | CLEANUP_LITMUS | 391 | if (task_mode(BACKGROUND_TASK) != 0) { |
392 | perror("Unable to become a real-time task"); | ||
393 | exit(1); | ||
394 | } | ||
369 | #endif /* LITMUS */ | 395 | #endif /* LITMUS */ |
370 | #ifdef PAIRED | 396 | #ifdef PAIRED |
371 | munmap(_rt_barrier, 1); | 397 | munmap(_rt_barrier, 2); |
372 | shm_unlink("/_libextra_barrier"); | 398 | sem_unlink(_rt_sem1_name); |
373 | sem_unlink("/_libextra_first_sem"); | 399 | sem_unlink(_rt_sem2_name); |
374 | sem_unlink("/_libextra_second_sem"); | 400 | shm_unlink(_rt_shm_name); |
375 | free(_rt_start_time); | 401 | free(_rt_start_time); |
376 | free(_rt_end_time); | 402 | free(_rt_end_time); |
377 | #else | 403 | #else |
@@ -396,7 +422,9 @@ static void _rt_start_loop() { | |||
396 | FIRST_UNLOCK | 422 | FIRST_UNLOCK |
397 | FIRST_LOCK | 423 | FIRST_LOCK |
398 | #endif /* PAIRED */ | 424 | #endif /* PAIRED */ |
425 | #if !LITMUS | ||
399 | FLUSH_CACHES | 426 | FLUSH_CACHES |
427 | #endif | ||
400 | #ifdef PAIRED | 428 | #ifdef PAIRED |
401 | BARRIER_SYNC | 429 | BARRIER_SYNC |
402 | #endif /* PAIRED */ | 430 | #endif /* PAIRED */ |
@@ -444,7 +472,7 @@ static void _rt_stop_loop() { | |||
444 | * result. We use this to call our void function from inside a comparison. | 472 | * result. We use this to call our void function from inside a comparison. |
445 | */ | 473 | */ |
446 | #define for_each_job \ | 474 | #define for_each_job \ |
447 | for (; _rt_jobs_complete < _rt_max_jobs && (_rt_start_loop(),1); \ | 475 | for (; (_rt_max_jobs == -1 || _rt_jobs_complete < _rt_max_jobs) && (_rt_start_loop(),1); \ |
448 | _rt_stop_loop()) | 476 | _rt_stop_loop()) |
449 | 477 | ||
450 | /****** Legacy API ****** | 478 | /****** Legacy API ****** |
@@ -466,6 +494,7 @@ static void _rt_stop_loop() { | |||
466 | * able to read them. | 494 | * able to read them. |
467 | */ | 495 | */ |
468 | static int jobsComplete = 0; | 496 | static int jobsComplete = 0; |
497 | #define SET_UP _rt_load_params_itrl(argc, argv); | ||
469 | #define START_LOOP _rt_start_loop(); | 498 | #define START_LOOP _rt_start_loop(); |
470 | #define STOP_LOOP _rt_stop_loop(); | 499 | #define STOP_LOOP _rt_stop_loop(); |
471 | #define WRITE_TO_FILE _rt_write_to_file(); | 500 | #define WRITE_TO_FILE _rt_write_to_file(); |
diff --git a/SD-VBS/common/makefiles/Makefile.common b/SD-VBS/common/makefiles/Makefile.common index 964ece6..2080e2a 100644 --- a/SD-VBS/common/makefiles/Makefile.common +++ b/SD-VBS/common/makefiles/Makefile.common | |||
@@ -28,9 +28,10 @@ PRELOAD_TIMES_DIR := $(TOP_DIR)/preload-times/$(BMARK) | |||
28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) | 28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) |
29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) | 29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) |
30 | TOOL_DIR := $(TOP_DIR)/tools | 30 | TOOL_DIR := $(TOP_DIR)/tools |
31 | LIBLITMUS ?= /home/litmus/liblitmus | 31 | LIBLITMUS ?= /playpen/mc2/liblitmus |
32 | LIBEXTRA ?= $(TOP_DIR)/../ | ||
32 | ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) | 33 | ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) |
33 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 34 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include -I${LIBEXTRA} |
34 | override LDFLAGS += -L${LIBLITMUS} -llitmus | 35 | override LDFLAGS += -L${LIBLITMUS} -llitmus |
35 | endif | 36 | endif |
36 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. | 37 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. |
diff --git a/all_pairs/bin/anagram b/all_pairs/bin/anagram new file mode 100755 index 0000000..c2f4b84 --- /dev/null +++ b/all_pairs/bin/anagram | |||
Binary files differ | |||
diff --git a/all_pairs/bin/audiobeam b/all_pairs/bin/audiobeam new file mode 100755 index 0000000..9caf6e9 --- /dev/null +++ b/all_pairs/bin/audiobeam | |||
Binary files differ | |||
diff --git a/all_pairs/bin/g723_enc b/all_pairs/bin/g723_enc new file mode 100755 index 0000000..b84f812 --- /dev/null +++ b/all_pairs/bin/g723_enc | |||
Binary files differ | |||
diff --git a/all_pairs/bin/huff_dec b/all_pairs/bin/huff_dec new file mode 100755 index 0000000..f00d796 --- /dev/null +++ b/all_pairs/bin/huff_dec | |||
Binary files differ | |||
diff --git a/baseline/bin/anagram b/baseline/bin/anagram new file mode 100755 index 0000000..d723b8a --- /dev/null +++ b/baseline/bin/anagram | |||
Binary files differ | |||
diff --git a/baseline/bin/audiobeam b/baseline/bin/audiobeam new file mode 100755 index 0000000..52e5e05 --- /dev/null +++ b/baseline/bin/audiobeam | |||
Binary files differ | |||
diff --git a/baseline/bin/g723_enc b/baseline/bin/g723_enc new file mode 100755 index 0000000..ce4ef00 --- /dev/null +++ b/baseline/bin/g723_enc | |||
Binary files differ | |||
diff --git a/baseline/bin/huff_dec b/baseline/bin/huff_dec new file mode 100755 index 0000000..39ca800 --- /dev/null +++ b/baseline/bin/huff_dec | |||
Binary files differ | |||
diff --git a/dis/Makefile b/dis/Makefile index 77e0b8a..d18761b 100755 --- a/dis/Makefile +++ b/dis/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation | 2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation |
3 | # (I know that this Makefile is mildly evil and breaks so many rules | 3 | # (I know that this Makefile is mildly evil and breaks so many rules |
4 | # that a good Makefile should follow. Sorry - at least I have one.) | 4 | # that a good Makefile should follow. Sorry - at least I have one.) |
5 | LIBLITMUS ?= /home/litmus/liblitmus | 5 | LIBLITMUS ?= /playpen/mc2/liblitmus |
6 | CC ?= gcc | 6 | CC ?= gcc |
7 | override CFLAGS += -pthread -O2 -I.. | 7 | override CFLAGS += -pthread -O2 -I.. |
8 | LDFLAGS = -lrt -lm | 8 | LDFLAGS = -lrt -lm |
diff --git a/dis/sudo b/dis/sudo new file mode 100644 index 0000000..134ad48 --- /dev/null +++ b/dis/sudo | |||
@@ -0,0 +1,180 @@ | |||
1 | 2097152 -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 | |||
180 | |||
diff --git a/run_case_study.py b/run_case_study.py index d715644..f5a4f61 100644 --- a/run_case_study.py +++ b/run_case_study.py | |||
@@ -2,11 +2,24 @@ import os | |||
2 | import sys | 2 | import sys |
3 | import re | 3 | import re |
4 | import csv | 4 | import csv |
5 | import subprocess | ||
5 | def main(): | 6 | def main(): |
6 | pathName = sys.argv[1] | 7 | pathName = sys.argv[1] |
8 | tacle_pairs_path = "./all_pairs" | ||
9 | tacle_baseline_path = "./baseline" | ||
10 | dis_path = "./dis" | ||
7 | all_tasks = [] | 11 | all_tasks = [] |
8 | levelAB = [] | 12 | levelAB = [] |
9 | levelC = [] | 13 | levelC = [] |
14 | levelC_s = [] | ||
15 | dis_inputs = dict() | ||
16 | dis_inputs["field"] = "./gen_input.py field inputs/Field/in0 2097152" | ||
17 | dis_inputs["matrix"] = "gen_input.py matrix inputs/Matrix/in0 2097152" | ||
18 | dis_inputs["neighborhood"] = "./gen_input.py neighborhood inputs/Neighborhood/in0 2097152" | ||
19 | dis_inputs["pointer"] = "./gen_input.py pointer inputs/Pointer/in0 2097152" | ||
20 | dis_inputs["transitive"] = "./gen_input.py transitive inputs/Transitive/in0 2097152" | ||
21 | dis_inputs["update"] = "./gen_input.py update inputs/Update/in0 2097152" | ||
22 | |||
10 | with open(pathName+"/all_tasks.csv", "r") as csv_file: | 23 | with open(pathName+"/all_tasks.csv", "r") as csv_file: |
11 | csv_reader = csv.reader(csv_file, delimiter = ',') | 24 | csv_reader = csv.reader(csv_file, delimiter = ',') |
12 | line = 0 | 25 | line = 0 |
@@ -24,10 +37,25 @@ def main(): | |||
24 | with open(pathName+"/levelC_threads.csv", "r") as csv_file: | 37 | with open(pathName+"/levelC_threads.csv", "r") as csv_file: |
25 | csv_reader = csv.reader(csv_file, delimiter = ',') | 38 | csv_reader = csv.reader(csv_file, delimiter = ',') |
26 | line = 0 | 39 | line = 0 |
40 | ccx = "0" | ||
41 | threaded = True | ||
27 | for row in csv_reader: | 42 | for row in csv_reader: |
28 | if line > 0: | 43 | if(len(row) < 3): |
29 | levelC.append(row) | 44 | continue |
30 | line += 1 | 45 | if(row[0] == "threaded" or row[0] == "solo"): |
46 | threaded = row[0] == "threaded" | ||
47 | if(row[1] == "4"): | ||
48 | ccx = "1" | ||
49 | else: | ||
50 | ccx = "0" | ||
51 | continue | ||
52 | if(row[0] != "task id" and row[0] != ""): | ||
53 | row.append(ccx) | ||
54 | if(threaded): | ||
55 | row.append("t") | ||
56 | else: | ||
57 | row.append("s") | ||
58 | levelC.append(row) | ||
31 | #os.system('echo "L3:0=L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') | 59 | #os.system('echo "L3:0=L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') |
32 | 60 | ||
33 | with open(pathName+"/l3alloc.csv", "r") as csv_file: | 61 | with open(pathName+"/l3alloc.csv", "r") as csv_file: |
@@ -46,14 +74,95 @@ def main(): | |||
46 | 74 | ||
47 | if(core == 4): | 75 | if(core == 4): |
48 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-1") | 76 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-1") |
49 | os.system('echo "L3:0=0000, 1=' + ("%0.4x" % (int("1"*way_C, 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-0/schemata') | 77 | os.system('echo "L3:0=0000, 1=' + ("%0.4x" % (int("1"*way_C, 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-1/schemata') |
50 | os.system('mkdir /sys/fs/resctrl/level-ab-core-' + core) | 78 | os.system('mkdir /sys/fs/resctrl/level-ab-core-' + core) |
51 | if(core < 4): | 79 | if(core < 4): |
52 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | 80 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') |
53 | else: | 81 | else: |
54 | os.system('echo "L3:0=0000,1=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | 82 | os.system('echo "L3:0=0000,1=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') |
83 | pairID = 0 | ||
84 | i = 0 | ||
55 | for task in levelAB: | 85 | for task in levelAB: |
56 | 86 | i+=1 | |
87 | if(i>4): | ||
88 | break; | ||
89 | task1 = int(task[2]) | ||
90 | task2 = int(task[5]) | ||
91 | name1 = all_tasks[task1][2] | ||
92 | name2 = all_tasks[task2][2] | ||
93 | if(name1 == "rijndael_e"): | ||
94 | name1 = "rijndael_enc" | ||
95 | |||
96 | if(name2 == "rijndael_e"): | ||
97 | name2 = "rijndael_enc" | ||
98 | period1 = all_tasks[task1][5] | ||
99 | period2 = all_tasks[task2][5] | ||
100 | suite1 = all_tasks[task1][1] | ||
101 | suite2 = all_tasks[task2][1] | ||
102 | core = task[0] | ||
103 | criticality = task[1] | ||
104 | binary = "" | ||
105 | binary1 = "" | ||
106 | binary2 = "" | ||
107 | arg = "" | ||
108 | if(task1 == task2): | ||
109 | arg = " NULL -1 " + core + " NULL 0 " + period1 + " " + criticality | ||
110 | |||
111 | if(suite1 == "TACLe"): | ||
112 | binary = "./baseline/bin/" + name1 + arg | ||
113 | else: | ||
114 | binary = dis_inputs[name1] + " | ./dis/" + name1 + arg | ||
115 | proc = subprocess.open([binary + " &"], shell = True) | ||
116 | pid = proc.pid | ||
117 | os.system("echo " + pid + " > /sys/fs/resctrl/level-ab-core-" + core + "/tasks") | ||
118 | |||
119 | else: | ||
120 | pairID += 1 | ||
121 | arg1 = " NULL -1 " + core + " 0 NULL NULL 0 " + str(pairID) + " " + period1 + " " + criticality | ||
122 | arg2 = " NULL -1 " + str(int(core)+16) + " 0 NULL NULL 0 " + str(pairID) + " " + period1 + " " + criticality | ||
123 | |||
124 | if(suite1 == "TACLe"): | ||
125 | binary1 = "./all_pairs/bin/" + name1 + arg1 | ||
126 | binary2 = "./all_pairs/bin/" + name2 + arg2 | ||
127 | else: | ||
128 | binary1 = dis_inputs[name1] + " | ./dis/" + name1 + "_all" + arg1 | ||
129 | binary2 = dis_inputs[name2] + " | ./dis/" + name2 + "_all" + arg2 | ||
130 | proc1 = subprocess.Popen(["numactl --membind=0 " + binary1 + " &"], shell = True) | ||
131 | proc2 = subprocess.Popen(["numactl --membind=1 " + binary2 + " &"], shell = True) | ||
132 | pid1 = proc1.pid | ||
133 | pid2 = proc2.pid | ||
134 | |||
135 | os.system("echo " + str(pid1) + " > /sys/fs/resctrl/level-ab-core-" + core + "/tasks") | ||
136 | os.system("echo " + str(pid2) + " > /sys/fs/resctrl/level-ab-core-" + core + "/tasks") | ||
137 | |||
138 | |||
139 | for task in levelC: | ||
140 | i+=1 | ||
141 | if(i>6): | ||
142 | break | ||
143 | tid = int(task[0]) | ||
144 | name = all_tasks[tid][2] | ||
145 | period = all_tasks[tid][5] | ||
146 | suite = all_tasks[tid][1] | ||
147 | ccx = task[3] | ||
148 | threaded = task[4] == "t" | ||
149 | arg = "" | ||
150 | |||
151 | if(name == "rijndael_e"): | ||
152 | name = "rijndael_enc" | ||
153 | if(not threaded): | ||
154 | arg = " NULL -1 " + ccx + " NULL 0 " + period + " 2" | ||
155 | else: | ||
156 | pairID += 1 | ||
157 | arg = " NULL -1 " + ccx + " 0 NULL NULL 0 " + str(pairID) + " " + period + " 2" | ||
158 | if(suite1 == "TACLe"): | ||
159 | binary = "./baseline/bin/" + name1 + arg | ||
160 | else: | ||
161 | binary = dis_inputs[name1] + " | ./dis/" + name1 + "_all" + arg | ||
162 | proc = subprocess.Popen([binary + " &"], shell = True) | ||
163 | pid = proc.pid | ||
164 | os.system("echo " + str(pid) + " > /sys/fs/resctrl/level-ab-ccx-" + ccx + "/tasks") | ||
165 | #os.system("/playpen/mc2/liblitmus/release_ts") | ||
57 | #os.system("ls") | 166 | #os.system("ls") |
58 | if __name__ == "__main__": | 167 | if __name__ == "__main__": |
59 | main() | 168 | main() |