Ignore:
Timestamp:
08/24/06 12:15:46 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7920 r7927  
    4343
    4444column=fGanymed
    45 #pno=24 # number of processes, i.e. number of todo-files
    46 
    47 lockfile=$lockpath/lock-getting-$program-list.txt
    4845
    4946scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
     
    5350date >> $scriptlog 2>&1
    5451
    55 # get todo file
    56 possibletodofiles=`ls -r $listpath/ToDo-*-$column-*.txt`  >> $scriptlog 2>&1
    57 if [ "$possibletodofiles" = "" ]
     52# get dataset #
     53gettodo >> $scriptlog 2>&1
     54dataset=$process
     55
     56# lock sequ
     57lockfile=$lockpath/lock-$table-$column-$dataset.txt
     58checklock >> $scriptlog 2>&1
     59
     60cd $mars
     61
     62echo "run $program for dataset $dataset..." >> $scriptlog 2>&1
     63no=`printf %08d $dataset | cut -c 0-5`
     64no2=`printf %08d $dataset`
     65var1=$no
     66var2=$no2
     67outpath="$datapath/$program/$no/$no2"
     68makedir $outpath >> $scriptlog 2>&1
     69
     70datasetfile="$datasetpath/$no/dataset$no2.txt"
     71# get observation mode to choose ganymed.rc file
     72wobble=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
     73wobble2=`echo $wobble | grep ^\#` >> $scriptlog 2>&1
     74if [ "$wobble2" = "" ]
    5875then
    59    echo "ERROR: in $program no todofiles found => something went wrong in jobmanager"
    60    finish >> $scriptlog 2>&1
     76   mode="wobble" >> $scriptlog 2>&1
    6177else
    62    singleprocess="yes"
    63    echo "todofiles: "${possibletodofiles[@]} >> $scriptlog 2>&1
    64    for possibletodofile in ${possibletodofiles[@]}
    65    do
    66       if ! ls $possibletodofile >> $scriptlog 2>&1
    67       then
    68          echo "file is not on disk -> continue" >> $scriptlog 2>&1
    69          continue
    70       fi
    71       lockfile=`echo $possibletodofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'`
    72       checklock >> $scriptlog 2>&1
    73       todofile=$possibletodofile
    74    done
     78   mode="onoff" >> $scriptlog 2>&1
    7579fi
    76 if [ "$todofile" = "" ]
    77 then
    78    echo "no todofile found -> exit"  >> $scriptlog 2>&1
    79    finish >> $scriptlog 2>&1
    80 fi
     80ganymedrc=$setuppath/ganymed/ganymed_$mode.rc
    8181
    82 # retrieve dataset from todo file
    83 datasets=(`cat $todofile`)
    84 if [ "$datasets" = "" ]
    85 then
    86    echo "nothing to do -> exit"  >> $scriptlog 2>&1
    87    finish >> $scriptlog 2>&1
    88 fi
    89 echo "datasets: "${datasets[@]} >> $scriptlog 2>&1
    90 rm -v $todofile >> $scriptlog 2>&1
     82setstatus "start" >> $scriptlog 2>&1
    9183
    92 # run ganymed for dataset
    93 for dataset in ${datasets[@]}
    94 do
    95   echo "run $program for dataset $dataset..." >> $scriptlog 2>&1
    96   no=`printf %08d $dataset | cut -c 0-5`
    97   no2=`printf %08d $dataset`
    98   var1=$no
    99   var2=$no2
    100   outpath="$datapath/$program/$no/$no2"
    101   makedir $outpath >> $scriptlog 2>&1
     84./ganymed -b -q -v4 -f --ind=$datapath/star --config=$ganymedrc --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath $datasetfile  2>> $scriptlog> /dev/null
     85check1=$?
    10286
    103   datasetfile="$datasetpath/$no/dataset$no2.txt"
    104   # get observation mode to choose ganymed.rc file
    105   wobble=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
    106   wobble2=`echo $wobble | grep ^\#` >> $scriptlog 2>&1
    107   if [ "$wobble2" = "" ]
    108   then
    109      mode="wobble" >> $scriptlog 2>&1
    110   else
    111      mode="onoff" >> $scriptlog 2>&1
    112   fi
    113   ganymedrc=$setuppath/ganymed/ganymed_$mode.rc
    114  
    115   setstatus "start" >> $scriptlog 2>&1
     87case $check1 in
     88   0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
     89   *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     90        com=$Fganymed
     91        check=$check1
     92        ;;
     93esac
    11694
    117   ./ganymed -b -q -v4 -f --ind=$datapath/star --config=$ganymedrc --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath $datasetfile  2>> $scriptlog> /dev/null
    118   check1=$?
    119 
    120   case $check1 in
    121      0)   echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
    122      *)   echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
    123           com=$Fganymed
    124           check=$check1
    125           ;;
    126   esac
    127  
    128   setstatus "stop" >> $scriptlog 2>&1
    129 done
     95setstatus "stop" >> $scriptlog 2>&1
    13096
    13197finish >> $scriptlog 2>&1
Note: See TracChangeset for help on using the changeset viewer.