HPC Task
Python package for easy HPC task management based on paramiko.
Installation
pip install -U hpc_task
Requirements
- paramiko
- ase
Usage
import ase
from hpc_task.hpc import HPCTask
from hpc_task.hpc_calculator.vasp import Vasp as hpc_Vasp # 必须导入hpc_Vasp 而非原生的 ase 的 Vasp
target_host = {
'hostname': "TARGET HOST IP",
'port': 22,
'username': "YOUR_USERNAME",
'password': "YOUR_PASSWD",
}
workdir = 'test_vasp_calc'
hpc = HPCTask(workdir=workdir)
hpc.scriptdir = '/data/bin/remote.job' # 提交作业的脚本
hpc.connect(target_host)
# 启动队列,得到 jobid
hpc.prerun()
jobid = hpc.jobid
hpc.close() # 此时可以关闭 ssh 通道
# 在运行时候再重新构造和连接 hpc
hpc = HPCTask(jobid=jobid) # workdir 会根据 jobid 提取得到
hpc.connect(target_host)
hpc.get_workdir()
# 结构、计算参数设置
atoms = ase.Atoms('N2', positions=[(0., 0., 0.), (1.4, 0., 0.)],
cell=[10, 10, 10], pbc=True)
# calc 设置
calc = hpc_Vasp(
xc='pbe',
directory=hpc.workdir, # 必须设置, 会新建文件夹,并进入文件夹执行命令
command='mpirun -np 8 vasp544_std', # 必须设置,或者提供了 ASE vasp 的相关设置
hpctask=hpc, # 这个非常关键,必须提供
gamma=True,
encut=400,
lwave=False,
lcharg=False,
)
# 计算
atoms.calc = calc
e = atoms.get_potential_energy()
print(f"Energy of N2 is {e} eV.")
# finish job,结束节点任务
hpc.postrun()
# 关闭通道
hpc.close()
TODO
Metadata
Release files for hpc-task 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hpc_task-0.2.0.tar.gz | 11.1 kB | Without provenance | Details for hpc_task-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hpc_task-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for hpc_task-0.2.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / hpc_task-0.2.0.tar.gz
| Download URL | hpc_task-0.2.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62f49c17e0c1c2a2c611303063c111120fc432346a303c28f02263a9443a0a44
|
|
BLAKE2b-256 checksum How to use checksums |
d1ce8c3779d31141e32ef1483cddd047d10004ad29779017d58fd4b1fd288544
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / hpc_task-0.2.0-py3-none-any.whl
| Download URL | hpc_task-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4101f6d1eda2b17af76471460c1fcaae18cc6d4f528b9f95c678bf40d5febdc9
|
|
BLAKE2b-256 checksum How to use checksums |
4f54bf056e55becd7a2d1e10a45fc8484e29dd4f089de713722c7a8e90386497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Security for hpc-task 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.