From 7389077b3bdb3a5d16400ffd32232e0de88b895b Mon Sep 17 00:00:00 2001 From: hanna Date: Thu, 20 May 2010 19:02:02 +0000 Subject: [PATCH] A few misc usability fixes: - Clarify the message emitted when -XL is supplied so I don't spend another half day chasing a bug that doesn't exist. - Crash with a helpful message when running -nt with non-TreeReducible walkers. - Crash with a helpful message when running -nt with reduceByInterval walkers. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3405 348d0f76-0448-11de-a6fe-93d51630548a --- .../broadinstitute/sting/gatk/GenomeAnalysisEngine.java | 8 ++++---- .../sting/gatk/executive/HierarchicalMicroScheduler.java | 2 +- .../sting/gatk/executive/MicroScheduler.java | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 2b0a7e2db..cff23ca8b 100755 --- a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -210,9 +210,9 @@ public class GenomeAnalysisEngine { long toPruneSize = includeSortedSet.coveredSize(); long toExcludeSize = excludeSortedSet.coveredSize(); long intervalSize = intervals.coveredSize(); - logger.info(String.format("Initial include intervals cover %d bases", toPruneSize)); - logger.info(String.format("Excluding %d bases from original intervals (%.2f%% reduction)", - toExcludeSize, (toPruneSize - intervalSize) / (0.01 * toPruneSize))); + logger.info(String.format("Initial include intervals span %d loci; exclude intervals span %d loci", toPruneSize, toExcludeSize)); + logger.info(String.format("Excluding %d loci from original intervals (%.2f%% reduction)", + toPruneSize - intervalSize, (toPruneSize - intervalSize) / (0.01 * toPruneSize))); } } @@ -295,7 +295,7 @@ public class GenomeAnalysisEngine { * @param walkerType Type of walker. * @return Name of the walker. */ - public String getWalkerName(Class walkerType) { + public String getWalkerName(Class walkerType) { return walkerManager.getName(walkerType); } diff --git a/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java b/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java index 494c534d6..4ac840d29 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java @@ -96,7 +96,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar public Object execute( Walker walker, ShardStrategy shardStrategy, int maxIterations ) { // Fast fail for walkers not supporting TreeReducible interface. if (!( walker instanceof TreeReducible )) - throw new IllegalArgumentException("Hierarchical microscheduler only works with TreeReducible walkers"); + throw new IllegalArgumentException("The GATK can currently run in parallel only with TreeReducible walkers"); // Having maxiterations in the execute method is a holdover from the old TraversalEngine days. // Lets do something else with this. diff --git a/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java b/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java index 6b39852ca..af3befc82 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java @@ -37,7 +37,9 @@ import org.broadinstitute.sting.gatk.iterators.StingSAMIterator; import org.broadinstitute.sting.gatk.iterators.NullSAMIterator; import org.broadinstitute.sting.gatk.Reads; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; +import org.broadinstitute.sting.gatk.WalkerManager; import org.broadinstitute.sting.utils.fasta.IndexedFastaSequenceFile; +import org.broadinstitute.sting.utils.StingException; import java.util.*; import java.io.File; @@ -80,10 +82,13 @@ public abstract class MicroScheduler { */ public static MicroScheduler create(GenomeAnalysisEngine engine, Walker walker, SAMDataSource reads, IndexedFastaSequenceFile reference, Collection rods, int nThreadsToUse) { if (walker instanceof TreeReducible && nThreadsToUse > 1) { - logger.info("Creating hierarchical microscheduler"); + if(walker.isReduceByInterval()) + throw new StingException(String.format("The analysis %s aggregates results by interval. Due to a current limitation of the GATK, analyses of this type do not support parallel execution. Please run your analysis without the -nt option.", engine.getWalkerName(walker.getClass()))); + logger.info(String.format("Running the GATK in parallel mode with %d concurrent threads",nThreadsToUse)); return new HierarchicalMicroScheduler(engine, walker, reads, reference, rods, nThreadsToUse); } else { - logger.info("Creating linear microscheduler"); + if(nThreadsToUse > 1) + throw new StingException(String.format("The analysis %s currently does not support parallel execution. Please run your analysis without the -nt option.", engine.getWalkerName(walker.getClass()))); return new LinearMicroScheduler(engine, walker, reads, reference, rods); } }