Ignore:
Timestamp:
08/03/05 20:45:43 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/macros/getdolist.C

    r7235 r7256  
    118118        return 0;
    119119
    120     TString filename(Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data()));
    121     ofstream fout(filename, ios::app);
    122     if (!fout)
     120
     121    TString filename;
     122    TSQLRow *row=0;
     123
     124    if ((table=="SequenceProcessStatus" && column=="fCallisto") ||
     125        (table=="SequenceProcessStatus" && column=="fStar") ||
     126        (table=="DataSetProcessStatus" && column=="fGanymed"))
    123127    {
    124         cout << "ERROR - Cannot open file " << filename << endl;
    125         return 0;
     128        while ((row = res->Next()))
     129        {
     130            filename=Form("%s/ToDo-%s-%s-%s.txt", listpath.Data(), table.Data(), column.Data(), (*row)[0]);
     131            ofstream fout(filename, ios::app);
     132            if (!fout)
     133            {
     134                cout << "ERROR - Cannot open file " << filename << endl;
     135                return 0;
     136            }
     137            fout << (*row)[0] << endl;
     138        }
    126139    }
     140    else
     141    {
     142        filename=Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data());
     143        ofstream fout(filename, ios::app);
     144        if (!fout)
     145        {
     146            cout << "ERROR - Cannot open file " << filename << endl;
     147            return 0;
     148        }
    127149
    128     TSQLRow *row=0;
    129     while ((row = res->Next()))
    130         fout << (*row)[0] << endl;
     150        while ((row = res->Next()))
     151            fout << (*row)[0] << endl;
     152    }
    131153
    132154    delete res;
  • 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
  • trunk/MagicSoft/Mars/datacenter/scripts/runganymed

    r7233 r7256  
    3737datetime=`date +%F-%H-%M-%S`
    3838year=`date +%Y`
    39 pno=24 # number of processes, i.e. number of todo-files
     39#pno=24 # number of processes, i.e. number of todo-files
    4040
    4141todofile=$listpath/ToDo-$table-$column
     
    7878       *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    7979   esac
    80    echo "cutting to-do-file" >> $scriptlog 2>&1
    81    echo "getting no of lines" >> $scriptlog 2>&1
    82    lines=`cat $todofile.txt | wc -l`
    83    echo "number of lines: "$lines >> $scriptlog 2>&1
    84    while (( "$lines" < "$pno" ))
    85    do
    86       echo "# of lines ($lines) < # of processes ($pno) "
    87       pno=`expr $pno / 2`
    88    done
    89    echo "pno: "$pno >> $scriptlog 2>&1
    90    nofiles=`expr $lines / \( $pno - 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
    10580fi
    10681
     
    10984nr=bla
    11085echo "finding the right todo-file" >> $scriptlog 2>&1
    111 for (( i = 1; i <= $pno ; i++ ))
     86for todofile in ${todofiles[@]}
    11287do
    113    if ! ls $todofile-$i.txt >> $scriptlog 2>&1
     88   if ! ls $todofile >> $scriptlog 2>&1
    11489   then
    11590      echo "file is not on disk -> continue" >> $scriptlog 2>&1
    11691      continue
    11792   fi
    118    date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1
     93   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
     94   date > $lockfile >> $scriptlog 2>&1
    11995   checklock=$?
    12096   case $checklock in
     
    135111
    136112
    137 datasets=(`cat $todofile-$nr.txt`)
     113datasets=(`cat $todofile`)
    138114
    139115if [ "$datasets" = "" ]
    140116then
    141117   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
     118   rm -v $todofile >> $scriptlog 2>&1
     119   rm -v $lockfile >> $scriptlog 2>&1
    144120   date  >> $scriptlog 2>&1
    145121   exit
     
    189165done
    190166
    191 rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    192 rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     167rm -v $todofile >> $scriptlog 2>&1
     168rm -v $lockfile >> $scriptlog 2>&1
    193169
    194170set +C
  • 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.