A parallel and asynchronous Map
/mapply
for batch systems.
Note that this function only defines the computational jobs.
The actual computation is started with submitJobs
.
Results and partial results can be collected with reduceResultsList
, reduceResults
or
loadResult
.
batchMap( fun, ..., args = list(), more.args = list(), reg = getDefaultRegistry() )
fun | [ |
---|---|
... | [ANY] |
args | [ |
more.args | [ |
reg | [ |
[data.table
] with ids of added jobs stored in column “job.id”.
batchtools:::example_push_temp(3) # example using "..." and more.args tmp = makeRegistry(file.dir = NA, make.default = FALSE)#>#>#>#> job.id job.pars #> 1: 1 <list[1]> #> 2: 2 <list[1]> #> 3: 3 <list[1]> #> 4: 4 <list[1]> #> 5: 5 <list[1]> #> 6: 6 <list[1]> #> 7: 7 <list[1]> #> 8: 8 <list[1]> #> 9: 9 <list[1]> #> 10: 10 <list[1]>#> ### [bt]: Setting seed to 12787 ...#> [1] 136#>#>#>#> job.id job.pars #> 1: 1 <list[2]> #> 2: 2 <list[2]> #> 3: 3 <list[2]> #> 4: 4 <list[2]> #> 5: 5 <list[2]> #> 6: 6 <list[2]># example for an expand.grid()-like operation on parameters tmp = makeRegistry(file.dir = NA, make.default = FALSE)#>#>#>#> job.id job.pars #> 1: 1 <list[2]> #> 2: 2 <list[2]> #> 3: 3 <list[2]> #> 4: 4 <list[2]> #> 5: 5 <list[2]> #> 6: 6 <list[2]> #> 7: 7 <list[2]> #> 8: 8 <list[2]> #> 9: 9 <list[2]>#> ### [bt]: Setting seed to 8571 ...#> [1] "b 3"