def process_results(branches, output_mode): """Runs statistics on the results and pretty prints them. """ anymean = config.ANYMEAN_PATH significance = config.SIGNIFICANCE_PATH result_paths = [] counter = 0 for branch in branches: counter += 1 runlog = os.path.join(config.WORK_DIR, "runlog.%d" % counter) result_path = os.path.join(config.WORK_DIR, branch.result_file()) with open(result_path, 'w') as result_file: cmd = "{anymean} --geomean {runlog}" utils.run_command(cmd.format(anymean=anymean, runlog=runlog), stdout=result_file, verbose=verbose() > 0) result_paths.append(result_path) cmd = "{significance} --{output_mode} {results}" utils.run_command(cmd.format(significance=significance, output_mode=output_mode, results=' '.join(result_paths)), stdout=sys.stdout, verbose=verbose() > 0)
def switch_to_branch(self, branch): """Switches the current repository to the specified branch. This function will always be invoked prior to building a branch. """ utils.run_command('arc feature {0!s}'.format(branch.name))
def process_results(branches, output_mode): """Runs statistics on the results and pretty prints them. """ anymean = config.ANYMEAN_PATH significance = config.SIGNIFICANCE_PATH result_paths = [] counter = 0 for branch in branches: counter += 1 runlog = os.path.join(config.WORK_DIR, "runlog.%d" % counter) result_path = os.path.join(config.WORK_DIR, branch.result_file()) with open(result_path, 'w') as result_file: cmd = "{anymean} --geomean {runlog}" utils.run_command(cmd.format(anymean=anymean, runlog=runlog), stdout=result_file, verbose=verbose() > 0) result_paths.append(result_path) cmd = "{significance} --{output_mode} {results}" utils.run_command(cmd.format(significance=significance, output_mode=output_mode, results=' '.join(result_paths)), stdout=sys.stdout, verbose=verbose() > 0)
def switch_to_branch(self, branch): """Switches the current repository to the specified branch. This function will always be invoked prior to building a branch. """ utils.run_command('git checkout %s' % branch.name)
def run_benchmarks(suites, benchmarks, run_perf, warmup, inner, outer, branches): """Runs the benchmarks on the branches by invoking the harness script. """ benchy_path = config.HARNESS_PATH suite_str = " ".join(["--suite %s" % s for s in suites]) benchmark_str = " ".join(["--benchmark %s" % b for b in benchmarks]) perf_str = "--perf" if run_perf else "" warmup_str = "" if warmup is None else "--warmup {0}".format(warmup) inner_str = "" if inner is None else "--inner {0}".format(inner) outer_str = "" if outer is None else "--outer {0}".format(outer) branch_str = " ".join([b.format() for b in branches]) command = "{harness} {suites} {benchmarks} {perf} " "{warmup} {inner} {outer} {branch}" utils.run_command( command.format( harness=benchy_path, suites=suite_str, benchmarks=benchmark_str, perf=perf_str, warmup=warmup_str, inner=inner_str, outer=outer_str, branch=branch_str, ) )
def run_benchmarks(suites, benchmarks, run_perf, warmup, inner, outer, branches): """Runs the benchmarks on the branches by invoking the harness script. """ benchy_path = config.HARNESS_PATH suite_str = ' '.join(["--suite %s" % s for s in suites]) benchmark_str = ' '.join(["--benchmark %s" % b for b in benchmarks]) perf_str = '--perf' if run_perf else '' warmup_str = '' if warmup is None else '--warmup {0}'.format(warmup) inner_str = '' if inner is None else '--inner {0}'.format(inner) outer_str = '' if outer is None else '--outer {0}'.format(outer) branch_str = ' '.join([b.format() for b in branches]) command = ("{harness} {suites} {benchmarks} {perf} " "{warmup} {inner} {outer} {branch}") utils.run_command( command.format(harness=benchy_path, suites=suite_str, benchmarks=benchmark_str, perf=perf_str, warmup=warmup_str, inner=inner_str, outer=outer_str, branch=branch_str))
def build_branch(self, branch): """Builds the specified branch. This function will always be invoked after switching to a branch. """ build_dir = branch.build_dir() utils.run_command('fbmake clean') env = os.environ.copy() env['FBMAKE_BUILD_ROOT'] = build_dir utils.run_command('/usr/local/bin/fbmake --build-root "%s" ' '--ccache=off --distcc=on opt -j9000' % build_dir, env=env)
def build_branch(self, branch): """Builds the specified branch. This function will always be invoked after switching to a branch. """ build_dir = branch.build_dir() utils.run_command('fbmake clean') env = os.environ.copy() env['FBMAKE_BUILD_ROOT'] = build_dir utils.run_command('/usr/local/bin/fbmake --build-root "%s" ' '--ccache=off --distcc=on opt -j9000' % build_dir, env=env)
def build_branch(self, branch): """Builds the specified branch. This function will always be invoked after switching to a branch. """ before_dir = os.getcwd() build_dir = branch.build_dir() try: print(build_dir) os.chdir(build_dir) utils.run_command('cmake %s' % config.SRCROOT_PATH) utils.run_command('make -j%d' % multiprocessing.cpu_count()) finally: os.chdir(before_dir)
def build_branch(self, branch): """Builds the specified branch. This function will always be invoked after switching to a branch. """ build_dir = branch.build_dir() build_link = os.path.join(config.SRCROOT_PATH, '_build') if os.path.islink(build_link): os.remove(build_link) else: shutil.rmtree(build_link, ignore_errors=True) env = os.environ.copy() env['FBMAKE_BUILD_ROOT'] = build_dir cpus = multiprocessing.cpu_count() utils.run_command('/usr/local/bin/fbmake --build-root "%s" ' '--distcc=off opt -j%d' % (build_dir, cpus), env=env)
def build_branch(self, branch): """Builds the specified branch. This function will always be invoked after switching to a branch. """ build_dir = branch.build_dir() build_link = os.path.join(config.SRCROOT_PATH, '_build') if os.path.islink(build_link): os.remove(build_link) else: shutil.rmtree(build_link, ignore_errors=True) env = os.environ.copy() env['FBMAKE_BUILD_ROOT'] = build_dir cpus = multiprocessing.cpu_count() utils.run_command('/usr/local/bin/fbmake --build-root "%s" ' '--distcc=off opt -j%d' % (build_dir, cpus), env=env)
def run_benchmarks(suites, benchmarks, run_perf, inner, outer, branches): """Runs the benchmarks on the branches by invoking the harness script. """ benchy_path = config.HARNESS_PATH suite_str = ' '.join(["--suite %s" % s for s in suites]) benchmark_str = ' '.join(["--benchmark %s" % b for b in benchmarks]) perf_str = '--perf' if run_perf else '' inner_str = '' if inner is None else '--inner {0}'.format(inner) outer_str = '' if outer is None else '--outer {0}'.format(outer) branch_str = ' '.join([b.format() for b in branches]) command = "{harness} {suites} {benchmarks} {perf} {inner} {outer} {branch}" utils.run_command(command.format(harness=benchy_path, suites=suite_str, benchmarks=benchmark_str, perf=perf_str, inner=inner_str, outer=outer_str, branch=branch_str), verbose=verbose() > 0)