[torqueusers] Question about qsub file with argument

Troy Baer tbaer at utk.edu
Wed Sep 29 13:42:21 MDT 2010


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.)

	--Troy
-- 
Troy Baer, HPC System Administrator
National Institute for Computational Sciences, University of Tennessee
http://www.nics.tennessee.edu/
Phone:  865-241-4233



More information about the torqueusers mailing list