这是实验室研究的实验司机
benchbuild的Python项目详细描述
Benchbuild:实证研究工具包
benchbuild提供了一个轻量级工具包,用于进行经验编译时和运行时实验。 它致力于自动化所有繁琐且容易出错的任务,下载、配置和构建所有受支持的项目,并提供工具,用自定义的度量值包装编译器和任何生成的二进制文件。
所有结果都可以按照用户的要求存储。 benchbuild在自己的数据库中跟踪其所有托管项目的执行状态。
功能
- 用python编写的任意测量函数包装编译命令。
- 用python编写的任意测量函数包装二进制命令。
- 使用slurm集群管理器进行并行基准测试。
安装
Benchbuild可通过PYPI获得。您可以使用PIP安装最新版本。
# Global install $ pip install benchbuild # Lokal install $ pip install --user benchbuild # Recommended: Install into a virutalenv. $ virtualenv benchbuild ... $ source benchbuild/bin/activate ... $ pip install benchbuild
安装后,您可以在前端使用benchbuildbenchbuild
。
如果没有参数,您将收到以下帮助输出:
benchbuild 3.3.1.dev1+gf43b2d0 Frontend for running/building the benchbuild study framework. Usage: benchbuild [SWITCHES][SUBCOMMAND [SWITCHES]] args... Meta-switches: -h, --help Prints this help message and quits --help-all Print help messages of all subcommands and quit --version Prints the program's version and quitsSwitches: -d Enable debugging output -v Enable verbose output; may be given multiple timesSubcommands: bootstrap Bootstrap benchbuild external dependencies, if possible.; see 'benchbuild bootstrap --help' for more info config Manage BenchBuild's configuration.; see 'benchbuild config --help'for more info experiment Manage BenchBuild's known experiments.; see 'benchbuild experiment --help' for more info log Frontend command to the benchbuild database. ; see 'benchbuild log --help' for more info project Manage BenchBuild's known projects.; see 'benchbuild project --help'for more info report Generate Reports from the benchbuild db.; see 'benchbuild report --help'for more info run Frontend for running experiments in the benchbuild study framework.; see 'benchbuild run --help'for more info slurm Generate a SLURM script. ; see 'benchbuild slurm --help'for more info
现在可以开始使用benchbuild。但是,您可能需要根据需要配置benchbuild。因此,建议首先生成默认配置。
$ benchbuild config write
这将在当前目录中放置一个.benchbuild.yml,其中包含 你的系统。您可以根据需要修改配置,大多数配置选项 在配置文件中用说明进行说明。
重要配置选项
以下配置选项对于benchbuild的行为非常重要。
build_dir (BB_BUILD_DIR):
All generated artifacts will be placed in this directory. By default, it will be cleaned
at the end of an experiment.
db (BB_DB_*):
connect_str (BB_DB_CONNECT_STR):
You need to place a valid sqlalchemy connect string here. It will be used to establish a
database connection.
By default an in-memory SQLite database is used (sqlite:///).
env (BB_ENV_*):
ld_library_path (BB_LD_LIBRARY_PATH):
Modify benchbuild's LD_LIBRARY_PATH variable. You can use this to provide access to
libraries outside of the system's default library search path.
path (BB_PATH):
Modify benchbuild's PATH variable. You can use this to provide access to
binaries outside of the system's default binary search path.
home (BB_HOME):
Modify benchbuild's HOME variable. You can use this to set a custom home
directory, if the default home is not available to benchbuild.
test_dir (BB_TEST_DIR):
Some distributed projects require additional test-inputs that are too big for
distribution with benchbuild. Therefore, there exists an additional repository (private)
that contains the input files for these projects. Please contact the authors for access
to this repository, if you need run-time tests with these projects.
tmp_dir (BB_TMP_DIR):
BenchBuild will download the source code for all projects into this directory. We avoid
repeated downloads by caching them here. This directory won't be cleaned and all downloads
are hashed. If you want to re-download the source, just delete the hash file (or the source file).
unionfs (BB_UNIONFS_*):
unionfs_enable: (BB_UNIONFS_ENABLE):
Enable/Disable unionfs features. By default unionfs is switched off. If you enable unionfs,
all projects will be wrapped in two layers: One read-only layer containing the prepared
source files and one writeable layer. This way you can easily run different configurations
without wiping the build-directory completely. As this requires additional setup, it is
not recommended to be switched on by default.
数据库
benchbuild将实验的结果/维护数据存储在数据库中。 虽然默认情况下使用的是sqlite3内存数据库,但您可能希望提供一个更持久的解决方案来保持实验数据的持久性。
PostgreSQL
首选的方法是使用更复杂的dbms,如postgresql。 如果你重新使用slurm等功能,确保可以从所有可能运行benchbuild的节点访问dbms。
用一个用户和一个数据库设置Postgres群集,以便BenchBuilder使用。
CREATEUSERbenchbuild;CREATEDATABASEbenchbuild;
在配置中,您以sqlalchemy的格式提供完整的连接字符串,例如:postgresql+psycopg2://benchbuild:benchbuild@localhost:5432/benchbuild
# .benchbuild.ymldb:connect_string:default:sqlite://value:postgresql+psycopg2://benchbuild:benchbuild@localhost:5432/benchbuild
sqlite
如前所述,默认情况下,我们使用内存中的sqlite数据库。通过在数据库配置中提供文件名,您可以将此文件保存在本地使用。
# .benchbuild.ymldb:connect_string:default:sqlite://value:sqlite:////absolute/path/to/sqlite.db
高级功能
高级功能需要在您的系统上附加软件包。
工会
我们可以为基于uchroot的项目维护unionfs挂载,例如所有gentoo派生的项目。 这避免了容器文件系统的连续解包,并将一个解包版本保持为 文件系统堆栈底部的只读层。
您需要在/etc/subuid
/etc/subgid
中为
在此模式下运行benchbuild
。此外,你需要一个工作保险丝安装。这涉及到
安装带有标题的libfuse
。
benchbuild bootstrap
命令可以帮助您进行安装和设置。
配置
benchbuild
可以通过多种方式进行配置:(1)命令行参数,(2)json格式的配置文件,(3)环境变量。
您可以使用以下命令转储当前活动配置:
benchbuild run -d
文档
有关详细的API信息,请参阅 文档:
您可以使用以下命令以yaml格式转储此信息:
benchbuild run -s
它将所有配置转储到yaml,甚至是那些通常自动派生的配置(比如uuid)。 在未来,这将自动避免。 现在,您应该从生成的yaml文件中删除所有与id相关的变量。 配置文件将自动从当前目录向上搜索。 一些关键配置变量:
# Global install $ pip install benchbuild # Lokal install $ pip install --user benchbuild # Recommended: Install into a virutalenv. $ virtualenv benchbuild ... $ source benchbuild/bin/activate ... $ pip install benchbuild0
您可以在.json配置文件中或直接通过环境设置这些 变量。但是,请确保从 环境是有效的json,或者配置结构可以忽略 您的输入(或中断)。
泥浆配置
如果要在由管理的群集上并行运行实验 slurm,您可以使用benchbuild生成bash脚本 与slurm的sbatch命令兼容。以下设置控件 slurm的配置:
# Global install $ pip install benchbuild # Lokal install $ pip install --user benchbuild # Recommended: Install into a virutalenv. $ virtualenv benchbuild ... $ source benchbuild/bin/activate ... $ pip install benchbuild1
Gentoo配置
benchbuild支持在完整的移植上进行编译时实验 Gentoo Linux之树。您需要配置一些设置才能完成 作品:
# Global install $ pip install benchbuild # Lokal install $ pip install --user benchbuild # Recommended: Install into a virutalenv. $ virtualenv benchbuild ... $ source benchbuild/bin/activate ... $ pip install benchbuild2
将自动gentoo项目转换为静态项目
gentoo项目是基于autoportage动态生成的
类位于
pprof.gentoo.portage\u gen
中。如果你想定义
对于动态生成的项目,需要转换
它是静态的,即定义一个子类autoportage
并添加它
配置。
# Global install $ pip install benchbuild # Lokal install $ pip install --user benchbuild # Recommended: Install into a virutalenv. $ virtualenv benchbuild ... $ source benchbuild/bin/activate ... $ pip install benchbuild3
现在我们只需要通过benchbuild
将其添加到插件注册表
配置文件@cfg["plugins"]["projects"]