<filename>src/tritonsort/benchmarks/mixediobench/run_benchmark.py<gh_stars>10-100
#!/usr/bin/env python

import os, sys, argparse

BENCHMARK_DIR = os.path.dirname(os.path.abspath(__file__))

THEMIS_SCRIPTS_DIR = os.path.join(
    BENCHMARK_DIR, os.pardir, os.pardir, os.pardir, "scripts", "themis")

CLUSTER_SCRIPTS_DIR = os.path.join(THEMIS_SCRIPTS_DIR, "cluster")

# Prepend so we can get the other run_benchmark module
sys.path.insert(0, THEMIS_SCRIPTS_DIR)

from run_benchmark import run_benchmark_iterations
import utils

sys.path.append(CLUSTER_SCRIPTS_DIR)

from conf_utils import read_conf_file

def main():
    log_directory = read_conf_file("cluster.conf", "cluster", "log_directory")
    log_directory = os.path.expanduser(log_directory)
    log_directory = os.path.join(log_directory, "mixediobench")

    parser = argparse.ArgumentParser(
        description="Harness for mixed I/O benchmark application")
    parser.add_argument(
        "--config", "-c", help="config file to use for the benchmark "
        "(default: %(default)s)",
        default=os.path.join(BENCHMARK_DIR, "config.yaml"), type=str)
    parser.add_argument(
        "--log_directory", "-l",
        help="directory containing logs for an experiment "
        "(default: %(default)s)",
        default=log_directory)
    parser.add_argument(
        "--profiler", help="path to the binary of a profiling tool to use, for "
        "example valgrind or operf")
    parser.add_argument(
        "--profiler_options", help="options surrounded by quotes to pass to "
        "the profiler", type=str, default="")
    parser.add_argument(
        "--iterations", "-i", help="run the benchmark this many times "
        "(default: %(default)s)", type=int, default=1)
    parser.add_argument(
        "--sleep", "-s", help="sleep this many seconds between iterations "
        "(default: %(default)s)", type=int, default=0)
    parser.add_argument(
        "--delete_output", help="delete output files after run completes",
        action="store_true", default=False)
    parser.add_argument(
        "--per_peer_config", help="use separate config files for each peer, by "
        "appending the peer's IP address to the config file name: .A.B.C.D",
        action="store_true", default=False)
    parser.add_argument(
        "--dump_core_directory", "-d", help="dump core file to this directory "
        "if the benchmark crashes", default=None)
    parser.add_argument(
        "peer_ips", help="comma delimited list of host IPs to use for "
        "benchmarking")

    utils.add_interfaces_params(parser)

    args = parser.parse_args()
    binary = os.path.join(BENCHMARK_DIR, "mixediobench")
    solo_mode = False
    stage_stats = "reader,sender,receiver,writer"

    run_benchmark_iterations(
        binary, args.log_directory, args.config, args.peer_ips, args.profiler,
        args.profiler_options, args.iterations, args.sleep, args.delete_output,
        args.per_peer_config, args.dump_core_directory, solo_mode,
        stage_stats, args.interfaces)

if __name__ == "__main__":
    sys.exit(main())

<filename>src/tritonsort/benchmarks/mixediobench/run_benchmark.py<gh_stars>10-100
#!/usr/bin/env python

import os, sys, argparse

BENCHMARK_DIR = os.path.dirname(os.path.abspath(__file__))

THEMIS_SCRIPTS_DIR = os.path.join(
    BENCHMARK_DIR, os.pardir, os.pardir, os.pardir, "scripts", "themis")

CLUSTER_SCRIPTS_DIR = os.path.join(THEMIS_SCRIPTS_DIR, "cluster")

# Prepend so we can get the other run_benchmark module
sys.path.insert(0, THEMIS_SCRIPTS_DIR)

from run_benchmark import run_benchmark_iterations
import utils

sys.path.append(CLUSTER_SCRIPTS_DIR)

from conf_utils import read_conf_file

def main():
    log_directory = read_conf_file("cluster.conf", "cluster", "log_directory")
    log_directory = os.path.expanduser(log_directory)
    log_directory = os.path.join(log_directory, "mixediobench")

    parser = argparse.ArgumentParser(
        description="Harness for mixed I/O benchmark application")
    parser.add_argument(
        "--config", "-c", help="config file to use for the benchmark "
        "(default: %(default)s)",
        default=os.path.join(BENCHMARK_DIR, "config.yaml"), type=str)
    parser.add_argument(
        "--log_directory", "-l",
        help="directory containing logs for an experiment "
        "(default: %(default)s)",
        default=log_directory)
    parser.add_argument(
        "--profiler", help="path to the binary of a profiling tool to use, for "
        "example valgrind or operf")
    parser.add_argument(
        "--profiler_options", help="options surrounded by quotes to pass to "
        "the profiler", type=str, default="")
    parser.add_argument(
        "--iterations", "-i", help="run the benchmark this many times "
        "(default: %(default)s)", type=int, default=1)
    parser.add_argument(
        "--sleep", "-s", help="sleep this many seconds between iterations "
        "(default: %(default)s)", type=int, default=0)
    parser.add_argument(
        "--delete_output", help="delete output files after run completes",
        action="store_true", default=False)
    parser.add_argument(
        "--per_peer_config", help="use separate config files for each peer, by "
        "appending the peer's IP address to the config file name: .A.B.C.D",
        action="store_true", default=False)
    parser.add_argument(
        "--dump_core_directory", "-d", help="dump core file to this directory "
        "if the benchmark crashes", default=None)
    parser.add_argument(
        "peer_ips", help="comma delimited list of host IPs to use for "
        "benchmarking")

    utils.add_interfaces_params(parser)

    args = parser.parse_args()
    binary = os.path.join(BENCHMARK_DIR, "mixediobench")
    solo_mode = False
    stage_stats = "reader,sender,receiver,writer"

    run_benchmark_iterations(
        binary, args.log_directory, args.config, args.peer_ips, args.profiler,
        args.profiler_options, args.iterations, args.sleep, args.delete_output,
        args.per_peer_config, args.dump_core_directory, solo_mode,
        stage_stats, args.interfaces)

if __name__ == "__main__":
    sys.exit(main())

#!/usr/bin/env python # Prepend so we can get the other run_benchmark module