This commit is contained in:
guanjihuan 2025-03-06 07:02:40 +08:00
parent 9cad8f4a9d
commit 60b9410584
6 changed files with 4 additions and 9 deletions

View File

@ -1,2 +1,2 @@
parameter=0
parameter = 0
print(f'hello world {parameter}')

View File

@ -4,4 +4,4 @@ parameter_array = [1, 2, 3, 4]
guan.make_sh_file_for_bsub(sh_filename='a', command_line='python a.py', cpu_num=1, task_name='task', queue_name='score', cd_dir=0)
guan.copy_py_sh_file_and_bsub_task(parameter_array, py_filename='a', old_str_in_py='parameter=0', new_str_in_py='parameter=', sh_filename='a', bsub_task_name='task')
guan.copy_py_sh_file_and_bsub_task(parameter_array, py_filename='a', old_str_in_py='parameter = 0', new_str_in_py='parameter = ', sh_filename='a', bsub_task_name='task')

View File

@ -1,2 +1,2 @@
parameter=0
parameter = 0
print(f'hello world {parameter}')

View File

@ -4,4 +4,4 @@ parameter_array = [1, 2, 3, 4]
guan.make_sh_file_for_qsub(sh_filename='a', command_line='python a.py', cpu_num=1, task_name='task', cd_dir=0)
guan.copy_py_sh_file_and_qsub_task(parameter_array=parameter_array, py_filename='a', old_str_in_py='parameter=0', new_str_in_py='parameter=', sh_filename='a', qsub_task_name='task')
guan.copy_py_sh_file_and_qsub_task(parameter_array=parameter_array, py_filename='a', old_str_in_py='parameter = 0 ', new_str_in_py='parameter = ', sh_filename='a', qsub_task_name='task')

View File

@ -1,5 +1,4 @@
#!/bin/sh
#PBS -N task
#PBS -l nodes=1:ppn=1
#PBS -q bigmem
python a.py

View File

@ -29,8 +29,6 @@ for parameter_str in parameter_str_array:
with open('a'+str(index)+'.py', 'w') as f: # 写入
f.write(content)
# 以下处理任务上传文件
old_file = 'a.sh'
new_file = 'a'+str(index)+'.sh'
@ -50,7 +48,5 @@ for parameter_str in parameter_str_array:
with open('a'+str(index)+'.sh', 'w') as f: # 写入
f.write(content)
# 提交任务
os.system('qsub '+new_file)