Question

I want to pass the PBS_ARRAYID to the main argument vector (argv) through qsub but after reading every return in pages of google results - I cannot get this to work. A constant argument qsubs fine.

#
#$ -cwd
#$ -S /bin/bash
#$ -j y
#$ -t 1-3
#$ -pe fah 1
var1=$(echo "$PBS_ARRAYID" -l)
const1=1
./daedalus_linux_1.3_64 $const1 $var1

I lifted the Array code from the solution given here Using a loop variable in a bash script to pass different command-line args

From everything I have read this should work. And it does work with the exception of var1=$(echo "$PBS_ARRAYID" -l)

Was it helpful?

Solution

It turns out the answer is fairly simple, our University uses a Sun Grid Engine queue - SGE

The tutorials I found by search were all by chance for PBS queue

#
#$ -cwd
#$ -S /bin/bash
#$ -j y
#$ -t 1-9
#$ -pe fah 3
const1=1
./daedalus_linux_1.3_64 $const1 $SGE_TASK_ID
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top