Ignore:
Timestamp:
08/14/09 17:14:50 (15 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/jobmanager

    r9489 r9492  
    5050case $queuesys in
    5151      sge)  echo " on queuing system 'sun grid engine'" >> $jmscriptlog 2>&1
    52             alias 'queuesubmit'='/opt/gridengine/bin/lx26-amd64/qsub -b y -e `echo $runlogpath`/error-`echo $date`.log -o `echo $runlogpath`/log-`echo $date`.log `echo $scriptspath`/`echo ${scripts[$i]}` '
     52            # (-hard) -l hostname=compute-*
     53            #   for qstat this returns the jobs running on that node + all jobs in the queue
     54            alias 'queuesubmit'='/opt/gridengine/bin/lx26-amd64/qsub -b y -v AUTOMATIONSETUP=$AUTOMATIONSETUP -e `echo $runlogpath`/error-`echo $date`.log -o `echo $runlogpath`/log-`echo $date`.log `echo $noderequirementsub` `echo $scriptspath`/`echo ${scripts[$i]}` '
     55#            alias 'queuesubmit'='/opt/gridengine/bin/lx26-amd64/qsub -b y -v AUTOMATIONSETUP=$AUTOMATIONSETUP -e `echo $runlogpath`/error-`echo $date`.log -o `echo $runlogpath`/log-`echo $date`.log `echo $scriptspath`/`echo ${scripts[$i]}` '
    5356#            alias 'queuesubmit'='/opt/gridengine/bin/lx26-amd64/qsub -sc runlogpath=`echo $runlogpath` -sc date=`echo $date` -sc scriptspath=`echo $scriptspath` -sc script=`echo ${scripts[$i]}` `echo $scriptspath`/job.sge '
    54             alias 'checkqueue'="/opt/gridengine/bin/lx26-amd64/qstat | awk ' { print \"Owner\"\$4\" \" \$3\"Jobstatus\"\$5 } '"
     57            # FIXME: get complete scriptname (including command line option), needed for runstereo
     58            alias 'checkqueue'="/opt/gridengine/bin/lx26-amd64/qstat \`echo \$noderequirementstat\`  | awk ' { print \"Owner\"\$4\" \" \$3\"Jobstatus\"\$5 } '"
    5559            break
    5660            ;;
     
    6973prev=$max
    7074user=`whoami`
     75currentnode=$minnode
     76numevaluated=0
    7177# endless loop
    7278notcount=0
     
    8389      # check if there's something to do
    8490      column=${scriptscolname[$i]}
    85       getstatus >> $jmscriptlog 2>&1
     91      getstepinfo
     92      if [ "$noderestricted" = "yes" ]
     93      then
     94         # get number of next node
     95         if [ $numevaluated -ge $numrestrictedscripts ]
     96         then
     97            currentnode=`echo $currentnode + 1 | bc -l`
     98            numevaluated=1
     99         else
     100            numevaluated=`echo $numevaluated + 1 | bc -l`
     101         fi
     102         if [ $currentnode -gt $maxnode ]
     103         then
     104            currentnode=$minnode
     105         fi
     106         # check if node is excluded
     107         for excludednode in ${excludednodes[@]}
     108         do
     109            if [ $currentnode -eq $excludednode ]
     110            then
     111               echo `date +%F\ %T`" Node compute-0-$currentnode is currently excluded." >> $jmscriptlog 2>&1
     112               continue 2
     113            fi
     114         done
     115         # define requirement for submission
     116         # FIXME: currently only for sge at isdc
     117         echo `date +%F\ %T`" Checking for node $currentnode. " >> $jmscriptlog 2>&1
     118         noderequirementsub=" -hard -l hostname=compute-0-${currentnode}"
     119         noderequirementstat=" -l hostname=compute-0-${currentnode}"
     120         getstatus $currentnode >> $jmscriptlog 2>&1
     121      else
     122         noderequirementsub=""
     123         noderequirementstat=""
     124         getstatus >> $jmscriptlog 2>&1
     125      fi
     126     
     127      # check number of processes to be done
    86128      echo `date +%F\ %T`" Database: $numproc ${scripts[$i]} still to be done (incl. idle jobs) [DB/table/column $db/$table/$column]" >> $jmscriptlog 2>&1
    87129      if [ "$numproc" = "" ]
     
    105147
    106148      # get processes in queue
    107 #      q=(`/usr/local/bin/condor_q -global -format "Owner%s " Owner -format "%s" CMD -format "Jobstatus%s\n" Jobstatus 2>&1 `)
    108 #      q=(`/opt/gridengine/bin/lx26-amd64/qstat | awk ' { print "Owner"$4" " $3"Jobstatus"$5 } ' 2>&1 `)
    109149      q=(`checkqueue 2>&1 `)
    110150      if echo $q | egrep \(Error\|failed\)
     
    115155         nextscript sleeptime $sleeptime
    116156      fi
     157      # FIXME: sge cuts scriptname to 8 digits in qstat
    117158      # get processes of user in queue
    118       q1=(`echo ${q[@]} | egrep -o Owner$user`)
     159      q1=( `echo ${q[@]} | egrep -o "Owner$user"`)
    119160      queued=${#q1[@]}
    120161      # get scripts in queue
    121       q2=(`echo ${q[@]} | egrep -o ${scripts[$i]}`)
     162      q2=( `echo ${q[@]} | egrep -o "${scripts[$i]}"`)
    122163      queuedscript=${#q2[@]}
    123164      # get running scripts
    124       q3=( `echo ${q[@]} | egrep -o \(${scripts[$i]}Jobstatus2\|${scripts[$i]}Jobstatusr\)` )
     165      q3=( `echo ${q[@]} | egrep -o \("${scripts[$i]}"Jobstatus2\|"${scripts[$i]}"Jobstatusr\)` )
    125166      runningscript=${#q3[@]}
    126167      stillinqueue=`echo $queuedscript - $runningscript | bc `
     
    171212      date=`date +%Y-%m-%d`
    172213      echo `date +%F\ %T`" committing 1 ${scripts[$i]} to $queuesys" >> $jmscriptlog 2>&1
    173 #      if ! /usr/local/bin/condor_submit -a path=$scriptspath -a prog=${scripts[$i]} -a date=$date -a dir=$runlogpath $scriptspath/run.condor 2>> $jmerrorlog
    174 #      if ! /opt/gridengine/bin/lx26-amd64/qsub -e $runlogpath/error-$date.log -o $runlogpath/log-$(date).log 2>> $jmerrorlog
    175214      if ! queuesubmit 2>> $jmerrorlog
    176215      then
Note: See TracChangeset for help on using the changeset viewer.