removed warning if qstat is not found

qstat can not be found on host with outdated debian versions. These hosts do not have GPU's installed.
This commit is contained in:
Kasper D. Fischer 2022-01-28 16:29:11 +01:00
parent fd6c9867f2
commit deaa1effd9

View File

@ -35,7 +35,7 @@ function clean_up() {
### get requested number of GPU's
# use hard resource list first
NGPUS=$(qstat -j ${JOB_ID} | sed -n "s/hard resource_list:.*gpu=\([[:digit:]]\+\).*/\1/p")
NGPUS=$(qstat -j ${JOB_ID} 2>/dev/null | sed -n "s/hard resource_list:.*gpu=\([[:digit:]]\+\).*/\1/p")
# set NGPUS to zero if empty
if [ -z "${NGPUS}" ] ; then
NGPUS=0
@ -68,4 +68,4 @@ else
fi
# clean exit
exit 0
exit 0