带有headnode的pbs和slurm集群的客户端包。

hpc05的Python项目详细描述


HPC05

PyPICondaDownloads

ipyparallel.Client带有头节点的pbs或slurm集群的包。

通过ssh使用headnode连接到pbs或slurm集群的脚本。由于ipyparallel在不活动和人们懒惰时不会剔除引擎(因为他们忘记了qdel他们的工作),因此它会在设置的超时(默认值为15分钟)后自动终止ipengines。注意,这个包不仅适用于tu delft上的hpc05集群,也适用于其他集群。

安装

首先在计算机和群集上安装此软件包。

conda config --add channels conda-forge
conda install hpc05

或者使用pip

pip install hpc05

通过复制ssh密钥,确保可以通过ssh无密码连接:

ssh-copy-id hpc05

设置配置文件

您需要集群上的并行配置文件,可以通过本地计算机上的以下命令创建:

importhpc05# for PBS usehpc05.create_remote_pbs_profile(profile='pbs',hostname='hpc05')# on the remote machine# orhpc05.create_local_pbs_profile(profile='pbs')# on the cluster# for SLURM usehpc05.create_remote_slurm_profile(profile='slurm',hostname='hpc05')# on the remote machine# orhpc05.create_local_slurm_profile(profile='slurm')# on the cluster

启动ipcluster并连接(通过ssh

要启动连接到ipcluster只需执行(如果有错误,请阅读错误消息以获取说明):

client,dview,lview=hpc05.start_remote_and_connect(n=100,profile='pbs',hostname='hpc05',folder='~/your_folder_on_the_cluster/')

这相当于以下三个命令:

# 0. Killing and removing files of an old ipcluster (this is optional with#    the `start_remote_and_connect` function, use the `kill_old_ipcluster` argument)hpc05.kill_remote_ipcluster(hostname='hpc05')# 1. starting an `ipcluster`, similar to running#    `ipcluster start --n=100 --profile=pbs` on the cluster headnode.hpc05.start_remote_ipcluster(n=100,profile='pbs',hostname='hpc05')# 2. Connecting to the started ipcluster and adding a folder to the cluster's `PATH`client,dview,lview=hpc05.connect_ipcluster(n=200,profile='pbs',hostname='hpc05',folder='~/your_folder_on_the_cluster/')

启动ipcluster并连接(在群集头节点上)

要启动连接到ipcluster只需执行(如果有错误,请阅读错误消息以获取说明):

client,dview,lview=hpc05.start_and_connect(n=100,profile='pbs',folder='~/your_folder_on_the_cluster/')

这相当于以下三个命令:

# 0. Killing and removing files of an old ipcluster (this is optional with#    the `start_remote_and_connect` function, use the `kill_old_ipcluster` argument)hpc05.kill_ipcluster()# 1. starting an `ipcluster`, similar to `ipcluster start --n=200 --profile=pbs`hpc05.start_ipcluster(n=200,profile='pbs')# 2. Connecting to the started ipcluster and adding a folder to the cluster's `PATH`client,dview,lview=hpc05.connect_ipcluster(n=200,profile='pbs',folder='~/your_folder_on_the_cluster/')

监控资源

如果您使用hpc05_monitor.start(client)启动此包,它将监视您的资源,请参见以下示例使用:

importtimeimporthpc05_monitorhpc05_monitor.start(client,interval=5)# update hpc05_monitor.MAX_USAGE every 'interval' seconds.whilenothpc05_monitor.LATEST_DATA:time.sleep(1)hpc05_monitor.print_usage()# uses hpc05_monitor.LATEST_DATA by defaulthpc05_monitor.print_max_usage()# uses hpc05_monitor.MAX_USAGE

输出:

 id hostname             date                             CPU% MEM%
 15 node29.q1cluster     2018-09-10T14:25:05.350499       190%   3%
 19 node29.q1cluster     2018-09-10T14:25:04.860693       200%   3%
 26 node29.q1cluster     2018-09-10T14:25:05.324466       200%   3%
 28 node29.q1cluster     2018-09-10T14:25:05.148623       190%   2%
 29 node29.q1cluster     2018-09-10T14:25:04.737664       190%   3%
 ...

开发

我们使用pre-commit对代码进行linting,因此pip install pre_commit并运行

pre-commit install

在仓库里。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在安卓活动上使用uncaughtException对话框   将代数象棋符号转换为棋盘布局或FEN符号的java算法   来自证书的java访问证书签名   正则表达式解析Java字符串特殊字符错误   java将linearlayout动态添加到Relativelayout中   java我怎样才能在ant中不停顿地“失败”构建?   从Java producer到Mongodb的json主题数据   java Log4J 2 Syslog Appender工作不正常   java在Processing 3中在3D对象上绘制2D文本   java Spring MVC Web服务调度程序   mysql Java持久性查找区分大小写的数据检索   java YAML解析器不带密钥的多个根文件   SpringJavaBean需要通过prototype作用域使用相同的对象   由于某种原因,应用程序运行时不会显示java xml文件   java maven在JFrog artifactory(snapshotrepo)中找不到具有第三方libs的jar文件