Skip to content

Commit

Permalink
ignore chunks.as.arrayjobs if not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Jan 30, 2017
1 parent 6f41bb7 commit 3bdebeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion R/submitJobs.R
Expand Up @@ -123,8 +123,13 @@ submitJobs = function(ids = NULL, resources = list(), reg = getDefaultRegistry()
assertCount(resources$ncpus, positive = TRUE)
if (hasName(resources, "measure.memory"))
assertFlag(resources$measure.memory)
if (hasName(resources, "chunks.as.arrayjobs"))
if (hasName(resources, "chunks.as.arrayjobs")) {
assertFlag(resources$chunks.as.arrayjobs)
if (resources$chunks.as.arrayjobs && is.na(reg$cluster.functions$array.var)) {
info("Ignoring resource 'chunks.as.arrayjobs', not supported by cluster functions '%s'", reg$cluster.functions$name)
resources$chunks.as.arrayjobs = NULL
}
}

ids = convertIds(reg, ids, default = .findNotSubmitted(reg = reg), keep.extra = "chunk")
if (nrow(ids) == 0L)
Expand Down
3 changes: 1 addition & 2 deletions R/waitForJobs.R
Expand Up @@ -21,7 +21,6 @@
#' one job terminated with an exception.
#' @export
waitForJobs = function(ids = NULL, sleep = 10, timeout = 604800, stop.on.error = FALSE, reg = getDefaultRegistry()) {
"!DEBUG Starting waitForJobs"
assertRegistry(reg, writeable = FALSE, sync = TRUE)
assertNumeric(sleep, len = 1L, lower = 0, finite = TRUE)
assertNumeric(timeout, len = 1L, lower = sleep)
Expand All @@ -43,7 +42,7 @@ waitForJobs = function(ids = NULL, sleep = 10, timeout = 604800, stop.on.error =
return(TRUE)

batch.ids = getBatchIds(reg)
"!DEBUG Using `nrow(ids)` ids and `nrow(batch.ids)` batch ids"
"!DEBUG `match.call()[1]`: Using `nrow(ids)` ids and `nrow(batch.ids)` batch ids"
if (nrow(batch.ids) == 0L)
return(nrow(.findErrors(reg, ids)) == 0L)

Expand Down

0 comments on commit 3bdebeb

Please sign in to comment.