def get_runtime(length):
    filename = os.path.join('tmp', 'hdf5', 'many_runs.hdf5')

    with Environment(filename = filename,
                      log_levels=50, report_progress=(0.0002, 'progress', 50),
                      overwrite_file=True, purge_duplicate_comments=False,
                      log_stdout=False,
                      multiproc=False, ncores=2, use_pool=True,
                      wrap_mode='PIPE', #freeze_input=True,
                      summary_tables=False, small_overview_tables=False) as env:

        traj = env.v_traj

        traj.par.f_apar('x', 0, 'parameter')

        traj.f_explore({'x': range(length)})

        # traj.v_full_copy = False

        max_run = 1000

        for idx in range(len(traj)):
            if idx > max_run:
                traj.f_get_run_information(idx, copy=False)['completed'] = 1
        start = time.time()
        env.f_run(job)
        end = time.time()
        # dicts = [traj.f_get_run_information(x) for x in range(min(len(traj), max_run))]
    total = end - start
    return total/float(min(len(traj), max_run)), total/float(min(len(traj), max_run)) * len(traj)
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/tests/profiling/speed_analysis/avg_runtima_as_function_of_length.py/get_runtime/original