Changeset 8115 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
10/18/06 11:12:15 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8113 r8115  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2006/10/18 Daniela Dorner
     22
     23   * datacenter/scripts/sourcefile:
     24     - added makedir for lockpath and listpath
     25
     26   * datacenter/scripts/jobmanager:
     27     - removed makedir for lockpath and listpath
     28     - bugfix (continue if condor_q gives an error)
     29     - reduced number of condor_q calls per loop from 3 to 1
     30     - combined two if-clauses
     31     - added comments
     32
     33
     34
    2035 2006/10/17 Thomas Bretz
    2136
  • trunk/MagicSoft/Mars/datacenter/scripts/jobmanager

    r7959 r8115  
    3636echo "" >> $jmscriptlog 2>&1
    3737echo "starting jobmanager ("`date`")" >> $jmscriptlog 2>&1
    38 makedir $jmlogpath
    39 makedir $listpath >> $jmscriptlog 2>&1
    40 makedir $lockpath >> $jmscriptlog 2>&1
    4138
    4239prev=$max
     
    4744   for (( i=0 ; i < ${#scripts[@]} ; i++ ))
    4845   do
    49       makedir $jmlogpath
    5046      date  >> $jmscriptlog 2>&1
     47      source `dirname $0`/sourcefile
     48      echo "script: ${scripts[$i]}" >> $jmscriptlog 2>&1
     49
     50      # check if there's something to do
     51      getstatus >> $jmscriptlog 2>&1
     52      echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&1
     53      if [ "$numproc" = "" ]
     54      then
     55         prev=0
     56         cont >> $jmscriptlog 2>&1
     57      fi
     58      prev=$max
     59
    5160      echo "sleeping $sleeptime..." >> $jmscriptlog 2>&1
    5261      sleep $sleeptime
    53       dayofweek=`date +%u`
    54       hour=`date +%k`
    5562
    56       source `dirname $0`/sourcefile
    57       echo "script: ${scripts[$i]}" >> $jmscriptlog 2>&1
    58 #      echo " day: $dayofweek hour: $hour" >> $jmscriptlog 2>&1
    59 
    60       queued=`/usr/local/bin/condor_q -global -format "%s\n" Owner | grep -c $user` && ! [ $queued -eq 0 ]
    61       if [ "$queued" = "" ]
     63      q=(`/usr/local/bin/condor_q -global -format "Owner%s " Owner -format "%s" CMD -format "Jobstatus%s\n" Jobstatus`)
     64      if echo $q | egrep \(Error\|failed\)
    6265      then
    6366         printprocesslog "WARN condor_q failed"
     
    6568         cont >> $jmscriptlog 2>&1
    6669      fi
    67       queuedscript=`/usr/local/bin/condor_q -global | grep $user | grep -c ${scripts[$i]}`
    68       if [ "$queuedscript" = "" ]
    69       then
    70          printprocesslog "WARN condor_q failed"
    71          echo `date`"ERROR condor_q failed" >> $jmerrorlog
    72          cont >> $jmscriptlog 2>&1
    73       fi
    74       runningscript=`/usr/local/bin/condor_q -global | grep $user | grep ' R ' | grep -c ${scripts[$i]}`
    75       if [ "$runningscript" = "" ]
    76       then
    77          printprocesslog "WARN condor_q failed"
    78          echo `date`"ERROR condor_q failed" >> $jmerrorlog
    79          cont >> $jmscriptlog 2>&1
    80       fi
     70      q1=(`echo ${q[@]} | egrep -o Owner$user`)
     71      queued=${#q1[@]}
     72     
     73      q2=(`echo ${q[@]} | egrep -o ${scripts[$i]}`)
     74      queuedscript=${#q2[@]}
     75     
     76      q3=(`echo ${q[@]} | egrep -o ${scripts[$i]}Jobstatus2`)
     77      runningscript=${#q3[@]}
    8178      stillinqueue=`echo $queuedscript - $runningscript | bc `
    8279
     80      #get total number of allowed process for current time
     81      hour=`date +%k`
    8382      totalpno=${pnototal[$hour]}
    8483     
    8584      #choose array according to the day of the week
     85      dayofweek=`date +%u`
    8686      case $dayofweek in
    8787         0 | 6)  pnos=( ${pnoswe[@]} ) ;;
     
    9898      echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs [$runningscript]) [allowed $pnoscript] - not running: $stillinqueue" >> $jmscriptlog 2>&1
    9999     
    100       if [ "$queued" -gt "$totalpno" ]
    101       then
    102          cont >> $jmscriptlog 2>&1
    103       fi
    104       if [ "$queuedscript" -gt "$pnoscript" ]
     100      if [ "$queued" -gt "$totalpno" ] || [ "$queuedscript" -gt "$pnoscript" ]
    105101      then
    106102         cont >> $jmscriptlog 2>&1
    107103      fi
    108104
    109       # check if there's something to do
    110       getstatus >> $jmscriptlog 2>&1
    111       echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&1
    112       if [ "$numproc" = "" ]
    113       then
    114          prev=0
    115          cont >> $jmscriptlog 2>&1
    116       fi
    117       prev=$max
    118105      if [ $numproc -lt $stillinqueue ]
    119106      then
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r8078 r8115  
    6666processlog=$processlogpath/process`date +%F`.log
    6767
     68makedir $lockpath
     69makedir $listpath
    6870
    6971# set checkvalue to ok at the beginning of the scripts
Note: See TracChangeset for help on using the changeset viewer.