Ejemplo n.º 1
0
def test_scalability(args):
    """Test scalability of manycore

    @return True if all tasks are finished.
    """
    ndisks = 1
    ndirs = 1
    no_journal = args.no_journal

    check_point = checkpoint.Checkpoint('scale_checkpoint.log')
    output_dir = ''
    if check_point.outdir:
        output_dir = check_point.outdir
    else:
        now = datetime.now()
        output_dir = 'filebench_scale_' + now.strftime('%Y_%m_%d_%H_%M')
        if os.path.exists(output_dir):
            shutil.rmtree(output_dir)
        os.makedirs(output_dir)
        check_point.set_outdir(output_dir)

    test_conf = {
        'test': 'scale',
        'filesystems': args.formats,
        'workloads': args.workloads,
        'iteration': args.iteration,
        'processes': str(list(range(4, 96, 12))),
        'ndisks': ndisks,
        'ndirs': ndirs,
        'mount_options': 'noatime,nodirtime',
    }
    mfsbase.dump_configure(test_conf, os.path.join(output_dir, 'testmeta.txt'))

    steps = 0
    for fs in args.formats.split(','):
        for wl in args.workloads.split(','):
            for nproc in map(int, args.nproc):
                for i in range(args.iteration):
                    steps += 1
                    if check_point.steps >= steps:
                        continue
                    check_point.start()
                    print('Run scalability test')
                    output_prefix = '{}/scale_{}_{}_{}_{}_{}_{}'.format(
                        output_dir, fs, wl, ndisks, ndirs, nproc, i)
                    prepare_disks('ramdisks', ndisks, ndirs, fs=fs,
                                  no_journal=no_journal)
                    if not run_filebench(wl, ndisks=ndisks, ndirs=ndirs,
                                         nprocs=nproc,
                                         threads=1, output=output_prefix,
                                         events=args.events,
                                         vmlinux=args.vmlinux,
                                         kallsyms=args.kallsyms,
                                         no_profile=args.no_profile):
                        print('Failed to execute run_filebench')
                        return False
                    check_point.done()

    return True
Ejemplo n.º 2
0
def test_multi_filesystem(args):
    """Test on multiple file systems.
    """
    ndirs = 1
    nprocs = 96
    check_point = create_checkpoint('multifs_checkpoint.log',
                                    'filebench_multifs')

    test_conf = {
        'test': 'multi_filesystem',
        'filesystems': args.formats,
        'workloads': args.workloads,
        'iteration': args.iteration,
        'ndisks': args.ndisks,
        'ndirs': ndirs,
        'mount_options': 'noatime,nodirtime',
    }
    mfsbase.dump_configure(test_conf,
                           os.path.join(check_point.outdir, 'testmeta.txt'))

    steps = 0
    for fs in args.formats.split(','):
        for wl in args.workloads.split(','):
            for num_disks in args.ndisks:
                for num_dirs in range(1, ndirs + 1):
                    for i in range(args.iteration):
                        steps += 1
                        if check_point.should_skip(steps):
                            continue
                        check_point.start()
                        retry = args.retry
                        print("Run multi-filesystem test: " +
                              "{} disk {} dirs".format(num_disks, num_dirs))
                        output_prefix = '{}/multifs_{}_{}_{}_{}_{}_{}'.format(
                            check_point.outdir, fs, wl, num_disks, ndirs,
                            nprocs, i)
                        while retry:
                            prepare_disks('ramdisks', num_disks, num_dirs,
                                          fs=fs, no_journal=args.no_journal)
                            if not run_filebench(
                                    wl, ndisks=num_disks, ndirs=num_dirs,
                                    nprocs=int(nprocs / num_disks), threads=1,
                                    output=output_prefix,
                                    events=args.events,
                                    vmlinux=args.vmlinux,
                                    kallsyms=args.kallsyms,
                                    no_profile=args.no_profile,
                                    affinity=True):
                                print('Failed to execute run_filebench')
                                retry -= 1
                                continue
                            break
                        if retry > 0:
                            check_point.done()
                        else:
                            return False
    return True
