Ignore:
Timestamp:
08/22/06 13:05:14 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7906 r7908  
    3030
    3131
    32 #source `dirname $0`/sourcefile (is done in jobsourcefile)
    33 
     32source `dirname $0`/sourcefile
    3433user=`whoami`
    35 sourcefile=/home/$user/Mars.cvs/datacenter/scripts/jobsourcefile
    36 source $sourcefile
    3734
    3835notcount=0
     
    4643      dayofweek=`date +%u`
    4744      hour=`date +%k`
    48       source $sourcefile
     45      source `dirname $0`/sourcefile
    4946      echo "script: ${scripts[$i]}" #>> $scriptlog 2>&1
    50       echo " day: $dayofweek hour: $hour" #>> $scriptlog 2>&1
     47#      echo " day: $dayofweek hour: $hour" #>> $scriptlog 2>&1
    5148      queued=`/usr/local/bin/condor_q -global -format "%s\n" Owner | grep -c $user`
    5249      queued=`setzero $queued`
    53       echo " found $queued jobs in the queue (incl. running jobs)" #>> $scriptlog 2>&1
    5450      queuedscript=`/usr/local/bin/condor_q -global | grep $user | grep -c ${scripts[$i]}`
    5551      queuedscript=`setzero $queuedscript`
    56       echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs)" #>> $scriptlog 2>&1
    5752
    5853      pnototal=${pnototal[$hour]}
     
    6459      num=`echo "((( $i + 1 ) * 24 ) + ( $hour + 1 ) ) - 24 - 1 " | bc `
    6560      pnoscript=${pnos[$num]}
    66       echo " => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" #>> $scriptlog 2>&1
     61      echo " found $queued jobs in the queue (incl. running jobs) [allowed $pnototal]" #>> $scriptlog 2>&1
     62      echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs) [allowed $pnoscript]" #>> $scriptlog 2>&1
     63#      echo "  => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" #>> $scriptlog 2>&1
    6764     
    68       echo " queued: $queued - pnototal: $pnototal" #>> $scriptlog 2>&1
    6965      if [ "$queued" -gt "$pnototal" ]
    7066      then
    7167         continue
    7268      else
    73          echo " queued ${scripts[$i]}: $queuedscript - pno: $pnoscript" #>> $scriptlog 2>&1
    7469         if [ "$queuedscript" -gt "$pnoscript" ]
    7570         then
     
    7772         fi
    7873      fi
    79      
    80       echo " gettodo..."
    81       echo "getting db..."
    82       db=`grep Database $mars/sql.rc | grep -v '#' | sed -e 's/Database: //' -e 's/ //g'`
    83       col=${scriptscolname[$i]}
    84       table=`grep "$col:" $steps | sed -e "s/[.]$col://" -e 's/#//' -e 's/ //g'`
    85       coltab=`grep "$col:" $steps | sed -e 's/://' -e 's/#//' -e 's/ //g'`
    86       needs=`grep "$coltab[.]Needs:" $steps | sed -e "s/$coltab[.]Needs://"`
    87       influences=`grep "$coltab[.]Influences:" $steps | sed -e "s/$coltab[.]Influences://"`
    88       primary=fSequenceFirst
    89       echo "db: $db - col $col - table $table - coltab $coltab"
    90       echo "needs: $needs"
    91       echo "influences: $influences"
    92       query="select $primary from $table where "
    93       for need in $needs
    94       do
    95          query=$query" not isnull($need) and"
    96       done
    97       for influence in $influences
    98       do
    99          query=$query" isnull($influence) and"
    100       done
    101       query=$query" isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) order by $primary desc limit 0, 1 "
    102       echo "QUERY: "$query
    103       echo ""
    104       echo " gettodofiles -> pno"
    10574
    106       if [ "$pno" == "0" ]
    107       then
    108          echo " pno = $pno -> continue" #>> $scriptlog 2>&1
    109          echo "" #>> $scriptlog 2>&1
    110          continue
    111       fi
     75      singleprocess="yes"
     76      gettodo
    11277
    11378      y=`date +%Y`
     
    11580      d=`date +%d`
    11681      condordir=$logpath/condor/$y/$m/$d
    117       makedir  $condordir #>> $scriptlog 2>&1
     82      makedir $condordir #>> $scriptlog 2>&1
    11883     
    119       echo "  ---> starting $pno ${scripts[$i]}..." #>> $scriptlog 2>&1
     84#      echo "  ---> starting ${scripts[$i]} for $process" #>> $scriptlog 2>&1
    12085     
    12186      #test
    122       echo ""
    123       continue
     87      contex
    12488      #test
    12589      if ! /usr/local/bin/condor_submit -a path=$scriptspath -a prog=${scripts[$i]} -a y=$y -a m=$m -a d=$d $scriptspath/run.condor 2>$errorlog
Note: See TracChangeset for help on using the changeset viewer.