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

Glen Beane glen.beane at gmail.com
Tue Oct 5 09:31:28 MDT 2010


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
> cd $PBS_O_WORKDIR
> 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


More information about the torqueusers mailing list