Chinaunix

标题: 求qsub同时提交多个作业 [打印本页]

作者: codeternity    时间: 2015-05-06 15:11
标题: 求qsub同时提交多个作业
各位大侠,小弟现在想用qsub提交作业。之前都是运行的一个软件,像下面这样

#!/bin/sh

#PBS -l walltim=50:00:00

cd /home/new/2

./treemix


现在需要同时运行这个软件10次或更多次,它们在不同的文件夹下,我以为像下面这样写就可以,可是不行,好像都还是只能运行一次。

#!/bin/sh

#PBS -l walltim=50:00:00

cd /home/new/2
./treemix

cd /home/new/3
./treemix

cd /home/new/4
./treemix
……


求大侠们指教,这种情况该怎么解决呢??
作者: jason680    时间: 2015-05-06 15:32
本帖最后由 jason680 于 2015-05-06 15:35 编辑

回复 1# codeternity

remove
the echo if you got the right answer

$ for n in `seq 2 12`
  do
    echo cd /home/new/$n
    echo ./treemix
         # ./treemix &       #<== for run all utilties(./treemix) at the same time
done
         # wait
cd /home/new/2
./treemix
cd /home/new/3
./treemix
cd /home/new/4
./treemix
cd /home/new/5
./treemix
cd /home/new/6
./treemix
cd /home/new/7
./treemix
cd /home/new/8
./treemix
cd /home/new/9
./treemix
cd /home/new/10
./treemix
cd /home/new/11
./treemix
cd /home/new/12
./treemix

   
作者: codeternity    时间: 2015-05-06 18:21
回复 2# jason680

大侠,貌似不行。不论去不去echo。我top一下,只有一个treemix在运行,并没有显示有2个在跑着。

而且那个$加上以后就不可以运行……

#!/bin/sh

#PBS -l walltime=60:00:00

$ for n in 'seq 2 3'
  do
    echo cd /home/new/$n
    echo ./treemix
         # ./treemix &       #<== for run all utilties(./treemix) at the same time
done
          #wait


cd /home/new/2
./treemix

cd /home/new/3
./treemix


是不是我运行的有问题?
   
作者: Herowinter    时间: 2015-05-06 18:47
本帖最后由 Herowinter 于 2015-05-06 18:49 编辑

回复 3# codeternity

那个代码是顺序执行的, 你要的是同时开始执行11几个?
作者: jason680    时间: 2015-05-06 19:26
回复 3# codeternity

shell基础二十篇
http://bbs.chinaunix.net/thread-452942-1-1.html


shell 十三問?
http://bbs.chinaunix.net/thread-218853-1-1.html
   

shell基础二十篇 shell基础三和四:后台(crontab,at,&,nohup)及(*,?,[]等)
http://bbs.chinaunix.net/thread-442596-1-1.html

作者: codeternity    时间: 2015-05-06 19:27
回复 4# Herowinter
对啊,我想的是同时把这几个一块运行,不是一个完了再运行下一个……
不知道有没有啥好办法……

   
作者: codeternity    时间: 2015-05-06 19:28
回复 5# jason680
好的,谢啦……

   




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2