Changeset 7936 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 08/25/06 13:40:49 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r7933 r7936 36 36 37 37 echo "" >> $jmscriptlog 2>&1 38 echo `date`": starting jobmanager" >> $jmscriptlog 2>&138 echo "starting jobmanager ("`date`")" >> $jmscriptlog 2>&1 39 39 makedir $jmlogpath 40 40 makedir $listpath >> $jmscriptlog 2>&1 41 41 makedir $lockpath >> $jmscriptlog 2>&1 42 42 43 prev=$max 43 44 notcount=0 44 45 while (( $notcount < 100 )) … … 72 73 num=`echo "((( $i + 1 ) * 24 ) + ( $hour + 1 ) ) - 24 - 1 " | bc ` 73 74 pnoscript=${pnos[$num]} 75 if [ $prev -eq 0 ] 76 then 77 echo " prev=0 => resetting pnoscript [$pnoscript] to max [$max]" >> $jmscriptlog 2>&1 78 pnoscript=$max 79 fi 74 80 echo " found $queued jobs in the queue (incl. running jobs) [allowed $totalpno]" >> $jmscriptlog 2>&1 75 echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs) [allowed $pnoscript]" >> $jmscriptlog 2>&1 76 # echo " => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" >> $jmscriptlog 2>&1 81 echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs [$runningscript]) [allowed $pnoscript] - not running: $stillinqueue" >> $jmscriptlog 2>&1 77 82 78 83 if [ "$queued" -gt "$totalpno" ] … … 87 92 88 93 # check if there's something to do 89 getstatus 94 getstatus >> $jmscriptlog 2>&1 95 echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&1 90 96 if [ "$numproc" = "" ] 91 97 then 98 prev=0 92 99 cont >> $jmscriptlog 2>&1 93 100 fi 94 if ! [ $numproc -gt 0 ] 95 then 96 cont >> $jmscriptlog 2>&1 97 fi 101 prev=$max 98 102 if [ $numproc -lt $stillinqueue ] 99 103 then 100 echo " numproc($numproc) -lt stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1104 echo " numproc($numproc) -lt stillinqueue($stillinqueue)" >> $jmscriptlog 2>&1 101 105 cont >> $jmscriptlog 2>&1 102 106 fi … … 107 111 makedir $condordir >> $jmscriptlog 2>&1 108 112 113 echo " committing 1 ${scripts[$i]} to condor" >> $jmscriptlog 2>&1 109 114 if ! /usr/local/bin/condor_submit -a path=$scriptspath -a prog=${scripts[$i]} -a date=$date2 -a dir=$condordir $scriptspath/run.condor 2>> $jmerrorlog 110 115 then … … 114 119 sleep $errorsleeptime 115 120 fi 121 date >> $jmscriptlog 2>&1 116 122 echo "" >> $jmscriptlog 2>&1 117 123 done -
trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
r7922 r7936 38 38 scriptlog=$sllogpath/scriptlauncher`date +%F`.log 39 39 40 date>> $scriptlog 2>&140 echo `date`": starting $0 $@" >> $scriptlog 2>&1 41 41 42 42 path=`dirname $0` … … 44 44 date2=`date +%Y-%m-%d` 45 45 condordir=$logpath/condor/$date 46 makedir $condordir 46 makedir $condordir >> $scriptlog 2>&1 47 47 48 48 for i in $@ … … 52 52 continue 53 53 fi 54 echo " launching $i..." >> $scriptlog 2>&154 echo " launching $i..." >> $scriptlog 2>&1 55 55 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2` 2>$errorlog 56 56 if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog 57 57 then 58 echo " waiting for $i to be done..." >> $scriptlog 2>&158 echo " waiting for $i to be done..." >> $scriptlog 2>&1 59 59 /usr/local/bin/condor_wait $condordir/condor-$date2.log $pid >/dev/null 2>$errorlog 60 60 fi 61 61 done 62 62 echo `date`": all done/submitted." >> $scriptlog 2>&1 63 echo "" >> $scriptlog 2>&1 63 64 -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7927 r7936 38 38 39 39 webpath=/www/htdocs/datacenter 40 41 processlogpath=$logpath/run/`date +%Y/%m/%d` 42 processlog=$processlogpath/process`date +%F`.log 40 43 41 44 datetime=`date +%F-%H-%M-%S` … … 105 108 # defined 106 109 110 function printprocesslog 111 { 112 makedir $processlogpath 113 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "`basename $0`"["$$"] "$@ >> $processlog 114 } 115 107 116 # function to exit a script properly 108 117 function finish() … … 353 362 function getstatus() 354 363 { 364 printprocesslog "this is a test"`date` 355 365 numproc= 356 echo "getting status..."366 # echo "getting status..." 357 367 getdbsetup 358 368 column=${scriptscolname[$i]}
Note:
See TracChangeset
for help on using the changeset viewer.