Index: trunk/ippTasks/dist.pro
===================================================================
--- trunk/ippTasks/dist.pro	(revision 25429)
+++ trunk/ippTasks/dist.pro	(revision 25462)
@@ -18,12 +18,12 @@
 ### list of stages
 #list of stages
-$STAGE:n = 0
-list STAGE -add "raw"
-list STAGE -add "chip"
-list STAGE -add "camera"
-list STAGE -add "fake"
-list STAGE -add "warp"
-list STAGE -add "diff"
-list STAGE -add "stack"
+$DIST_STAGE:n = 0
+list DIST_STAGE -add "raw"
+list DIST_STAGE -add "chip"
+list DIST_STAGE -add "camera"
+list DIST_STAGE -add "fake"
+list DIST_STAGE -add "warp"
+list DIST_STAGE -add "diff"
+list DIST_STAGE -add "stack"
 
 $currentStage = 0
@@ -55,10 +55,6 @@
     active true
   end
-  task dist.queueruns
-#   We aren't ready to run this task yet. It will queue much too much 
-#    active true
-    active false
-  end
-end
+end
+
 macro dist.off
   task dist.process.load
@@ -72,7 +68,4 @@
   end
   task dist.advance.run
-    active false
-  end
-  task dist.queueruns
     active false
   end
@@ -87,11 +80,13 @@
   npending     1
 
-  stdout NULL
-  stderr $LOGDIR/dist.process.log
 
   task.exec
-    $run = disttool -pendingcomponent -stage $STAGE:$currentStage
+     # stdout NULL
+     # stderr $LOGSUBDIR/dist.process.load.log
+
+    $run = disttool -pendingcomponent -stage $DIST_STAGE:$currentStage
     $currentStage ++
-    if ($currentStage >= $STAGE:n) set currentStage = 0
+    if ($currentStage >= $DIST_STAGE:n) set currentStage = 0
+
     if ($DB:n == 0)
       option DEFAULT
@@ -154,9 +149,11 @@
     if ("$pageName" == "NULL") break
 
+#    echo running $pageName
+
     book setword distToProcess $pageName pantaskState RUN
     book getword distToProcess $pageName dist_id -var DIST_ID
     book getword distToProcess $pageName camera -var CAMERA
-    book getword distToProcess $pageName stage -var STAGE
-    book getword distToProcess $pageName stage_id -var STAGE_ID
+    book getword distToProcess $pageName stage -var DIST_STAGE
+    book getword distToProcess $pageName stage_id -var DIST_STAGE_ID
     book getword distToProcess $pageName clean -var CLEAN
     book getword distToProcess $pageName component -var COMPONENT
@@ -179,6 +176,6 @@
         $EXTRA_ARGS = $EXTRA_ARGS --magicked
     end
-    # no_magic is output as integer due to the union in the sql
-    if ($NO_MAGIC)
+    # is this right for stack and fake?
+    if ("$NO_MAGIC" == "T")
         $EXTRA_ARGS = $EXTRA_ARGS --no_magic
     end
@@ -190,5 +187,4 @@
 #    set.workdir.by.camera $CAMERA $MAGIC_ID $WORKDIR_TEMPLATE $default_host WORKDIR
 #    host anyhost
-
 
     substr $COMPONENT 0 3 COMP_HEAD
@@ -200,10 +196,9 @@
     end
 
-
     sprintf logfile "%s/dist.%s.%s.log" $OUTDIR $DIST_ID $COMPONENT
-    stdout $logfile
-    stderr $logfile
-
-    $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
+#    stdout $logfile
+#    stderr $logfile
+
+    $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
 
     add_standard_args run
@@ -231,5 +226,4 @@
 end
 
-
 task	       dist.advance.load
   host         local
@@ -240,8 +234,7 @@
   npending     1
 
-  stdout NULL
-  stderr $LOGDIR/dist.advance.load.log
-
   task.exec
+  #  stderr $LOGSUBDIR/dist.advance.load.log
+
     $run = disttool -toadvance
     if ($DB:n == 0)
@@ -281,4 +274,5 @@
   end
 end
+
 
 task	       dist.advance.run
@@ -311,6 +305,6 @@
 
     sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID
-    stdout $logfile
-    stderr $logfile
+#    stdout $logfile
+#    stderr $logfile
 
     $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
@@ -338,64 +332,2 @@
   end
 end
-
-task	       dist.queueruns
-#  host         local
-
-  periods      -poll $RUNPOLL
-  periods      -exec 30
-  periods      -timeout 45
-  npending     1
-
-  active false
-
-#  stdout $LOGDIR/dist.queuruns
-#  stderr $LOGDIR/dist.queueruns
-
-  task.exec
-    $MYARGS = ""
-    # assume that we need magic unless we are running simtest
-    if ($?SIMTEST_CAMERA != 0)
-        $MYARGS = --no_magic
-    end
-
-    $run = dist_queue_runs.pl $MYARGS --stage_limit 16 --logfile $LOGDIR/dist.queueruns
-
-    if ($DB:n == 0)
-       $DBNAME = DEFAULT
-    else
-      # save the DB name for add_standard_args
-      $DBNAME =  $DB:$distQueue_DB
-      $distQueue_DB ++
-      if ($distQueue_DB >= $DB:n) set distQueue_DB = 0
-    end
-
-    host anyhost
-
-    add_standard_args run
-
-    # create the command line
-    if ($VERBOSE > 1)
-      echo command $run
-    end
-    command $run
-  end
-
-  task.exit     $EXIT_SUCCESS
-    # nothing to do
-  end
-
-  # default exit status
-  task.exit    default
-    showcommand failure
-  end
-
-  # operation timed out?
-  task.exit    timeout
-    showcommand timeout
-  end
-
-  # operation timed out?
-  task.exit    crash
-    showcommand crash
-  end
-end
