Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8117)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8118)
@@ -39,4 +39,9 @@
      - moved getstatus to beginning of loop and moved sleep behind 
        getstatus to avoid unneed waiting and calling of condor_q
+     - replaced -gt by -ge and -lt by -le, to make sure that logging 
+       output makes sense
+
+   * datacenter/scripts/setup:
+     - updated default values for jobmanager
 
 
Index: /trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/jobmanager	(revision 8117)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/jobmanager	(revision 8118)
@@ -39,4 +39,5 @@
 prev=$max
 user=`whoami`
+# endless loop
 notcount=0
 while (( $notcount < 100 ))
@@ -56,22 +57,24 @@
          cont >> $jmscriptlog 2>&1
       fi
-      prev=$max
 
       echo "sleeping $sleeptime..." >> $jmscriptlog 2>&1
       sleep $sleeptime
 
-      q=(`/usr/local/bin/condor_q -global -format "Owner%s " Owner -format "%s" CMD -format "Jobstatus%s\n" Jobstatus`)
+      # get processes in queue
+      q=(`/usr/local/bin/condor_q -global -format "Owner%s " Owner -format "%s" CMD -format "Jobstatus%s\n" Jobstatus 2>&1 `)
       if echo $q | egrep \(Error\|failed\)
       then 
+         echo "WARN condor_q failed" >> $jmscriptlog 2>&1
          printprocesslog "WARN condor_q failed"
          echo `date`"ERROR condor_q failed" >> $jmerrorlog
          cont >> $jmscriptlog 2>&1
       fi
+      # get processes of user in queue
       q1=(`echo ${q[@]} | egrep -o Owner$user`)
       queued=${#q1[@]}
-      
+      # get scripts in queue
       q2=(`echo ${q[@]} | egrep -o ${scripts[$i]}`)
       queuedscript=${#q2[@]}
-      
+      # get running scripts
       q3=(`echo ${q[@]} | egrep -o ${scripts[$i]}Jobstatus2`)
       runningscript=${#q3[@]}
@@ -81,5 +84,4 @@
       hour=`date +%k`
       totalpno=${pnototal[$hour]}
-      
       #choose array according to the day of the week
       dayofweek=`date +%u`
@@ -88,6 +90,8 @@
              *)  pnos=( ${pnosweek[@]} ) ;;
       esac
+      # get number of allowed scripts for current time
       num=`echo "((( $i + 1 ) * 24 ) + ( $hour + 1 ) ) - 24 - 1 " | bc `
       pnoscript=${pnos[$num]}
+      # if there was nothing to do for previous script, more scripts can be allowed
       if [ $prev -eq 0 ]
       then
@@ -98,15 +102,20 @@
       echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs [$runningscript]) [allowed $pnoscript] - not running: $stillinqueue" >> $jmscriptlog 2>&1
       
-      if [ "$queued" -gt "$totalpno" ] || [ "$queuedscript" -gt "$pnoscript" ]
+      # continue if there are already enough processes or scripts in the queue
+      if [ "$queued" -ge "$totalpno" ] || [ "$queuedscript" -ge "$pnoscript" ]
       then
          cont >> $jmscriptlog 2>&1
       fi
-
-      if [ $numproc -lt $stillinqueue ]
+      # continue if the number of script is the queue is larger (or equal) than the number which still has to be done
+      if [ $numproc -le $stillinqueue ]
       then 
-         echo " numproc($numproc) -lt stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1
+         echo " numproc($numproc) -le stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1
          cont >> $jmscriptlog 2>&1
       fi
+      
+      # reset prev
+      prev=$max
 
+      # submit 1 script to condor
       date=`date +%Y-%m-%d`
       echo " committing 1 ${scripts[$i]} to condor" >> $jmscriptlog 2>&1
Index: /trunk/MagicSoft/Mars/datacenter/scripts/setup
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/setup	(revision 8117)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/setup	(revision 8118)
@@ -62,6 +62,6 @@
 #setup for jobmanager
 sleeptime=30 #30
-errorsleeptime=180 #180
-max=16 #maximum number of processes
+errorsleeptime=60 #60
+max=18 #maximum number of processes
 
 scripts=( "runcallisto" "runstar" "runganymed" "dodatacheck" ) 
@@ -69,15 +69,15 @@
 
 #hour:            0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
-pnototal=(       16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
-pnototalwe=(     16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
+pnototal=(       18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 )
+pnototalwe=(     18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 )
 
 pnocallisto=(    12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 )
-pnostar=(         5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 )
-pnoganymed=(      2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2 )
+pnostar=(         6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6 )
+pnoganymed=(      3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3 )
 pnodatacheck=(   16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
 
 pnocallistowe=(  12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 )
-pnostarwe=(       5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 )
-pnoganymedwe=(    2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2 )
+pnostarwe=(       6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6 )
+pnoganymedwe=(    3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3 )
 pnodatacheckwe=( 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 )
 
