IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2009, 11:34:24 AM (17 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/ippTasks/dist.pro

    r25402 r25625  
    1616$distQueue_DB = 0
    1717
     18### list of stages
     19#list of stages
     20$DIST_STAGE:n = 0
     21list DIST_STAGE -add "raw"
     22list DIST_STAGE -add "chip"
     23list DIST_STAGE -add "camera"
     24list DIST_STAGE -add "fake"
     25list DIST_STAGE -add "warp"
     26list DIST_STAGE -add "diff"
     27list DIST_STAGE -add "stack"
     28
     29$currentStage = 0
     30
    1831### Check status of tasks
    1932macro dist.status
     
    4255    active true
    4356  end
    44   task dist.queueruns
    45 #   We aren't ready to run this task yet. It will queue much too much
    46 #    active true
    47     active false
    48   end
    49 end
     57end
     58
    5059macro dist.off
    5160  task dist.process.load
     
    5968  end
    6069  task dist.advance.run
    61     active false
    62   end
    63   task dist.queueruns
    6470    active false
    6571  end
     
    7480  npending     1
    7581
    76   stdout NULL
    77   stderr $LOGDIR/dist.process.log
    7882
    7983  task.exec
    80     $run = disttool -pendingcomponent
     84     # stdout NULL
     85     # stderr $LOGSUBDIR/dist.process.load.log
     86
     87    $run = disttool -pendingcomponent -stage $DIST_STAGE:$currentStage
     88    $currentStage ++
     89    if ($currentStage >= $DIST_STAGE:n) set currentStage = 0
     90
    8191    if ($DB:n == 0)
    8292      option DEFAULT
     
    8595      option $DB:$distToProcess_DB
    8696      $run = $run -dbname $DB:$distToProcess_DB
    87       $distToProcess_DB ++
    88       if ($distToProcess_DB >= $DB:n) set distToProcess_DB = 0
     97
     98      # only increment the database number after we have gone through all of
     99      # the stages
     100      if ($currentStage == 0)
     101          $distToProcess_DB ++
     102          if ($distToProcess_DB >= $DB:n) set distToProcess_DB = 0
     103      end
    89104    end
    90105    add_poll_args run
     
    134149    if ("$pageName" == "NULL") break
    135150
     151#    echo running $pageName
     152
    136153    book setword distToProcess $pageName pantaskState RUN
    137154    book getword distToProcess $pageName dist_id -var DIST_ID
    138155    book getword distToProcess $pageName camera -var CAMERA
    139     book getword distToProcess $pageName stage -var STAGE
    140     book getword distToProcess $pageName stage_id -var STAGE_ID
     156    book getword distToProcess $pageName stage -var DIST_STAGE
     157    book getword distToProcess $pageName stage_id -var DIST_STAGE_ID
    141158    book getword distToProcess $pageName clean -var CLEAN
    142159    book getword distToProcess $pageName component -var COMPONENT
     
    159176        $EXTRA_ARGS = $EXTRA_ARGS --magicked
    160177    end
    161     # no_magic is output as integer due to the union in the sql
    162     if ($NO_MAGIC)
     178    # is this right for stack and fake?
     179    if ("$NO_MAGIC" == "T")
    163180        $EXTRA_ARGS = $EXTRA_ARGS --no_magic
    164181    end
     
    170187#    set.workdir.by.camera $CAMERA $MAGIC_ID $WORKDIR_TEMPLATE $default_host WORKDIR
    171188#    host anyhost
    172 
    173189
    174190    substr $COMPONENT 0 3 COMP_HEAD
     
    180196    end
    181197
    182 
    183198    sprintf logfile "%s/dist.%s.%s.log" $OUTDIR $DIST_ID $COMPONENT
    184     stdout $logfile
    185     stderr $logfile
    186 
    187     $run = dist_component.pl --dist_id $DIST_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --chip_path_base $CHIP_PATH_BASE --state $STATE --data_state $DATA_STATE $EXTRA_ARGS --outdir $OUTDIR --logfile $logfile
     199#    stdout $logfile
     200#    stderr $logfile
     201
     202    $run = dist_component.pl --dist_id $DIST_ID --camera $CAMERA --stage $DIST_STAGE --stage_id $DIST_STAGE_ID --component $COMPONENT --path_base $PATH_BASE --chip_path_base $CHIP_PATH_BASE --state $STATE --data_state $DATA_STATE $EXTRA_ARGS --outdir $OUTDIR --logfile $logfile
    188203
    189204    add_standard_args run
     
    211226end
    212227
    213 
    214228task           dist.advance.load
    215229  host         local
     
    220234  npending     1
    221235
    222   stdout NULL
    223   stderr $LOGDIR/dist.advance.load.log
    224 
    225236  task.exec
     237  #  stderr $LOGSUBDIR/dist.advance.load.log
     238
    226239    $run = disttool -toadvance
    227240    if ($DB:n == 0)
     
    261274  end
    262275end
     276
    263277
    264278task           dist.advance.run
     
    291305
    292306    sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID
    293     stdout $logfile
    294     stderr $logfile
     307#    stdout $logfile
     308#    stderr $logfile
    295309
    296310    $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
     
    318332  end
    319333end
    320 
    321 task           dist.queueruns
    322 #  host         local
    323 
    324   periods      -poll $RUNPOLL
    325   periods      -exec 30
    326   periods      -timeout 45
    327   npending     1
    328 
    329   active false
    330 
    331 #  stdout $LOGDIR/dist.queuruns
    332 #  stderr $LOGDIR/dist.queueruns
    333 
    334   task.exec
    335     $MYARGS = ""
    336     # assume that we need magic unless we are running simtest
    337     if ($?SIMTEST_CAMERA != 0)
    338         $MYARGS = --no_magic
    339     end
    340 
    341     $run = dist_queue_runs.pl $MYARGS --stage_limit 16 --logfile $LOGDIR/dist.queueruns
    342 
    343     if ($DB:n == 0)
    344        $DBNAME = DEFAULT
    345     else
    346       # save the DB name for add_standard_args
    347       $DBNAME =  $DB:$distQueue_DB
    348       $distQueue_DB ++
    349       if ($distQueue_DB >= $DB:n) set distQueue_DB = 0
    350     end
    351 
    352     host anyhost
    353 
    354     add_standard_args run
    355 
    356     # create the command line
    357     if ($VERBOSE > 1)
    358       echo command $run
    359     end
    360     command $run
    361   end
    362 
    363   task.exit     $EXIT_SUCCESS
    364     # nothing to do
    365   end
    366 
    367   # default exit status
    368   task.exit    default
    369     showcommand failure
    370   end
    371 
    372   # operation timed out?
    373   task.exit    timeout
    374     showcommand timeout
    375   end
    376 
    377   # operation timed out?
    378   task.exit    crash
    379     showcommand crash
    380   end
    381 end
Note: See TracChangeset for help on using the changeset viewer.