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

PicardTask to use the Intel inflater/deflater only if it is safe, by default #368

Merged
merged 2 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
}