Ignore:
Timestamp:
Jun 14, 2016, 5:23:56 PM (8 years ago)
Author:
meunier
Message:
  • Improved scripts for simulations and graphes
  • Continued to clean up the lib nrc2 (from nrio2x.x to nrmem1.c)
  • Added a version (Fast - Parmerge - No stats)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/scripts/run_simus.py

    r822 r823  
    55# python 2 as it will execute on computation servers
    66
     7# TODO:
     8#       Can we do something about assert in perf eval?
    79
    810from __future__ import print_function
     
    3739
    3840# 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
     45num_app_runs = 1        # Number of times the application is launched per configuration
     46num_internal_runs = 20  # Number of times the image is processed inside the application
    4047check_results = False
    4148eval_perf = True
    4249use_valgrind = False
    4350use_rand_images = True
    44 threads = [1, 2, 4]
     51threads = [1, 2, 4, 8, 16, 32, 64]
     52#threads = [1, 2]
    4553use_dsk = True
    4654# Using dsk will store generated random images, otherwise they are re-generated at each run to save disk space
     
    4856# Configurations
    4957configs = [
    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'},
    5463        #{'SLOW':'0', 'FAST':'1', 'FEATURES':'1', 'PARMERGE':'1', 'ARSP':'0'},
    5564        #{'SLOW':'0', 'FAST':'1', 'FEATURES':'0', 'PARMERGE':'1', 'ARSP':'1'},
     
    6069rand_seed = 7
    6170granularity = 1 # constant for now
    62 img_size = 1024
     71img_size = 2048
    6372
    6473check_pyconf_file(pyconf_file)
     
    93102
    94103
     104if check_results and eval_perf:
     105    print("*** Warning: check_results and eval_perf modes are both set\n")
     106if eval_perf and use_valgrind:
     107    print("*** Warning: using valgrind while eval_perf mode is set\n")
     108if eval_perf and num_app_runs != 1:
     109    print("*** Warning: using eval_perf with num_app_runs != 1\n")
     110if check_results and num_internal_runs != 1:
     111    print("*** Warning: using check_results with num_internal_runs != 1\n")
     112
     113
    95114
    96115def gen_random_image(filename, x, y, granularity, density, seed):
     
    136155                    break
    137156            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)
    139165
    140166        f.close()
     
    179205    my_chdir(top_path)
    180206    cmd = ['make']
     207    #if eval_perf:
     208    #    cmd.extend(['IGNORE_ASSERT=true'])
    181209    print_and_call(cmd)
    182210    my_chdir(scripts_path)
     
    205233        for nthreads in threads:
    206234            perf_array[fconfig][img_basename][nthreads] = {}
    207             for run in range(num_runs):
     235            for run in range(num_app_runs):
    208236                if not os.path.exists(ref_bmpfile):
    209237                    bmpfile = ref_bmpfile
     
    223251   
    224252                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)])
    225256               
    226257                if check_results:
     
    236267
    237268                # if performance evaluation, get timing measurements
     269                # Only the last application run is considered
    238270                if eval_perf:
    239271                    for line in outlines:
     
    247279                            step = match.group(1)
    248280                            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)
    254282
    255283
     
    315343                for step in sorted(perf_array[fconfig][img_basename][nthreads].keys()):
    316344                    # 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]))
    318346
    319347        img_idx += 1
Note: See TracChangeset for help on using the changeset viewer.