From a46a4a61755eacb01efd067bd01f0cf2619cf773 Mon Sep 17 00:00:00 2001 From: Geraldine Van der Auwera Date: Thu, 21 Jan 2016 14:40:58 -0500 Subject: [PATCH] Expose time between checks for whether new jobs can be submitted as a user-settable parameter on CLi. Useful when testing pipelines to make idle time shorter. Contributed by @dakl (Daniel Klevebring on GATK forum). --- .../scala/org/broadinstitute/gatk/queue/engine/QGraph.scala | 2 +- .../org/broadinstitute/gatk/queue/engine/QGraphSettings.scala | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraph.scala b/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraph.scala index a34b9e6f9..b11652a84 100644 --- a/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraph.scala +++ b/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraph.scala @@ -542,7 +542,7 @@ class QGraph extends Logging { lastRunningCheck > 0 && nextRunningCheck(lastRunningCheck) <= 0 private def nextRunningCheck(lastRunningCheck: Long) = - ((30 * 1000L) - (System.currentTimeMillis - lastRunningCheck)) + ((this.settings.time_between_checks.toLong * 1000L) - (System.currentTimeMillis - lastRunningCheck)) def formattedStatusCounts: String = { "%d Pend, %d Run, %d Fail, %d Done".format( diff --git a/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraphSettings.scala b/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraphSettings.scala index bc068682b..bbe64525c 100644 --- a/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraphSettings.scala +++ b/public/gatk-queue/src/main/scala/org/broadinstitute/gatk/queue/engine/QGraphSettings.scala @@ -55,6 +55,9 @@ class QGraphSettings { @Argument(fullName="retry_failed", shortName="retry", doc="Retry the specified number of times after a command fails. Defaults to no retries.", required=false) var retries = 0 + @Argument(fullName="time_between_checks", shortName="tbc", doc="Seconds between checks of whether new jobs can be run. Default 30.", required=false) + var time_between_checks = 30.0 + @Argument(fullName="start_from_scratch", shortName="startFromScratch", doc="Runs all command line functions even if the outputs were previously output successfully.", required=false) var startFromScratch = false