Changeset 823 for soft/giet_vm/applications/rosenfeld/scripts/run_simus.py
- Timestamp:
- Jun 14, 2016, 5:23:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/scripts/run_simus.py
r822 r823 5 5 # python 2 as it will execute on computation servers 6 6 7 # TODO: 8 # Can we do something about assert in perf eval? 7 9 8 10 from __future__ import print_function … … 37 39 38 40 # Parameters 39 num_runs = 10 41 # - with eval_perf, num_internal_runs should be used, as this allows to mitigate the cost of the extra 42 # run required to have the correct "ne" value (number of labels), and only the times from last application run are taken 43 # - With check_results, num_app_runs should be used, so as to have a number of checks equals to the number of runs, 44 # because only one check per application run is performed 45 num_app_runs = 1 # Number of times the application is launched per configuration 46 num_internal_runs = 20 # Number of times the image is processed inside the application 40 47 check_results = False 41 48 eval_perf = True 42 49 use_valgrind = False 43 50 use_rand_images = True 44 threads = [1, 2, 4] 51 threads = [1, 2, 4, 8, 16, 32, 64] 52 #threads = [1, 2] 45 53 use_dsk = True 46 54 # Using dsk will store generated random images, otherwise they are re-generated at each run to save disk space … … 48 56 # Configurations 49 57 configs = [ 50 {'SLOW':'1', 'FAST':'0', 'FEATURES':'0', 'PARMERGE':'0', 'ARSP':'0'}, 51 {'SLOW':'0', 'FAST':'1', 'FEATURES':'0', 'PARMERGE':'0', 'ARSP':'0'}, 52 {'SLOW':'1', 'FAST':'0', 'FEATURES':'1', 'PARMERGE':'0', 'ARSP':'0'}, 53 {'SLOW':'0', 'FAST':'1', 'FEATURES':'1', 'PARMERGE':'0', 'ARSP':'0'}, 58 #{'SLOW':'1', 'FAST':'0', 'FEATURES':'0', 'PARMERGE':'0', 'ARSP':'0'}, 59 #{'SLOW':'0', 'FAST':'1', 'FEATURES':'0', 'PARMERGE':'0', 'ARSP':'0'}, 60 #{'SLOW':'1', 'FAST':'0', 'FEATURES':'1', 'PARMERGE':'0', 'ARSP':'0'}, 61 #{'SLOW':'0', 'FAST':'1', 'FEATURES':'1', 'PARMERGE':'0', 'ARSP':'0'}, 62 {'SLOW':'0', 'FAST':'1', 'FEATURES':'0', 'PARMERGE':'1', 'ARSP':'0'}, 54 63 #{'SLOW':'0', 'FAST':'1', 'FEATURES':'1', 'PARMERGE':'1', 'ARSP':'0'}, 55 64 #{'SLOW':'0', 'FAST':'1', 'FEATURES':'0', 'PARMERGE':'1', 'ARSP':'1'}, … … 60 69 rand_seed = 7 61 70 granularity = 1 # constant for now 62 img_size = 102471 img_size = 2048 63 72 64 73 check_pyconf_file(pyconf_file) … … 93 102 94 103 104 if check_results and eval_perf: 105 print("*** Warning: check_results and eval_perf modes are both set\n") 106 if eval_perf and use_valgrind: 107 print("*** Warning: using valgrind while eval_perf mode is set\n") 108 if eval_perf and num_app_runs != 1: 109 print("*** Warning: using eval_perf with num_app_runs != 1\n") 110 if check_results and num_internal_runs != 1: 111 print("*** Warning: using check_results with num_internal_runs != 1\n") 112 113 95 114 96 115 def gen_random_image(filename, x, y, granularity, density, seed): … … 136 155 break 137 156 if not line_with_key: 138 f.write(line) 157 if "#define MCA_VERBOSE_LEVEL" in line: 158 if eval_perf: 159 verb_level = 1 160 else: 161 verb_level = 2 162 f.write("#define MCA_VERBOSE_LEVEL %d\n" % verb_level) 163 else: 164 f.write(line) 139 165 140 166 f.close() … … 179 205 my_chdir(top_path) 180 206 cmd = ['make'] 207 #if eval_perf: 208 # cmd.extend(['IGNORE_ASSERT=true']) 181 209 print_and_call(cmd) 182 210 my_chdir(scripts_path) … … 205 233 for nthreads in threads: 206 234 perf_array[fconfig][img_basename][nthreads] = {} 207 for run in range(num_ runs):235 for run in range(num_app_runs): 208 236 if not os.path.exists(ref_bmpfile): 209 237 bmpfile = ref_bmpfile … … 223 251 224 252 cmd.extend([short_path(binary_file), '-n', str(nthreads), '-i', short_path(image)]) 253 254 if num_internal_runs > 1: 255 cmd.extend(['-r', str(num_internal_runs)]) 225 256 226 257 if check_results: … … 236 267 237 268 # if performance evaluation, get timing measurements 269 # Only the last application run is considered 238 270 if eval_perf: 239 271 for line in outlines: … … 247 279 step = match.group(1) 248 280 value = tokens[len(tokens) - 1] 249 if step in perf_array[fconfig][img_basename][nthreads]: 250 # Accumulating times over the num_runs runs 251 perf_array[fconfig][img_basename][nthreads][step] += int(value) 252 else: 253 perf_array[fconfig][img_basename][nthreads][step] = int(value) 281 perf_array[fconfig][img_basename][nthreads][step] = int(value) 254 282 255 283 … … 315 343 for step in sorted(perf_array[fconfig][img_basename][nthreads].keys()): 316 344 # Average time for each step 317 file.write("[STEP_%s] %d\n" % (step, perf_array[fconfig][img_basename][nthreads][step] / num_runs))345 file.write("[STEP_%s] %d\n" % (step, perf_array[fconfig][img_basename][nthreads][step])) 318 346 319 347 img_idx += 1
Note: See TracChangeset
for help on using the changeset viewer.