mlr-org / parallelMap

R package to interface some popular parallelization backends with a unified interface
https://parallelmap.mlr-org.com
Other
57 stars 14 forks source link

parallelMap with Batchtools backend fails when logging is enabled. #92

Open mb706 opened 4 years ago

mb706 commented 4 years ago
parallelStartBatchtools(logging = TRUE, storagedir = "paralleltmp", show.info = TRUE)
pmresult = parallelMap(function(x)  list(result = x * x + 1, info = Sys.getenv()), 1:10, show.info = TRUE)

gives error

Mapping in parallel: mode = batchtools; level = NA; cpus = NA; elements = 10.
Error in `$<-.data.frame`(x, name, value) : 
  replacement has 0 rows, data has 10

This is I believ an error here: https://github.com/mlr-org/parallelMap/blob/5cb342968cfb8b9e4fd05ff2763ac7e2316e6d83/R/parallelMap.R#L206

where x does not have the entry job.hash. Maybe the API changed between Batchtools and BatchJobs and this was copied and never tested?