用于sawsim力谱模拟器的python框架。
pysawsim的Python项目详细描述
sawsim是一个力谱模拟器。详见说明书 细节。
套餐
gentoo
我在我的wtk overlay中将Gentoo的sawsim打包为sci physics/sawsim。要安装,请运行:
# emerge -av app-portage/layman # layman --add wtk # emerge -av sci-physics/sawsim
编译
查看来源:
$ git clone git://tremily.us/sawsim.git $ cd sawsim
sawsim是用noweb写成的。提取makefile并使用:
编译$ notangle -Rmakefile src/sawsim.nw | sed 's/ /\t/' > Makefile $ make
使用以下命令运行单元测试:
$ make check
如果使用python绑定(pysawsim或bin/*.py),则 应使用以下命令运行pysawsim单元测试:
$ ./misc/hooks/pre-commit-pysawsim-check
升级
升级至最新版本:
sawsim$ git pull sawsim$ make && make check && ./misc/hooks/pre-commit-pysawsim-check
依赖关系
Package | Purpose | Debian | Gentoo |
---|---|---|---|
git | version control | git-core | dev-vcs/git |
noweb | source code framework | noweb | app-text/noweb |
GSL | sawsim dependency | libgsl0-dev | sci-libs/gsl |
check | sawsim unit tests | check | dev-libs/check |
python 2.5+ | pysawsim execution | python | dev-lang/python |
nose | pysawsim testing | python-nose | dev-python/nose |
matplotlib | pysawsim execution | python-matplotlib | dev-python/matplotlib |
numpy | pysawsim execution | python-numpy | dev-python/numpy |
scipy | pysawsim execution | python-scipy | sci-libs/scipy |
mpi4py | pysawsim mpi manager | [1] | dev-python/mpi4py |
pbs-python | pysawsim pbs manager | [2] | sys-cluster/pbs-python |
[1] | mpi4py has no Debian package, but you can install it with distribute (a setuptools fork) (Debian: python-distribute, Gentoo: setuptools/setuptools) via: ^{pr 7}$For systems with earlier versions of distribute/setuptools, which lack the –user option, try something along the lines of: ^{pr 8}$ |
[2] | pbs-python has no Debian package, but you can install it from source. See the pbs-python homepage. |
Python
如果在用户级安装python包(与系统级相比 安装)您可能需要设置环境变量 所以python可以找到包。你可能想加一行 大致如下:
export PYTHONPATH=".:$HOME/.local/lib/python2.6/site-packages"
到您的~/.bashrc文件以确保新的pythonpath已设置 所有未来登录。
python包装器
sawsim二进制文件只运行一次pull,但是您可能需要 运行多次重复以生成足够的数据 统计分析。为了促进这一点,我们提供了pysawsim 为sawsim提供更高级别接口的模块。
确保。在您的PYTHONPATH中,并运行pysawsim测试:
sawsim$ ./misc/hooks/pre-commit-pysawsim-check
一些pysawsim子模块有脚本(bin/*.py)提供 对其功能的命令行访问。许多用户可能会 只需要一个电话bin/sawsim_hist_scan.py 将力直方图展开到特定模型。
工作经理
对于–manager选项,使用任何作业调度系统 适合你的主人。例如:
Host description | Manager |
---|---|
SMP machine with many processors | subproc |
Cluster with the Torque/Maui portable batch queue system | pbs |
Bunch of machines which can host message-passing daemons | mpi |
My wimpy single-processor, single-core netbook | thread |
缓存
默认情况下,python包装器不缓存前面的结果 跑。但是,如果您重复运行sawsim 参数,可能需要启用缓存(-c/–使用缓存)。 每个sawsim run的输出都将存储在缓存目录中 (-d/–cache dir)并循环使用同一个sawsim以供将来运行 参数。例如,如果在缓存中放置200次运行:
$ bin/sawsim_hist.py -s bin/sawsim -N 200 --use-cache
然后用相同的参数生成另一个直方图
$ bin/sawsim_hist.py -s bin/sawsim -N 300 --use-cache
第二个调用将只执行额外的100次sawsim运行。
如果请求的运行数少于缓存中包含的运行数,例如:
$ bin/sawsim_hist.py -s bin/sawsim -N 100 --use-cache
您将不会运行anynewsawsim运行。所有100个回合都将被抽签 从缓存中随机取出。
帮助
一如既往,运行:
sawim$ bin/<whatever> --help
更多细节。
许可证
saswim是在gnu gplv3+下发布的。有关详细信息,请参见复制。