Index: trunk/ippTasks/diff.pro
===================================================================
--- trunk/ippTasks/diff.pro	(revision 16643)
+++ trunk/ippTasks/diff.pro	(revision 16743)
@@ -115,31 +115,22 @@
     book setword diffSkyfile $pageName pantaskState RUN
     book getword diffSkyfile $pageName diff_id -var DIFF_ID
-    book getword diffSkyfile $pageName workdir -var WORKDIR
+    book getword diffSkyfile $pageName workdir -var WORKDIR_TEMPLATE
     book getword diffSkyfile $pageName dbname -var DBNAME
 
-    # specify choice of remote host
-    # XXX need to choose based on diffs
-    if ($PARALLEL)
-      host anyhost
-    else
-      host local
-    end
+    ### XXX Instead of setting these by camera, need to set by skycell_id
+    set.host.for.camera $CAMERA $DIFF_ID
+    set.workdir.by.camera $CAMERA $DIFF_ID $WORKDIR_TEMPLATE $default_host WORKDIR
 
-    ## generate output log based on filerule
-    if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    sprintf outroot "%s/diff.%s" $outroot $DIFF_ID
-    sprintf logfile "%s/skycell.log" $outroot
+    sprintf outroot "%s/tess_%s/%s/%s.%s.dif.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $DIFF_ID
+
+    ## generate output log based on filerule (convert the URI to a PATH)
+    $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id $STACK_ID --basename $outroot`
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
+    dirname $logfile -var outpath
+    mkdir $outpath
 
-    $run = diff_skycell.pl --diff_id $DIFF_ID
-    if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $WORKDIR
-    end
+    $run = diff_skycell.pl --diff_id $DIFF_ID --outroot $outroot
     add_standard_args run
 
Index: trunk/ippTasks/stack.pro
===================================================================
--- trunk/ippTasks/stack.pro	(revision 16643)
+++ trunk/ippTasks/stack.pro	(revision 16743)
@@ -115,31 +115,22 @@
     book setword stackSumSkyfile $pageName pantaskState RUN
     book getword stackSumSkyfile $pageName stack_id -var STACK_ID
-    book getword stackSumSkyfile $pageName workdir -var WORKDIR
+    book getword stackSumSkyfile $pageName workdir -var WORKDIR_TEMPLATE
     book getword stackSumSkyfile $pageName dbname -var DBNAME
 
-    # specify choice of remote host
-    # XXX need to choose based on stacks
-    if ($PARALLEL)
-      host anyhost
-    else
-      host local
-    end
+    ### XXX Instead of setting these by camera, need to set by skycell_id
+    set.host.for.camera $CAMERA $STACK_ID
+    set.workdir.by.camera $CAMERA $STACK_ID $WORKDIR_TEMPLATE $default_host WORKDIR
 
-    ## generate output log based on filerule
-    if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    sprintf outroot "%s/stack.%s" $outroot $STACK_ID
-    sprintf logfile "%s/skycell.log" $outroot
+    sprintf outroot "%s/tess_%s/%s/%s.%s.stk.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $STACK_ID
+
+    ## generate output log based on filerule (convert the URI to a PATH)
+    $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id $STACK_ID --basename $outroot`
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
+    dirname $logfile -var outpath
+    mkdir $outpath
 
-    $run = stack_skycell.pl --stack_id $STACK_ID
-    if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $WORKDIR
-    end
+    $run = stack_skycell.pl --stack_id $STACK_ID --outroot $outroot
     add_standard_args run
 
Index: trunk/ippTasks/warp.pro
===================================================================
--- trunk/ippTasks/warp.pro	(revision 16643)
+++ trunk/ippTasks/warp.pro	(revision 16743)
@@ -132,32 +132,24 @@
     book getword warpInputExp $pageName warp_id -var WARP_ID
     book getword warpInputExp $pageName camera -var CAMERA
-    book getword warpInputExp $pageName workdir -var WORKDIR
+    book getword warpInputExp $pageName workdir -var WORKDIR_TEMPLATE
     book getword warpInputExp $pageName dbname -var DBNAM
     book getword warpInputExp $pageName tess_id -var TESS_ID
-
-    # specify choice of remote host
-    # XXX need to choose based on warps
-    if ($PARALLEL)
-      host anyhost
-    else
-      host local
-    end
-
-    ## generate output log based on filerule
-    if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    sprintf outroot "%s/warp.%s" $outroot $WARP_ID
-    sprintf logfile "%s/overlap.log" $outroot
+    book getword warpInputExp $pageName exp_id -var EXP_ID
+
+    ### XXX Instead of setting these by camera, need to set by skycell_id
+    set.host.for.camera $CAMERA $WARP_ID
+    set.workdir.by.camera $CAMERA $WARP_ID $WORKDIR_TEMPLATE $default_host WORKDIR
+
+    sprintf outroot "%s/%s/%s.wrp.%s" $WORKDIR $EXP_ID $EXP_ID $WARP_ID
+
+    ## generate output log based on filerule (convert the URI to a PATH)
+    $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id $WARP_ID --basename $outroot`
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
+    dirname $logfile -var outpath
+    mkdir $outpath
 
     $run = warp_overlap.pl --warp_id $WARP_ID --camera $CAMERA --tess_id $TESS_ID
-    if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $WORKDIR
-    end
     add_standard_args run
 
@@ -255,31 +247,22 @@
     book getword warpPendingSkyCell $pageName tess_id -var TESS_ID
     book getword warpPendingSkyCell $pageName camera -var CAMERA
-    book getword warpPendingSkyCell $pageName workdir -var WORKDIR
+    book getword warpPendingSkyCell $pageName workdir -var WORKDIR_TEMPLATE
     book getword warpPendingSkyCell $pageName dbname -var DBNAME
 
-    # specify choice of remote host
-    # XXX need to choose based on warps
-    if ($PARALLEL)
-      host anyhost
-    else
-      host local
-    end
-
-    ## generate output log based on filerule
-    if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    sprintf outroot "%s/warp.%s" $outroot $WARP_ID
-    sprintf logfile "%s/skycell.log" $outroot
+    ### XXX Instead of setting these by camera, need to set by skycell_id
+    set.host.for.camera $CAMERA $WARP_ID
+    set.workdir.by.camera $CAMERA $WARP_ID $WORKDIR_TEMPLATE $default_host WORKDIR
+
+    sprintf outroot "%s/tess_%s/%s/%s.%s.wrp.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $WARP_ID
+
+    ## generate output log based on filerule (convert the URI to a PATH)
+    $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id $WARP_ID --basename $outroot`
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
-
-    $run = warp_skycell.pl --warp_id $WARP_ID --skycell_id $SKYCELL_ID --tess_id $TESS_ID --camera $CAMERA
-    if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $WORKDIR
-    end
+    dirname $logfile -var outpath
+    mkdir $outpath
+
+    $run = warp_skycell.pl --warp_id $WARP_ID --skycell_id $SKYCELL_ID --tess_id $TESS_ID --camera $CAMERA --outroot $outroot
     add_standard_args run
 
