KennyC
KennyC

Reputation: 475

Passing qsub variables to .pbs script which calls python

I'm using qsub with the -v flag like so:

qsub -v START=0,COUNT=30000 foobar.pbs

This passes START and COUNT just fine to foobar.pbs BUT foobar.pbs eventually needs to call something like this:

python /home/CS4/bin/myrun.py foo_bar.ini

The problem is it appears is that bash is not interpreting the python call properly and the python process is never spawned. This must be something very simple? Any help would be appreciated

pbs script looks like this:

#!/bin/bash

#PBS -N test
#PBS -l select=1:ncpus=1:mem=4gb
#PBS -l walltime=2:00:00
#PBS -j oe

set -x 
cd ${PBS_O_WORKDIR}
export PYTHONPATH=/home/CS4:${PYTHONPATH}

TEMPL=/home/CS4/in/tr/1km/foo_bar.ini.m4
DIR=$(dirname ${TEMPL})
BASE=$(basename ${TEMPL} .m4)
INI=$(basename ${BASE} .ini).${START}.ini
m4 -D START=${START} -D COUNT=${COUNT} ${TEMPL} > ${DIR}/${INI}

time python /home/CS4/bin/myrun.py ${DIR}/${INI}

Upvotes: 1

Views: 1017

Answers (1)

Rainy
Rainy

Reputation: 1106

Did you try providing full path to python?

Upvotes: 1

Related Questions