[torqueusers] Can I submit multiple jobs using a single script file?

Ken Nielson knielson at adaptivecomputing.com
Tue Oct 5 09:39:34 MDT 2010

On 10/05/2010 09:31 AM, Glen Beane wrote:
> On Tue, Oct 5, 2010 at 5:16 AM, 정지욱<librasonatine at gmail.com>  wrote:
>> Hi,
>> I made up linux cluster using torque 2.4.8.
>> I need to submit many jobs at the same time.
>> But, using qsub, I can make only one job for each 1 script file.
>> I want to distribute many jobs to many nodes at a time using only one script
>> file.
>> Is it possible to submit mutiple jobs using a single script file?
>> Using background job(&), It's too heavy to run at a single node...
>> It's very inconvenient to make script files for each command line.
>> How can I submit multiple jobs using a single script file?
>> example : batch.sh
>> ------------------------------------------------------
>> #!/bin/bash
>> #PBS -l nodes=1:ppn=1
>> cmd option1
>> cmd option2
>> cmd option3
>> -------------------------------------------------------
>> cmd is executable filename. option# is a parameter
>> Can I run three jobs at different nodes using 1 script file?
>> Thank you.
> you could use job arrays.  you would have to wrap your commands in an
> if-else block and test the value of the environment variable
> $PBS_ARRAYID to determine which command to run
> _______________________________________________
If all you want are several jobs using the same script then job arrays 
is the better solution.
If you want the same script to run simultaneously on several nodes in a 
single job then pbsdsh will work.


More information about the torqueusers mailing list