This commit is contained in:
guanjihuan 2025-03-20 05:05:56 +08:00
parent 6b43a3be1d
commit 4a806dfc6f
3 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[metadata]
# replace with your username:
name = guan
version = 0.1.166
version = 0.1.167
author = guanjihuan
author_email = guanjihuan@163.com
description = An open source python package

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: guan
Version: 0.1.166
Version: 0.1.167
Summary: An open source python package
Home-page: https://py.guanjihuan.com
Author: guanjihuan

View File

@ -129,6 +129,16 @@ def make_sh_file_for_bsub(sh_filename='a', command_line='python a.py', cpu_num=1
with open(sh_filename+'.sh', 'w') as f:
f.write(sh_content)
# qsub 提交任务PBS
def qsub_task(filename='a', file_format='.sh'):
import os
os.system('qsub '+filename+file_format)
# bsub 提交任务LSF
def bsub_task(filename='a', file_format='.sh'):
import os
os.system('bsub < '+filename+file_format)
# 复制.py和.sh文件然后提交任务实现半手动并行PBS
def copy_py_sh_file_and_qsub_task(parameter_array, py_filename='a', old_str_in_py='parameter = 0', new_str_in_py='parameter = ', sh_filename='a', task_name='task'):
import os