[torqueusers] Question about qsub file with argument

Glen Beane glen.beane at gmail.com
Thu Sep 30 07:26:28 MDT 2010


On Wed, Sep 29, 2010 at 3:42 PM, Troy Baer <tbaer at utk.edu> wrote:
> On Wed, 2010-09-29 at 14:13 -0500, Abraham Zamudio wrote:
>> I have a mpich2 program , This program takes one ( argv[1] ) argument
>> (  ./program    file_to_analyze ) .
>>
>> I send him to the queue  of torque
>
>> #####################
>> #### run_all_files.sh ####
>> #####################
>> $FOLDER = /path/to/files
>> for i in $(ls $FOLDER ); do
>>     qsub cola.qsub $i
>> done
>> #####################
>
>> #################
>> #### cola.qsub ####
>> #################
>> #PBS -S /bin/bash
>> #PBS -N proof
>> #PBS -q queue_2
>> #PBS -l nodes=Four_processors:ppn=4+Eight_processors:ppn=8
>> #PBS -j oe
>> #PBS -o cola.$PBS_JOBID.$1
>>
>> mpiexec /PATH/TO/MPI_SOFTWARE/program   $1
>> #################
>
> That's not how qsub processes its command line arguments.  Setting an
> environment variable that gets propagated into the jobs using the -v
> flag to qsub might work, though:
>
> ########################
> ### run_all_files.sh ###
> ########################
> $FOLDER = /path/to/files
> for i in $(ls $FOLDER )
> do
>    qsub -v FILE=$i cola.qsub
> done
>
> #################
> ### cola.qsub ###
> #################
> #PBS -S /bin/bash
> #PBS -N proof
> #PBS -q queue_2
> #PBS -l nodes=Four_processors:ppn=4+Eight_processors:ppn=8
> #PBS -j oe
> #PBS -o cola.$PBS_JOBID.$FILE
> mpiexec /PATH/TO/MPI_SOFTWARE/program $FILE
>
> Do environment variable macro substitutions work in the arguments to the
> -e and -o flags?  (I was under the impression that they didn't.)

torque will use wordexp to expand shell variables in the -o and -e
arguments, so your example should work provided wordexp was found by
./configure


More information about the torqueusers mailing list