Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
PicardTask to use the Intel inflater/deflater only if it is safe, by …
Browse files Browse the repository at this point in the history
…default (#368)

* PicardTask to use the Intel deflater/inflater only if safe, by default
  • Loading branch information
clintval authored Apr 12, 2020
1 parent 12c6036 commit ec25b09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ lazy val core = Project(id="dagr-core", base=file("core"))
.settings(description := "Core methods and classes to execute tasks in dagr.")
.settings(
libraryDependencies ++= Seq(
"com.fulcrumgenomics" %% "commons" % "1.0.0",
"com.fulcrumgenomics" %% "commons" % "1.1.0-43c062d-SNAPSHOT",
"com.fulcrumgenomics" %% "sopt" % "1.0.0",
"com.github.dblock" % "oshi-core" % "3.3",
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
Expand Down
10 changes: 9 additions & 1 deletion tasks/src/main/scala/dagr/tasks/picard/PicardTask.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package dagr.tasks.picard

import java.nio.file.Path

import com.fulcrumgenomics.commons.util.SystemUtil.IntelCompressionLibrarySupported
import dagr.core.config.Configuration
import dagr.core.execsystem.{Cores, Memory}
import dagr.core.tasksystem.{FixedResources, ProcessTask}
Expand All @@ -48,6 +49,8 @@ object PicardTask {
* @param useAdvancedGcOptions use advanced garbage collection parameters.
* @param validationStringency set the default validation stringency for Picard.
* @param useAsyncIo true if we are to use asynchronous IO, false otherwise.
* @param useJdkDeflater true if we are to use the JDK deflater, false if we are to use an alternate deflater (Intel).
* @param useJdkInflater true if we are to use the JDK inflater, false if we are to use an alternate inflater (Intel).
* @param compressionLevel the compress level to use.
* @param createIndex true if we are to create an index, false otherwise.
* @param createMd5File true if we are to create an Md5 file, false otherwise.
Expand All @@ -57,7 +60,8 @@ abstract class PicardTask(var jvmArgs: List[String] = Nil,
var useAdvancedGcOptions: Boolean = true,
var validationStringency: Option[ValidationStringency] = Some(ValidationStringency.SILENT),
var useAsyncIo: Boolean = false,
var useJdkInflater: Option[Boolean] = None,
var useJdkDeflater: Option[Boolean] = Some(!IntelCompressionLibrarySupported),
var useJdkInflater: Option[Boolean] = Some(!IntelCompressionLibrarySupported),
var compressionLevel: Option[Int] = None,
var createIndex: Option[Boolean] = Some(true),
var createMd5File: Option[Boolean] = None,
Expand Down Expand Up @@ -91,6 +95,7 @@ abstract class PicardTask(var jvmArgs: List[String] = Nil,
validationStringency.foreach(v => buffer.append("VALIDATION_STRINGENCY=" + v.name()))
createIndex.foreach(c => buffer.append("CREATE_INDEX=" + c))
createMd5File.foreach(c => buffer.append("CREATE_MD5_FILE=" + c))
useJdkDeflater.foreach(u => buffer.append("USE_JDK_DEFLATER=" + u))
useJdkInflater.foreach(u => buffer.append("USE_JDK_INFLATER=" + u))

addPicardArgs(buffer)
Expand All @@ -116,6 +121,9 @@ abstract class PicardTask(var jvmArgs: List[String] = Nil,
this
}

/** Sets whether we use the JDK deflater or not. */
def withJdkDeflater(deflate: Boolean = true) : this.type = { this.useJdkDeflater = Some(deflate); this; }

/** Sets whether we use the JDK inflater or not. */
def withJdkInflater(inflate: Boolean = true) : this.type = { this.useJdkInflater = Some(inflate); this; }
}

0 comments on commit ec25b09

Please sign in to comment.