Ignore:
Timestamp:
08/03/05 20:45:43 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7233 r7256  
    3333
    3434callistorcnew=$setuppath/callisto/callisto.rc
     35callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc
    3536
    3637table=SequenceProcessStatus
     
    3940datetime=`date +%F-%H-%M-%S`
    4041year=`date +%Y`
    41 pno=500 # number of processes, i.e. number of todo-files
     42#pno=500 # number of processes, i.e. number of todo-files
    4243
    4344todofile=$listpath/ToDo-$table-$column
     
    7273   echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
    7374else
    74 #   echo "run checkfilesforsequenceavail" >> $scriptlog 2>&1
    75 #   $scriptspath/checkfilesforsequenceavail
    76    
    7775   echo "getting list..." >> $scriptlog 2>&1
    7876   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     
    8280       *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    8381   esac
    84    echo "cutting to-do-file" >> $scriptlog 2>&1
    85    echo "getting no of lines" >> $scriptlog 2>&1
    86    lines=`cat $todofile.txt | wc -l`
    87    echo "number of lines: "$lines >> $scriptlog 2>&1
    88    while (( "$lines" < "$pno" ))
    89    do
    90       echo "# of lines ($lines) < # of processes ($pno) "
    91       pno=`expr $pno / 2`
    92    done
    93    echo "pno: "$pno
    94    nofiles=`expr $lines / \( $pno - 1 \)`
    95    nofiles=`expr $nofiles + 1 `
    96    echo "number of files: "$nofiles >> $scriptlog 2>&1
    97    echo "deviding todo-file" >> $scriptlog 2>&1
    98    for (( j=1 ; j <= $pno ; j++ ))
    99    do
    100      begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
    101      end=$(echo "$begin + $nofiles - 1" | bc -l)
    102      echo "begin: "$begin >> $scriptlog 2>&1
    103      echo "end: "$end >> $scriptlog 2>&1
    104      file=${todofile}-${j}.txt
    105      echo "file: "$file >> $scriptlog 2>&1
    106      sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
    107    done
    108 
    109    rm -v $todofile.txt >> $scriptlog 2>&1
    11082fi
    11183
     
    11486nr=bla
    11587echo "finding the right todo-file" >> $scriptlog 2>&1
    116 for (( i = 1; i <= $pno ; i++ ))
     88todofiles=`ls $listpath/ToDo-$table-$column-*`
     89
     90echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
     91
     92for todofile in ${todofiles[@]}
    11793do
    118    if ! ls $todofile-$i.txt >> $scriptlog 2>&1
     94   if ! ls $todofile >> $scriptlog 2>&1
    11995   then
    12096      echo "file is not on disk -> continue" >> $scriptlog 2>&1
    12197      continue
    12298   fi
    123    date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1
     99   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
     100   date > $lockfile >> $scriptlog 2>&1
    124101   checklock=$?
    125102   case $checklock in
     
    139116esac
    140117
    141 
    142 sequences=(`cat $todofile-$nr.txt`)
     118sequences=(`cat $todofile`)
    143119
    144120if [ "$sequences" = "" ]
    145121then
    146122   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    147    rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    148    rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     123   rm -v $todofile >> $scriptlog 2>&1
     124   rm -v $lockfile >> $scriptlog 2>&1
    149125   date  >> $scriptlog 2>&1
    150126   exit
     
    170146  else
    171147     echo "no callisto.rc found in $outpath -> making link " >> $scriptlog 2>&1
    172      ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
     148     if [ 49735 -lt $sequence ] && [ $sequence -lt 53516 ]
     149     then
     150        ln -vs $callistorcmarapr05 $outpath/callisto.rc >> $scriptlog 2>&1
     151     else
     152        ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
     153     fi
    173154     callistorcseq=$outpath/callisto.rc
    174155  fi
     
    258239done
    259240
    260 rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    261 rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     241rm -v $todofile >> $scriptlog 2>&1
     242rm -v $lockfile >> $scriptlog 2>&1
    262243
    263244set +C
Note: See TracChangeset for help on using the changeset viewer.