I am using the Sun Grid Engine (SGE) to submit embarassingly parallel task arrays. Suppose I have the file job_script
:
#!/bin/bash
#$ -cwd -V
#$ -l h_rt=0:01:00
#$ -o logs
#$ -e logs
#$ -N name_of_code
#$ -t 1-1000
count=1
echo "hello $count" > output.${count}
./cpp_code $count
which can be submitted using qsub job_script
. What I am stuck on: writing a for loop whereby the variable count
is passed into job_script
as an argument. For example:
#!/bin/bash
#$ -cwd -V
#$ -l h_rt=0:01:00
#$ -o logs
#$ -e logs
#$ -N name_of_code
#$ -t 1-1000
count=$1
echo "hello $count" > output.${count}
./cpp_code $count
I (incorrectly) thought that count
corresponds to the first argument passed from the command line into job_script
, but
for count in {1..10..1}
do
qsub job_script $count
done
does not work. What am I doing wrong and how do I fix it? Thank you for your time.