Index: trunk/Mars/datacenter/scripts/jobmanager
===================================================================
--- trunk/Mars/datacenter/scripts/jobmanager	(revision 9627)
+++ trunk/Mars/datacenter/scripts/jobmanager	(revision 10004)
@@ -20,5 +20,5 @@
 #   Author(s): Daniela Dorner  05/2006 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2009
+#   Copyright: MAGIC Software Development, 2000-2010
 #
 #
@@ -26,5 +26,5 @@
 #
 # This a script, which launches other scripts (all scripts, that are run 
-# on primary basis
+# on primary basis)
 #
 
@@ -57,4 +57,9 @@
             # FIXME: get complete scriptname (including command line option), needed for runstereo
             alias 'checkqueue'="/opt/gridengine/bin/lx26-amd64/qstat \`echo \$noderequirementstat\`  | awk ' { print \"Owner\"\$4\" \" \$3\"Jobstatus\"\$5 } '"
+            break
+            ;;
+      pbs)  echo " on queuing system 'pbs'" >> $jmscriptlog 2>&1
+            alias 'queuesubmit'='$pbspath/qsub -l walltime=$walltime -l pmem=$pmem -v AUTOMATIONSETUP=$AUTOMATIONSETUP,SOURCEFILEPATH=$SOURCEFILEPATH -e `echo $runlogpath`/error-`echo $date`.log -o `echo $runlogpath`/log-`echo $date`.log `echo $noderequirementsub` `echo $scriptspath`/`echo ${scripts[$i]}` '
+            alias 'checkqueue'="$pbspath/qstat -a | awk ' { print \"Owner\"\$2\" \" \$4\"Jobstatus\"\$10 } '"
             break
             ;;
@@ -90,4 +95,17 @@
       step=${scriptscolname[$i]}
       getstepinfo
+      # check if walltime has to be set
+      if [ "$setwalltime" = "yes" ]
+      then
+         walltime=${walltimes[$i]}
+      fi
+      # check if memory has to be set
+      if [ "$setpmem" = "yes" ]
+      then
+         pmem=${pmems[$i]}
+      fi
+      # check if the script is restricted to one node 
+      #   (i.e. where output of previous step(s) is stored)
+      # this information is taken from the steps.rc file
       if [ "$noderestricted" = "yes" ]
       then
@@ -163,5 +181,8 @@
       queuedscript=${#q2[@]}
       # get running scripts
-      q3=( `echo ${q[@]} | egrep -o \("${scripts[$i]}"Jobstatus2\|"${scripts[$i]}"Jobstatusr\)` )
+      #   condor: 2
+      #   sge: r
+      #   pbs: R
+      q3=( `echo ${q[@]} | egrep -o \("${scripts[$i]}"Jobstatus2\|"${scripts[$i]}"Jobstatusr\|"${scripts[$i]}"JobstatusR\)` )
       runningscript=${#q3[@]}
       stillinqueue=`echo $queuedscript - $runningscript | bc `
