packtivity - 通用架构及PROV活动的绑定
项目描述
packtivity
此包旨在收集同步和异步执行保留的、但参数化的科学计算任务的实现,这些任务带有内置的软件依赖项完整规范。在这一点上,它们是打包活动 -- packtivities。
此包提供工具以验证和执行根据yadage-schemas
中定义的"packtivity" JSON模式编写的数据处理任务。
packtivities定义
- 软件环境
- 参数化过程描述(在这些环境中要运行哪些程序)
- 并产生人类和机器可读的输出(作为JSON)的结果数据片段。
在运行时,它们与一组具体的参数配对,这些参数作为JSON文档提供,并与外部存储/状态相结合来实际执行这些任务。
Yadage中的Packtivity
此包由yadage
使用来执行yadage工作流中的各个步骤。
示例Packtivity规范
此packtivity规范是多个yadage工作流的一部分,在HepMC文件上运行Delphes探测器模拟,并以LHCO和ROOT文件格式输出事件。此packtivity存储在公共位置,可以从该位置检索
process:
process_type: 'string-interpolated-cmd'
cmd: 'DelphesHepMC {delphes_card} {outputroot} {inputhepmc} && root2lhco {outputroot} {outputlhco}'
publisher:
publisher_type: 'frompar-pub'
outputmap:
lhcofile: outputlhco
rootfile: outputroot
environment:
environment_type: 'docker-encapsulated'
image: lukasheinrich/root-delphes
用法
您可以通过指定规范(可以指向GitHub)、所有必要的参数并附加外部状态(通过--read
和--write
标志)来同步运行packtivity。
packtivity-run -t from-github/phenochain delphes.yml \
-p inputhepmc="$PWD/pythia/output.hepmc" \
-p outputroot="'{workdir}/output.root'" \
-p outputlhco="'{workdir}/output.lhco'" \
-p delphes_card=delphes/cards/delphes_card_ATLAS.tcl \
--read pythia --write outdir
异步后端
为了便于使用分布式资源,可以指定多个异步后端。以下是一个针对IPython Parallel集群的示例
packtivity-run -b ipcluster --asyncwait \
-t from-github/phenochain delphes.yml \
-p inputhepmc="$PWD/pythia/output.hepmc" \
-p outputroot="'{workdir}/output.root'" \
-p outputlhco="'{workdir}/output.lhco'" \
-p delphes_card=delphes/cards/delphes_card_ATLAS.tcl \
--read pythia --write outdir
您可以将--asyncwait
标志替换为--async
标志,以获取一个可JSON化的代理表示,稍后可以使用该表示检查作业状态。默认情况下,代理信息写入proxy.json
(可通过-x
标志自定义)
packtivity-run -b celery --async \
-t from-github/phenochain delphes.yml \
-p inputhepmc="$PWD/pythia/output.hepmc" \
-p outputroot="'{workdir}/output.root'" \
-p outputlhco="'{workdir}/output.lhco'" \
-p delphes_card=delphes/cards/delphes_card_ATLAS.tcl \
--read pythia --write outdir
稍后您可以检查
packtivity-checkproxy proxy.json
外部后端
用户可以实施自己的后端来处理描述packtivities的JSON文档。可以通过使用fromenv
后端并设置一个环境变量来指定包含后端和代理类的模块来启用它。环境变量的格式是module:backendclass:proxyclass
。例如
export PACKTIVITY_ASYNCBACKEND="externalbackend:ExternalBackend:ExternalProxy"
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。