|
目前作业是利用pbs形式提交的
#!/bin/bash
#PBS -N Gauss
#PBS -l nodes=1:ppn=16
##PBS -l walltime=240:00:00
#PBS -j oe
#PBS -V
#Please give the name of the INPUT_FILE, such as test.com or ONLY test. Both of them can work.
INPUT_FILE=xxx.com
#----> enter the working directory <----
cd $PBS_O_WORKDIR
echo This job begins at: `date`
..........
.........
但是每次都需要替换文件名,
看了一个帖子,尝试了一下以下方法:
#!/bin/bash
counts=$(ls -l *.com|wc -l)
ls -l *.com \
| awk '{print $NF}'\
| sed 's/.com//g' \
| while read each_file
do
sed -i -r "/^\s*INPUT_FILE=/c INPUT_FILE=$each_file" g09E01.pbs.sh
qsub g09E01.pbs.sh &
a=$((a+1))
[[ $a -eq $counts ]]&&break
while((1))
do
thread=(ps -ef|grep 'qsub g09E01.pbs.sh'|grep -v grep|wc -l)
[[ $thread -lt 5 ]]&&break||sleep 1
done
sleep 1
done
但也不成功,求问大神有什么好方法能一次同时提交6个或多个作业,然后少于一定数目自动补上提交作业?
|
|