[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Condor/SGE cluster



Hi,

okay, I've found the error.

I had to add a line to /usr/libexec/condor/glite/bin/sge_submit.sh which includes the location of "qsub" to PATH.

By the way, there is some pointless code in this script:

jobID=`qsub $bls_tmp_file 2> /dev/null | perl -ne 'print $1 if /^Your job (\d+)/;'` # actual submission
retcode=$?
if [ "$retcode" != "0" -o -z "$jobID" ] ; then
    rm -f $bls_tmp_file
    exit 1
fi

retcode is always 0 as 'print $1 if /^Your job (\d+) /;' is a valid statement and therefore perl -ne 'print $1 if /^Your job (\d+) /;' always returns true.

If you want to check the return code of qsub then you have to split up the first line. For example:

out=$(qsub $bls_tmp_file 2> /dev/null)
retcode=$?
jobID=$(echo $out | perl -ne 'print $1 if /^Your job (\d+) /;')
if [ "$retcode" != "0" -o -z "$jobID" ] ; then
    rm -f $bls_tmp_file
    exit 1
fi

And for readability reasons you could use awk '{ print $3 }' instead of perl -ne 'print $1 if /^Your job (\d+) /;'.

Furthermore, it would be nice if this script would generate some error messages or an error log.

Lukas