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

Return partial results #14

Closed danielhorn closed 10 years ago

danielhorn commented 10 years ago

If some jobs expire / produce errors, sometimes we want to return partial results.

Wouldn't the easiest solution be okay? This would be: return NA / empty list / NULL? Okay, i see .. since the return value could be anything, this will probably not work. Perhaps something like "Return a user specified value for every expired / error job"?

An alternative would be also to return the indices of the succesful jobs.

danielhorn commented 10 years ago

from Bernd:

berndbischl commented 10 years ago

Done. See 'impute.error'

Currently testing.

danielhorn commented 10 years ago

While testing: Perhaps you also want add the impute.error argument to parallelL/Saplly?

And using a constant object (e.g. NA) for imputation does not work yet? Of course, i could use the workaround impute.error = function(x) NA

library(parallelMap) f = function(x) runif(8e8) parallelStart(mode = "BatchJobs") parallelExport("f") z = parallelMap(function(i) {f(); 1}, i = 1:2, impute.error = NA) parallelStop()

berndbischl commented 10 years ago

I am not done testing / pushing....

berndbischl commented 10 years ago

While testing: Perhaps you also want add the impute.error argument to parallelL/Saplly?

Done.

berndbischl commented 10 years ago

With the current version I can impute constant vals?

I added another unit test now to make sure.

berndbischl commented 10 years ago

It it implemented and tested now.