Ejemplo n.º 3
0
def test_numa(args):
    """Test how NUMA architecture affects the filebench performance.
    """
    CPU_CONFS = ['0-23', '0-11,24-35', '0-5,12-17,24-29,36-41',
                 '0-2,6-8,12-14,18-20,24-26,30-32,36-38,42-44']
    ndisks = args.disks
    ndirs = args.dirs
    nproc = 48

    # Prepare output disk
    check_point = create_checkpoint('numa_checkpoint.log', 'filebench_numa')
    test_conf = {
        'test': 'numa',
        'filesystems': args.formats,
        'workloads': args.workloads,
        'iteration': args.iteration,
        'ndisks': ndisks,
        'ndirs': ndirs,
        'mount_options': 'noatime,nodirtime',
    }
    mfsbase.dump_configure(test_conf,
                           os.path.join(check_point.outdir, 'testmeta.txt'))

    steps = 0
    for fs in args.formats.split(','):
        for wl in args.workloads.split(','):
            for cpus in CPU_CONFS:
                set_cpus.set_cpus(cpus)
                for i in range(args.iteration):
                    steps += 1
                    if check_point.should_skip(steps):
                        continue
                    check_point.start()
                    output_prefix = '{}/numa_{}_{}_{}_{}_{}_{}'.format(
                        check_point.outdir, fs, wl, ndisks, ndirs, cpus, i)
                    print('Run NUMA test on CPUs {} for iteration {}'
                          .format(cpus, i))
                    retry = args.retry
                    while retry:
                        prepare_disks('ramdisks', ndisks, ndirs, fs=fs,
                                      no_journal=args.no_journal)
                        if run_filebench(wl, ndisks=ndisks, ndirs=ndirs,
                                         nprocs=nproc,
                                         threads=1, output=output_prefix,
                                         events=args.events,
                                         vmlinux=args.vmlinux,
                                         kallsyms=args.kallsyms,
                                         no_profile=args.no_profile):
                            break
                        print('Failed to execute run_filebench')
                        retry -= 1
                    if not retry:
                        set_cpus.reset()
                        return False
                    check_point.done()
            set_cpus.reset()
    return True
Ejemplo n.º 4
0
def test_cpu_scale(args):
    """Run benchmark with different active CPUs.
    """
    ndisks = 1
    ndirs = 1
    no_journal = args.no_journal

    check_point = checkpoint.Checkpoint('cpu_checkpoint.log')
    output_dir = ''
    if check_point.outdir:
        output_dir = check_point.outdir
    else:
        now = datetime.now()
        output_dir = 'filebench_cpuscale_' + now.strftime('%Y_%m_%d_%H_%M')
        if os.path.exists(output_dir):
            shutil.rmtree(output_dir)
        os.makedirs(output_dir)
        check_point.set_outdir(output_dir)

    test_conf = {
        'test': 'cpu_scale',
        'filesystems': args.formats,
        'workloads': args.workloads,
        'iteration': args.iteration,
        'processes': str(list(range(4, 96, 12))),
        'ndisks': ndisks,
        'ndirs': ndirs,
        'mount_options': 'noatime,nodirtime',
    }
    mfsbase.dump_configure(test_conf, os.path.join(output_dir, 'testmeta.txt'))

    steps = 0
    nproc = args.process
    for fs in args.formats.split(','):
        for wl in args.workloads.split(','):
            for ncpus in map(int, args.cpus):
                cpus = "0-{}".format(ncpus - 1)
                print('CPU scale test: cpus: {}, fs: {}, workload: {}'.format(
                    cpus, fs, wl))
                set_cpus.set_cpus(cpus)
                for i in range(args.iteration):
                    steps += 1
                    if check_point.should_skip(steps):
                        continue
                    check_point.start()
                    retry = args.retry
                    print('Run CPU scalability test')
                    output_prefix = '{}/cpuscale_{}_{}_{}_{}_{}_{}'.format(
                        output_dir, fs, wl, ndisks, ndirs, ncpus, i)
                    while retry:
                        prepare_disks('ramdisks', ndisks, ndirs, fs=fs,
                                      no_journal=no_journal)
                        if not run_filebench(wl, ndisks=ndisks, ndirs=ndirs,
                                             nprocs=nproc,
                                             threads=1, output=output_prefix,
                                             events=args.events,
                                             vmlinux=args.vmlinux,
                                             kallsyms=args.kallsyms,
                                             no_profile=args.no_profile):
                            # set_cpus.reset()
                            print('Failed to execute run_filebench')
                            retry -= 1
                            continue
                        break
                    if retry > 0:
                        check_point.done()
                    else:
                        set_cpus.reset()
                        return False
                set_cpus.reset()
    return True