Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing exact memory to executors in GiB #1696

Merged
merged 2 commits into from
Aug 5, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import nextflow.processor.TaskConfig
import nextflow.processor.TaskHandler
import nextflow.processor.TaskRun
import nextflow.processor.TaskStatus
import nextflow.util.MemoryUnit
/**
* Handle execution phases for a task executed by a TES executor
*
Expand Down Expand Up @@ -204,14 +205,18 @@ class TesTaskHandler extends TaskHandler {
private TesResources getResources(TaskConfig cfg) {
def res = new TesResources()
res.cpuCores(cfg.getCpus())
.ramGb(cfg.getMemory()?.toGiga()) // @TODO only works for >= 1.GB
.ramGb(toGiga(cfg.getMemory()))
.diskGb(cfg.getDisk()?.toGiga())
log.trace("[TES] Adding resource request: $res")
// @TODO preemptible
// @TODO zones
return res
}

private Double toGiga(MemoryUnit size) {
// 1073741824 = 1GB
return size != null ? ((double)size.bytes)/1073741824 : null
}

pditommaso marked this conversation as resolved.
Show resolved Hide resolved
private TesInput inItem( Path realPath, String fileName = null) {
def result = new TesInput()
Expand Down