Skip to content

Commit

Permalink
feedback from @patrick-schultz
Browse files Browse the repository at this point in the history
  • Loading branch information
ehigham committed Oct 16, 2024
1 parent 1087175 commit 2f05ecd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hail/src/main/scala/is/hail/backend/ExecuteContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OwningTempFileManager(fs: FS) extends TempFileManager {
}
}

case class NonOwningTempFileManager(owner: TempFileManager) extends TempFileManager {
class NonOwningTempFileManager private(owner: TempFileManager) extends TempFileManager {
override def newTmpPath(tmpdir: String, prefix: String, extension: String): String =
owner.newTmpPath(tmpdir, prefix, extension)

Expand Down
14 changes: 12 additions & 2 deletions hail/src/main/scala/is/hail/expr/ir/CompileAndEvaluate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ object CompileAndEvaluate {
optimize = optimize,
)

Left(ctx.scopedExecution((hcl, fs, htc, r) => f(hcl, fs, htc, r)(r)))
val unit: Unit = ctx.scopedExecution { (hcl, fs, htc, r) =>
val execute = f(hcl, fs, htc, r)
ctx.time(execute(r))
}

Left(unit)

case _ =>
val (Some(PTypeReferenceSingleCodeType(resType: PTuple)), f) =
Expand All @@ -71,7 +76,12 @@ object CompileAndEvaluate {
optimize = optimize,
)

Right((resType, ctx.scopedExecution((hcl, fs, htc, r) => f(hcl, fs, htc, r)(r))))
val res = ctx.scopedExecution { (hcl, fs, htc, r) =>
val execute = f(hcl, fs, htc, r)
ctx.time(execute(r))
}

Right((resType, res))
}
}
}

0 comments on commit 2f05ecd

Please sign in to comment.