src/hg/utils/automation/doBlastzChainNet.pl 1.32

1.32 2010/02/17 21:55:58 hiram
adding an elapsed time calculation when successful completion
Index: src/hg/utils/automation/doBlastzChainNet.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/doBlastzChainNet.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -b -B -U 4 -r1.31 -r1.32
--- src/hg/utils/automation/doBlastzChainNet.pl	11 Feb 2010 23:47:51 -0000	1.31
+++ src/hg/utils/automation/doBlastzChainNet.pl	17 Feb 2010 21:55:58 -0000	1.32
@@ -246,9 +246,9 @@
 
 # Globals:
 my %defVars = ();
 my ($DEF, $tDb, $qDb, $QDb, $isSelf, $selfSplit, $buildDir, $fileServer);
-my ($swapDir, $splitRef, $inclHap);
+my ($swapDir, $splitRef, $inclHap, $secondsStart, $secondsEnd);
 
 sub isInDirList {
   # Return TRUE if $dir is under (begins with) something in dirList.
   my ($dir, @dirList) = @_;
@@ -523,9 +523,9 @@
 set L1 = `wc -l < $targetList`
 $partitionQueryCmd
 set L2 = `wc -l < $queryList`
 set L = `echo \$L1 \$L2 | awk '{print \$1*\$2}'`
-echo "cluster batch jobList size: \$L = \$L1 * \$L1"
+echo "cluster batch jobList size: \$L = \$L1 * \$L2"
 _EOF_
     );
   $bossScript->execute();
   my $mkOutRootHost = $opt_blastzOutRoot ? $paraHub : $fileServer;
@@ -1506,8 +1506,10 @@
 
 &checkOptions();
 
 &usage(1) if (scalar(@ARGV) != 1);
+$secondsStart = `date "+%s"`;
+chomp $secondsStart;
 ($DEF) = @ARGV;
 
 $inclHap = "";
 $inclHap = "-inclHap" if ($opt_inclHap);
@@ -1571,10 +1573,16 @@
 }
 
 $stepper->execute();
 
+$secondsEnd = `date "+%s"`;
+chomp $secondsEnd;
+my $elapsedSeconds = $secondsEnd - $secondsStart;
+my $elapsedMinutes = int($elapsedSeconds/60);
+$elapsedSeconds -= $elapsedMinutes * 60;
+
 HgAutomate::verbose(1,
-	"\n *** All done!\n");
+	"\n *** All done !  Elapsed time: ${elapsedMinutes}m${elapsedSeconds}s\n");
 HgAutomate::verbose(1,
 	" *** Make sure that goldenPath/$tDb/vs$QDb/README.txt is accurate.\n")
   if ($stepper->stepPrecedes('load', $stepper->getStopStep()));
 HgAutomate::verbose(1,