Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7255)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7256)
@@ -18,4 +18,22 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/08/02 Daniela Dorner
+
+   * datacenter/macros/getdolist.C:
+     - added if-clause to distinguish between steps that need one todo
+       file and steps that need one todo file per sequence/dataset (i.e.
+       callisto, star, ganymed) and added writing of these files
+
+   * datacenter/scripts/runcallisto, runganymed, runstar:
+     - adapted scripts to the changes in getdolist.C (removed lines to 
+       divide todo file, changed getting of todo file)
+
+   * datacenter/scripts/runcallisto:
+     - added if-clause for the choosing of the correct callisto.rc 
+       (needed due to the new callist_MarApr05.rc which is applied 
+       between sequence 49736 and 53315
+
+
 
  2005/08/02 Daniela Dorner
Index: trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7255)
+++ trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7256)
@@ -118,15 +118,37 @@
         return 0;
 
-    TString filename(Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data()));
-    ofstream fout(filename, ios::app);
-    if (!fout)
+
+    TString filename;
+    TSQLRow *row=0;
+
+    if ((table=="SequenceProcessStatus" && column=="fCallisto") ||
+        (table=="SequenceProcessStatus" && column=="fStar") ||
+        (table=="DataSetProcessStatus" && column=="fGanymed"))
     {
-        cout << "ERROR - Cannot open file " << filename << endl;
-        return 0;
+        while ((row = res->Next()))
+        {
+            filename=Form("%s/ToDo-%s-%s-%s.txt", listpath.Data(), table.Data(), column.Data(), (*row)[0]);
+            ofstream fout(filename, ios::app);
+            if (!fout)
+            {
+                cout << "ERROR - Cannot open file " << filename << endl;
+                return 0;
+            }
+            fout << (*row)[0] << endl;
+        }
     }
+    else
+    {
+        filename=Form("%s/ToDo-%s-%s.txt", listpath.Data(), table.Data(), column.Data());
+        ofstream fout(filename, ios::app);
+        if (!fout)
+        {
+            cout << "ERROR - Cannot open file " << filename << endl;
+            return 0;
+        }
 
-    TSQLRow *row=0;
-    while ((row = res->Next()))
-        fout << (*row)[0] << endl;
+        while ((row = res->Next()))
+            fout << (*row)[0] << endl;
+    }
 
     delete res;
Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7255)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7256)
@@ -33,4 +33,5 @@
 
 callistorcnew=$setuppath/callisto/callisto.rc
+callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc
 
 table=SequenceProcessStatus
@@ -39,5 +40,5 @@
 datetime=`date +%F-%H-%M-%S`
 year=`date +%Y`
-pno=500 # number of processes, i.e. number of todo-files
+#pno=500 # number of processes, i.e. number of todo-files
 
 todofile=$listpath/ToDo-$table-$column
@@ -72,7 +73,4 @@
    echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
 else
-#   echo "run checkfilesforsequenceavail" >> $scriptlog 2>&1
-#   $scriptspath/checkfilesforsequenceavail
-   
    echo "getting list..." >> $scriptlog 2>&1
    check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
@@ -82,30 +80,4 @@
        *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    esac
-   echo "cutting to-do-file" >> $scriptlog 2>&1
-   echo "getting no of lines" >> $scriptlog 2>&1
-   lines=`cat $todofile.txt | wc -l`
-   echo "number of lines: "$lines >> $scriptlog 2>&1
-   while (( "$lines" < "$pno" ))
-   do
-      echo "# of lines ($lines) < # of processes ($pno) "
-      pno=`expr $pno / 2` 
-   done
-   echo "pno: "$pno
-   nofiles=`expr $lines / \( $pno - 1 \)`
-   nofiles=`expr $nofiles + 1 `
-   echo "number of files: "$nofiles >> $scriptlog 2>&1
-   echo "deviding todo-file" >> $scriptlog 2>&1
-   for (( j=1 ; j <= $pno ; j++ ))
-   do 
-     begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
-     end=$(echo "$begin + $nofiles - 1" | bc -l)
-     echo "begin: "$begin >> $scriptlog 2>&1
-     echo "end: "$end >> $scriptlog 2>&1
-     file=${todofile}-${j}.txt
-     echo "file: "$file >> $scriptlog 2>&1
-     sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
-   done
-
-   rm -v $todofile.txt >> $scriptlog 2>&1
 fi
 
@@ -114,12 +86,17 @@
 nr=bla
 echo "finding the right todo-file" >> $scriptlog 2>&1
-for (( i = 1; i <= $pno ; i++ ))
+todofiles=`ls $listpath/ToDo-$table-$column-*`
+
+echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
+
+for todofile in ${todofiles[@]}
 do 
-   if ! ls $todofile-$i.txt >> $scriptlog 2>&1
+   if ! ls $todofile >> $scriptlog 2>&1
    then 
       echo "file is not on disk -> continue" >> $scriptlog 2>&1
       continue
    fi
-   date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1
+   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
+   date > $lockfile >> $scriptlog 2>&1
    checklock=$?
    case $checklock in 
@@ -139,12 +116,11 @@
 esac
 
-
-sequences=(`cat $todofile-$nr.txt`)
+sequences=(`cat $todofile`)
 
 if [ "$sequences" = "" ]
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+   rm -v $todofile >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -170,5 +146,10 @@
   else
      echo "no callisto.rc found in $outpath -> making link " >> $scriptlog 2>&1
-     ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
+     if [ 49735 -lt $sequence ] && [ $sequence -lt 53516 ]
+     then 
+        ln -vs $callistorcmarapr05 $outpath/callisto.rc >> $scriptlog 2>&1
+     else
+        ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1
+     fi
      callistorcseq=$outpath/callisto.rc
   fi
@@ -258,6 +239,6 @@
 done
 
-rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+rm -v $todofile >> $scriptlog 2>&1
+rm -v $lockfile >> $scriptlog 2>&1
 
 set +C
Index: trunk/MagicSoft/Mars/datacenter/scripts/runganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7255)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7256)
@@ -37,5 +37,5 @@
 datetime=`date +%F-%H-%M-%S`
 year=`date +%Y`
-pno=24 # number of processes, i.e. number of todo-files
+#pno=24 # number of processes, i.e. number of todo-files
 
 todofile=$listpath/ToDo-$table-$column
@@ -78,29 +78,4 @@
        *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    esac
-   echo "cutting to-do-file" >> $scriptlog 2>&1
-   echo "getting no of lines" >> $scriptlog 2>&1
-   lines=`cat $todofile.txt | wc -l`
-   echo "number of lines: "$lines >> $scriptlog 2>&1
-   while (( "$lines" < "$pno" ))
-   do
-      echo "# of lines ($lines) < # of processes ($pno) "
-      pno=`expr $pno / 2` 
-   done
-   echo "pno: "$pno >> $scriptlog 2>&1
-   nofiles=`expr $lines / \( $pno - 1 \)`
-   echo "number of files: "$nofiles >> $scriptlog 2>&1
-   echo "deviding todo-file" >> $scriptlog 2>&1
-   for (( j=1 ; j <= $pno ; j++ ))
-   do 
-     begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
-     end=$(echo "$begin + $nofiles - 1" | bc -l)
-     echo "begin: "$begin >> $scriptlog 2>&1
-     echo "end: "$end >> $scriptlog 2>&1
-     file=${todofile}-${j}.txt
-     echo "file: "$file >> $scriptlog 2>&1
-     sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
-   done
-
-   rm -v $todofile.txt >> $scriptlog 2>&1
 fi
 
@@ -109,12 +84,13 @@
 nr=bla
 echo "finding the right todo-file" >> $scriptlog 2>&1
-for (( i = 1; i <= $pno ; i++ ))
+for todofile in ${todofiles[@]}
 do 
-   if ! ls $todofile-$i.txt >> $scriptlog 2>&1
+   if ! ls $todofile >> $scriptlog 2>&1
    then 
       echo "file is not on disk -> continue" >> $scriptlog 2>&1
       continue
    fi
-   date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 
+   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
+   date > $lockfile >> $scriptlog 2>&1
    checklock=$?
    case $checklock in 
@@ -135,11 +111,11 @@
 
 
-datasets=(`cat $todofile-$nr.txt`)
+datasets=(`cat $todofile`)
 
 if [ "$datasets" = "" ]
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+   rm -v $todofile >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -189,6 +165,6 @@
 done
 
-rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+rm -v $todofile >> $scriptlog 2>&1
+rm -v $lockfile >> $scriptlog 2>&1
 
 set +C
Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7255)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7256)
@@ -37,5 +37,5 @@
 datetime=`date +%F-%H-%M-%S`
 year=`date +%Y`
-pno=500 # number of processes, i.e. number of todo-files
+#pno=500 # number of processes, i.e. number of todo-files
 
 todofile=$listpath/ToDo-$table-$column
@@ -77,30 +77,4 @@
        *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    esac
-   echo "cutting to-do-file" >> $scriptlog 2>&1
-   echo "getting no of lines" >> $scriptlog 2>&1
-   lines=`cat $todofile.txt | wc -l`
-   echo "number of lines: "$lines >> $scriptlog 2>&1
-   while (( "$lines" < "$pno" ))
-   do
-      echo "# of lines ($lines) < # of processes ($pno) "
-      pno=`expr $pno / 2` 
-   done
-   echo "pno: "$pno
-   nofiles=`expr $lines / \( $pno - 1 \)`
-   nofiles=`expr $nofiles + 1 `
-   echo "number of files: "$nofiles >> $scriptlog 2>&1
-   echo "deviding todo-file" >> $scriptlog 2>&1
-   for (( j=1 ; j <= $pno ; j++ ))
-   do 
-     begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
-     end=$(echo "$begin + $nofiles - 1" | bc -l)
-     echo "begin: "$begin >> $scriptlog 2>&1
-     echo "end: "$end >> $scriptlog 2>&1
-     file=${todofile}-${j}.txt
-     echo "file: "$file >> $scriptlog 2>&1
-     sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
-   done
-
-   rm -v $todofile.txt >> $scriptlog 2>&1
 fi
 
@@ -109,12 +83,18 @@
 nr=bla
 echo "finding the right todo-file" >> $scriptlog 2>&1
-for (( i = 1; i <= $pno ; i++ ))
+todofiles=`ls $listpath/*`
+
+echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
+
+
+for todofile in ${todofiles[@]}
 do 
-   if ! ls $todofile-$i.txt >> $scriptlog 2>&1
+   if ! ls $todofile >> $scriptlog 2>&1
    then 
       echo "file is not on disk -> continue" >> $scriptlog 2>&1
       continue
    fi
-   date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 
+   lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
+   date > $lockfile >> $scriptlog 2>&1
    checklock=$?
    case $checklock in 
@@ -135,11 +115,11 @@
 
 
-sequences=(`cat $todofile-$nr.txt`)
+sequences=(`cat $todofile`)
 
 if [ "$sequences" = "" ]
 then 
    echo "nothing to do -> exit"  >> $scriptlog 2>&1
-   rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-   rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+   rm -v $todofile >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
    date  >> $scriptlog 2>&1
    exit
@@ -182,6 +162,6 @@
 done
 
-rm -v $todofile-$nr.txt >> $scriptlog 2>&1
-rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
+rm -v $todofile >> $scriptlog 2>&1
+rm -v $lockfile >> $scriptlog 2>&1
 
 set +C
