Skip to content
Draft
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: 0 additions & 2 deletions R/BatchtoolsParam-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,6 @@ setMethod("bpiterate", c("ANY", "ANY", "BatchtoolsParam"),
FUN <- match.fun(FUN)

if (missing(REDUCE)) {
if (reduce.in.order)
stop("REDUCE must be provided when 'reduce.in.order = TRUE'")
if (!missing(init))
stop("REDUCE must be provided when 'init' is given")
}
Expand Down
13 changes: 13 additions & 0 deletions inst/unitTests/test_BatchtoolsParam.R
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,25 @@ test_BatchtoolsParam_bpiterate <- function() {
target <- list(105, 205, 305, 405, 505)
checkIdentical(target, res)

## Test ordered results without REDUCE on multicore
param <- BatchtoolsParam()
res <- bpiterate(ITER=ITER(), FUN=FUN, k=5,
reduce.in.order=TRUE,
BPPARAM=param)
checkIdentical(target, res)

## socket cluster
param <- BatchtoolsParam(cluster="socket")
res <- bpiterate(ITER=ITER(), FUN=FUN, k=5, BPPARAM=param)
## Check Identical result
checkIdentical(target, res)

## Test ordered results without REDUCE on socket
res <- bpiterate(ITER=ITER(), FUN=FUN, k=5,
reduce.in.order=TRUE,
BPPARAM=param)
checkIdentical(target, res)

## Test REDUCE on socket
res <- bpiterate(ITER=ITER(), FUN=FUN, k=5,
REDUCE=`+`,
Expand Down