Index: /trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- /trunk/ippScripts/scripts/diff_skycell.pl	(revision 19460)
+++ /trunk/ippScripts/scripts/diff_skycell.pl	(revision 19461)
@@ -25,8 +25,9 @@
 use Pod::Usage qw( pod2usage );
 
-my ($diff_id, $dbname, $outroot, $verbose, $no_update, $no_op);
+my ($diff_id, $dbname, $threads, $outroot, $verbose, $no_update, $no_op);
 GetOptions(
     'diff_id|d=s'       => \$diff_id, # Diff identifier
     'dbname|d=s'        => \$dbname, # Database name
+    'threads=d'         => \$threads,   # Number of threads to use
     'outroot=s'         => \$outroot, # Output root name
     'verbose'           => \$verbose,   # Print to stdout
@@ -100,5 +101,5 @@
             $templateWeight = "PPSTACK.OUTPUT.WEIGHT";
             $templateSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
-	    ## use an explicit stack name for psphot output objects
+            ## use an explicit stack name for psphot output objects
         } else {
             $templateMask = "PSWARP.OUTPUT.MASK";
@@ -192,4 +193,5 @@
     $command .= " -refweight $templateWeight";
     $command .= " -stats $outputStats";
+    $command .= " -threads $threads" if defined $threads;
     $command .= " -recipe PPSTATS WARPSTATS";
     $command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF";
Index: /trunk/ippTasks/diff.pro
===================================================================
--- /trunk/ippTasks/diff.pro	(revision 19460)
+++ /trunk/ippTasks/diff.pro	(revision 19461)
@@ -164,5 +164,5 @@
     mkdir $outpath
 
-    $run = diff_skycell.pl --diff_id $DIFF_ID --outroot $outroot
+    $run = diff_skycell.pl --threads @MAX_THREADS@ --diff_id $DIFF_ID --outroot $outroot
     add_standard_args run
 
