Index: /branches/eam_branch_20080109/ippTasks/camera.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/camera.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/camera.pro	(revision 16149)
@@ -127,10 +127,6 @@
     book getword camPendingExp $pageName reduction -var REDUCTION
 
-    # specify choice of remote host:(need to choose based on chips)
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     # output log from filerule
Index: /branches/eam_branch_20080109/ippTasks/chip.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/chip.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/chip.pro	(revision 16149)
@@ -127,5 +127,5 @@
     book getword chipPendingImfile $pageName reduction -var REDUCTION
 
-    # specify choice of local or remote host
+    # specify choice of local or remote host based on camera and chip (class_id)
     set.host.for.camera $camera $class_id
 
Index: /branches/eam_branch_20080109/ippTasks/detrend.correct.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.correct.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.correct.pro	(revision 16149)
@@ -148,10 +148,6 @@
     book getword detPendingCorrectedImfile $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera $class_id
 
     ## output log filename
@@ -279,10 +275,6 @@
     book getword detPendingCorrectedExp $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     # XXX push this into the filerules?
Index: /branches/eam_branch_20080109/ippTasks/detrend.norm.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.norm.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.norm.pro	(revision 16149)
@@ -156,10 +156,6 @@
     book getword detPendingNormStatImfile $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     if ("$WORKDIR" == "NULL")
@@ -278,10 +274,6 @@
     book getword detPendingNormImfile $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera $class_id
 
     # XXX use ipp_filename.pl to lookup output file names
@@ -398,10 +390,6 @@
     book getword detPendingNormExp $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     # XXX add $WORKDIR/$LOG_DIR
Index: /branches/eam_branch_20080109/ippTasks/detrend.process.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.process.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.process.pro	(revision 16149)
@@ -147,10 +147,6 @@
     book getword detPendingProcessedImfile $pageName reduction -var REDUCTION
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera $class_id
 
     ## output log filename
@@ -276,10 +272,6 @@
     book getword detPendingProcessedExp $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     # XXX push this into the filerules?
Index: /branches/eam_branch_20080109/ippTasks/detrend.reject.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.reject.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.reject.pro	(revision 16149)
@@ -125,10 +125,6 @@
     book getword detRejectExp $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     if ("$WORKDIR" == "NULL")
Index: /branches/eam_branch_20080109/ippTasks/detrend.resid.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.resid.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.resid.pro	(revision 16149)
@@ -147,10 +147,6 @@
     book getword detPendingResidImfile $pageName reduction -var REDUCTION
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera $class_id
 
     # XXX use ipp_filename.pl to lookup output file names
@@ -279,10 +275,6 @@
     book getword detPendingResidExp $pageName dbname    -var DBNAME
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera FPA
 
     # XXX use ipp_filename.pl to lookup output file names
Index: /branches/eam_branch_20080109/ippTasks/detrend.stack.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/detrend.stack.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/detrend.stack.pro	(revision 16149)
@@ -127,10 +127,6 @@
     book getword detPendingStackedImfile $pageName reduction -var REDUCTION
 
-    # specify choice of remote host:
-    if ($parallel)
-      host anyhost
-    else
-      host local
-    end
+    # specify choice of local or remote host based on camera and chip (class_id)
+    set.host.for.camera $camera $class_id
 
     if ("$WORKDIR" == "NULL")
Index: /branches/eam_branch_20080109/ippTasks/pantasks.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/pantasks.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/pantasks.pro	(revision 16149)
@@ -340,7 +340,7 @@
 end
 
-macro set.host.for.camera
+macro set.host.by.camera
   if ($0 != 3)
-    echo "USAGE: set.host.for.camera (camera) (class_id)"
+    echo "USAGE: set.host.by.camera (camera) (class_id)"
     break
   end
@@ -351,5 +351,5 @@
   end
 
-  # XXX need to catch missing camera and/or chiphosts table and fallback on anyhost
+  # missing camera and/or chiphosts table results in host = NULL
   book getword chiphosts $1 $2 -var $host
 
@@ -360,4 +360,2 @@
   end
 end
-
-
Index: /branches/eam_branch_20080109/ippTasks/summit.copy.pro
===================================================================
--- /branches/eam_branch_20080109/ippTasks/summit.copy.pro	(revision 16148)
+++ /branches/eam_branch_20080109/ippTasks/summit.copy.pro	(revision 16149)
@@ -7,5 +7,7 @@
 # pztool -adddatastore -inst allskycam -telescope ps1 -uri  http://otis1.ifa.hawaii.edu/ds/allskycam/index.txt
 
-$workdir    = /data/ipp010.0/
+# XXX these things below need to be set in pantasks.pro, perhaps with a site-dependent call.
+# XXX not sure how to handle the .N value if we need to use more than one
+$workdir_template = /data/@HOST@.0/
 
 $VERBOSE = 1
@@ -34,4 +36,5 @@
     periods      -poll     1
     periods      -timeout  15
+    npending     1
 
     # success
@@ -263,5 +266,9 @@
         substr $DATEOBS 8 2 DAY
 
+        # we need to set the workdir based on 1) nebulous or not? 2) chip/host relationship
+       	set.workdir.by.camera $CAMERA $CLASS_ID /data/@HOST@.0
+
         # figure out filename
+	# XXXX this filename needs to use nebulous names
         $FILENAME = $workdir/$CAMERA/$YEAR/$MONTH/$DAY/$EXP_NAME/$EXP_NAME.$CLASS_ID.fits
 
