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/runstar

    r7233 r7256  
    3737datetime=`date +%F-%H-%M-%S`
    3838year=`date +%Y`
    39 pno=500 # number of processes, i.e. number of todo-files
     39#pno=500 # number of processes, i.e. number of todo-files
    4040
    4141todofile=$listpath/ToDo-$table-$column
     
    7777       *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    7878   esac
    79    echo "cutting to-do-file" >> $scriptlog 2>&1
    80    echo "getting no of lines" >> $scriptlog 2>&1
    81    lines=`cat $todofile.txt | wc -l`
    82    echo "number of lines: "$lines >> $scriptlog 2>&1
    83    while (( "$lines" < "$pno" ))
    84    do
    85       echo "# of lines ($lines) < # of processes ($pno) "
    86       pno=`expr $pno / 2`
    87    done
    88    echo "pno: "$pno
    89    nofiles=`expr $lines / \( $pno - 1 \)`
    90    nofiles=`expr $nofiles + 1 `
    91    echo "number of files: "$nofiles >> $scriptlog 2>&1
    92    echo "deviding todo-file" >> $scriptlog 2>&1
    93    for (( j=1 ; j <= $pno ; j++ ))
    94    do
    95      begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
    96      end=$(echo "$begin + $nofiles - 1" | bc -l)
    97      echo "begin: "$begin >> $scriptlog 2>&1
    98      echo "end: "$end >> $scriptlog 2>&1
    99      file=${todofile}-${j}.txt
    100      echo "file: "$file >> $scriptlog 2>&1
    101      sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
    102    done
    103 
    104    rm -v $todofile.txt >> $scriptlog 2>&1
    10579fi
    10680
     
    10983nr=bla
    11084echo "finding the right todo-file" >> $scriptlog 2>&1
    111 for (( i = 1; i <= $pno ; i++ ))
     85todofiles=`ls $listpath/*`
     86
     87echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
     88
     89
     90for todofile in ${todofiles[@]}
    11291do
    113    if ! ls $todofile-$i.txt >> $scriptlog 2>&1
     92   if ! ls $todofile >> $scriptlog 2>&1
    11493   then
    11594      echo "file is not on disk -> continue" >> $scriptlog 2>&1
    11695      continue
    11796   fi
    118    date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1
     97   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
     98   date > $lockfile >> $scriptlog 2>&1
    11999   checklock=$?
    120100   case $checklock in
     
    135115
    136116
    137 sequences=(`cat $todofile-$nr.txt`)
     117sequences=(`cat $todofile`)
    138118
    139119if [ "$sequences" = "" ]
    140120then
    141121   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    142    rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    143    rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     122   rm -v $todofile >> $scriptlog 2>&1
     123   rm -v $lockfile >> $scriptlog 2>&1
    144124   date  >> $scriptlog 2>&1
    145125   exit
     
    182162done
    183163
    184 rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    185 rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     164rm -v $todofile >> $scriptlog 2>&1
     165rm -v $lockfile >> $scriptlog 2>&1
    186166
    187167set +C
Note: See TracChangeset for help on using the changeset viewer.