run_benchmarks.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:veros 作者: dionhaefner 项目源码 文件源码
def parse_cli():
    parser = argparse.ArgumentParser(description="Run Veros benchmarks")
    parser.add_argument("-f", "--fortran-library", type=str, help="Path to pyOM2 fortran library")
    parser.add_argument("-s", "--sizes", nargs="*", type=float, required=True,
                        help="Problem sizes to test (total number of elements)")
    parser.add_argument("-c", "--components", nargs="*", choices=COMPONENTS, default=["numpy"], metavar="COMPONENT",
                        help="Numerical backend components to benchmark (possible values: {})".format(", ".join(COMPONENTS)))
    parser.add_argument("-n", "--nproc", type=int, default=multiprocessing.cpu_count(),
                        help="Number of processes / threads for parallel execution")
    parser.add_argument("-o", "--outfile", default="benchmark_{}.json".format(time.time()), help="JSON file to write timings to")
    parser.add_argument("-t", "--timesteps", default=1000, type=int, help="Number of time steps that each benchmark is run for")
    parser.add_argument("--only", nargs="*", default=AVAILABLE_BENCHMARKS,
                        help="Run only these benchmarks (possible values: {})".format(", ".join(AVAILABLE_BENCHMARKS)),
                        choices=AVAILABLE_BENCHMARKS, required=False, metavar="BENCHMARK")
    parser.add_argument("--mpiexec", default="mpiexec", help="Executable used for calling MPI (e.g. mpirun, mpiexec)")
    parser.add_argument("--slurm", action="store_true", help="Run benchmarks using SLURM scheduling command (srun)")
    parser.add_argument("--debug", action="store_true", help="Additionally print each command that is executed")
    parser.add_argument("--float-type", default="float64", help="Data type for floating point arrays in Veros components")
    parser.add_argument("--burnin", default=3, type=int, help="Number of iterations to exclude in timings")
    return parser.parse_args()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号