Changeset 823 for soft/giet_vm/applications/rosenfeld/scripts
- Timestamp:
- Jun 14, 2016, 5:23:56 PM (9 years ago)
- Location:
- soft/giet_vm/applications/rosenfeld/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/scripts/create_graph.py
r822 r823 16 16 import filecmp 17 17 import random 18 import math 18 19 19 20 from stack import Stack … … 23 24 24 25 use_rand_images = True 25 with_features = True26 with_features = False 26 27 27 threads = [1, 2, 4] 28 nb_step = 0 28 threads = [1, 2, 4, 8, 16, 32, 64] 29 29 use_dsk = True 30 img_size = 102430 img_size = 2048 31 31 granularity = 1 32 32 rand_seed = 7 … … 42 42 # Each of these configuration must have been run with both features activated and deactivated 43 43 configs = [ 44 {'SLOW':'1', 'FAST':'0', 'PARMERGE':'0', 'ARSP':'0'},45 {'SLOW':'0', 'FAST':'1', 'PARMERGE':'0', 'ARSP':'0'},46 44 #{'SLOW':'1', 'FAST':'0', 'PARMERGE':'0', 'ARSP':'0'}, 47 45 #{'SLOW':'0', 'FAST':'1', 'PARMERGE':'0', 'ARSP':'0'}, 48 46 #{'SLOW':'0', 'FAST':'1', 'PARMERGE':'1', 'ARSP':'0'}, 49 #{'SLOW':'0', 'FAST':'1', 'PARMERGE':'1', 'ARSP':'1'},47 {'SLOW':'0', 'FAST':'1', 'PARMERGE':'1', 'ARSP':'1'}, 50 48 ] 51 49 … … 55 53 code = compile(f.read(), pyconf_file, 'exec') 56 54 exec(code) 55 56 nb_step = 0 57 57 58 58 if use_dsk: … … 125 125 plotter.add_x(X) 126 126 assert(nb_step == 4) 127 YPAR1 = [float( exec_time[fconfig][thread]["NF"][density][0]) for density in range(0, 101)] # Parallel Labeling128 YPAR2 = [float( exec_time[fconfig][thread]["NF"][density][1]) for density in range(0, 101)] # Merging (Parallel or Pyramidal)129 YPTC2 = [float( exec_time[fconfig][thread]["NF"][density][2]) for density in range(0, 101)] # Parallel Transitive Closure130 YPAR3 = [float( exec_time[fconfig][thread]["NF"][density][3]) for density in range(0, 101)] # Parallel Relabeling127 YPAR1 = [float(int(exec_time[fconfig][thread]["NF"][density][0]) / math.pow(img_size, 2)) for density in range(0, 101)] # Parallel Labeling 128 YPAR2 = [float(int(exec_time[fconfig][thread]["NF"][density][1]) / math.pow(img_size, 2)) for density in range(0, 101)] # Merging (Parallel or Pyramidal) 129 YPTC2 = [float(int(exec_time[fconfig][thread]["NF"][density][2]) / math.pow(img_size, 2)) for density in range(0, 101)] # Parallel Transitive Closure 130 YPAR3 = [float(int(exec_time[fconfig][thread]["NF"][density][3]) / math.pow(img_size, 2)) for density in range(0, 101)] # Parallel Relabeling 131 131 132 132 plotter.add_y(YPAR1) … … 136 136 137 137 if with_features: 138 YPAR1f = [float( exec_time[fconfig][thread]["FT"][density][0]) for density in range(0, 101)] # Parallel Labeling139 YPAR2f = [float( exec_time[fconfig][thread]["FT"][density][1]) for density in range(0, 101)] # Merging (Parallel or Pyramidal)138 YPAR1f = [float(int(exec_time[fconfig][thread]["FT"][density][0]) / math.pow(img_size, 2)) for density in range(0, 101)] # Parallel Labeling 139 YPAR2f = [float(int(exec_time[fconfig][thread]["FT"][density][1]) / math.pow(img_size, 2)) for density in range(0, 101)] # Merging (Parallel or Pyramidal) 140 140 deltaYPAR1 = [max(0, x - y) for x, y in zip (YPAR1f, YPAR1)] 141 141 deltaYPAR2 = [max(0, x - y) for x, y in zip (YPAR2f, YPAR2)] -
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.