Changeset 9492 for trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
- Timestamp:
- 08/14/09 17:14:50 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r9489 r9492 50 50 case $queuesys in 51 51 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]}` ' 53 56 # 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 } '" 55 59 break 56 60 ;; … … 69 73 prev=$max 70 74 user=`whoami` 75 currentnode=$minnode 76 numevaluated=0 71 77 # endless loop 72 78 notcount=0 … … 83 89 # check if there's something to do 84 90 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 86 128 echo `date +%F\ %T`" Database: $numproc ${scripts[$i]} still to be done (incl. idle jobs) [DB/table/column $db/$table/$column]" >> $jmscriptlog 2>&1 87 129 if [ "$numproc" = "" ] … … 105 147 106 148 # 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 `)109 149 q=(`checkqueue 2>&1 `) 110 150 if echo $q | egrep \(Error\|failed\) … … 115 155 nextscript sleeptime $sleeptime 116 156 fi 157 # FIXME: sge cuts scriptname to 8 digits in qstat 117 158 # get processes of user in queue 118 q1=( `echo ${q[@]} | egrep -o Owner$user`)159 q1=( `echo ${q[@]} | egrep -o "Owner$user"`) 119 160 queued=${#q1[@]} 120 161 # get scripts in queue 121 q2=( `echo ${q[@]} | egrep -o ${scripts[$i]}`)162 q2=( `echo ${q[@]} | egrep -o "${scripts[$i]}"`) 122 163 queuedscript=${#q2[@]} 123 164 # 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\)` ) 125 166 runningscript=${#q3[@]} 126 167 stillinqueue=`echo $queuedscript - $runningscript | bc ` … … 171 212 date=`date +%Y-%m-%d` 172 213 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>> $jmerrorlog174 # if ! /opt/gridengine/bin/lx26-amd64/qsub -e $runlogpath/error-$date.log -o $runlogpath/log-$(date).log 2>> $jmerrorlog175 214 if ! queuesubmit 2>> $jmerrorlog 176 215 then
Note:
See TracChangeset
for help on using the changeset viewer.