Changeset 9122 for trunk/MagicSoft/Mars/datacenter/scripts
- Timestamp:
- 08/15/08 13:49:05 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r8527 r9122 68 68 69 69 # check if there's something to do 70 column=${scriptscolname[$i]} 70 71 getstatus >> $jmscriptlog 2>&1 71 72 echo " $numproc ${scripts[$i]} still do to" >> $jmscriptlog 2>&1 -
trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
r8482 r9122 31 31 printprocesslog "INFO starting $0 $@" 32 32 33 makedir $listpath34 makedir $lockpath35 36 33 errorlog=$runlogpath/scriptlauncher-error`date +%F`.log 37 34 scriptlog=$runlogpath/scriptlauncher`date +%F`.log … … 42 39 date=`date +%Y-%m-%d` 43 40 44 scripts=( `echo $@ | sed -e 's/allatthesametime//'` ) 45 num=${#scripts[@]} 46 echo "$num scripts have to be launched" >> $scriptlog 2>&1 47 i=0 41 num=$# 42 echo "$num scripts have to be launched" #>> $scriptlog 2>&1 43 i=1 48 44 49 while [ $i -lt $num ] 45 if echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog 46 then 47 all="yes" 48 else 49 all="no" 50 fi 51 52 while [ $i -le $num ] 50 53 do 51 echo " launching ${scripts[$i]}..." >> $scriptlog 2>&1 52 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=${scripts[$i]} -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2` 54 com=( ) 55 prog= 56 if [ "$1" = "allatthesametime" ] 57 then 58 shift 59 i=`expr $i + 1` 60 continue 61 fi 62 com=( $1 ) 63 prog=${com[0]} 64 if ! ls $path/${com[0]} >/dev/null 2>&1 65 then 66 echo "script $path/$1 does not exist." >> $scriptlog 2>&1 67 shift 68 i=`expr $i + 1` 69 continue 70 fi 71 if [ `echo $1 | wc -w` -gt 1 ] 72 then 73 unset com[0] 74 args='-a args="'${com[@]}'"' 75 fi 76 echo " launching $1..." >> $scriptlog 2>&1 77 echo "/usr/local/bin/condor_submit -a path=$path -a prog=$prog $args -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2" >> $scriptlog 2>&1 78 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$prog $args -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2` 53 79 if [ "$pid" = "" ] 54 80 then 55 81 echo `date`" WARN condor is not working " >> $errorlog 2>&1 56 printprocesslog "WARN submitting ${scripts[$i]} to condor failed" 82 printprocesslog "WARN submitting $1 to condor failed" 83 shift 84 i=`expr $i + 1` 57 85 continue 58 86 fi 59 if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog87 if [ "$all" = "no" ] 60 88 then 61 echo " waiting for $ {scripts[$i]}to be done..." >> $scriptlog 2>&189 echo " waiting for $1 to be done..." >> $scriptlog 2>&1 62 90 /usr/local/bin/condor_wait $runlogpath/condor-$date.log $pid >/dev/null 2>$errorlog 63 91 fi 92 shift 64 93 i=`expr $i + 1` 65 94 done -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r9088 r9122 37 37 scriptspath=$mars/datacenter/scripts 38 38 39 webpath=/www/htdocs/datacenter40 41 39 datetime=`date +%F-%H-%M-%S` 42 40 … … 69 67 70 68 makedir $lockpath 71 makedir $listpath72 69 73 70 # set checkvalue to ok at the beginning of the scripts … … 107 104 #again run process status 108 105 FCompmux=26 106 Fdowebplots=27 109 107 110 108 # setup for jobmanager: … … 160 158 function checklock() 161 159 { 162 date > $lockfile 160 date > $lockfile 163 161 checklock0=$? 164 162 case $checklock0 in … … 309 307 numproc= 310 308 getdbsetup 311 column=${scriptscolname[$i]}312 309 getstepinfo 313 310 # get query … … 324 321 query=$query" group by $column " 325 322 # echo " QUERY: "$query 326 numproc=0327 323 if ! numproc=`mysql -s -u $us --password=$pw --host=vela $db -e " $query "` 328 324 then … … 336 332 function setstatus() 337 333 { 334 if [ "$column" = "no" ] 335 then 336 return 337 fi 338 338 resetstatusvalues 339 339 evalstatus $@
Note:
See TracChangeset
for help on using the changeset viewer.