Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

future_lapply() is silent for the multisession plan #171

Closed
wlandau-lilly opened this issue Oct 25, 2017 · 3 comments
Closed

future_lapply() is silent for the multisession plan #171

wlandau-lilly opened this issue Oct 25, 2017 · 3 comments

Comments

@wlandau-lilly
Copy link

I would like to see console output in the following, but it appears silent.

library(future)
plan(multisession)
tmp <- future_lapply(1:2, cat)

Drake tries to log to the console when it builds targets, so this affects user friendliness, and to some extent, usability.

@HenrikBengtsson
Copy link
Collaborator

For why, see Issue #141. If it's enough with output after the future has resolved, then that might happen (Issue #67). See also #172.

A hack that I don't really recommend is to use:

cl <- makeClusterPSOCK(availableCores(), outfile = "")
plan(cluster, workers = cl)

which will have all the output of the workers to go the system's stdout/stderr. Note however that such output cannot be captured by the main/owner R session using e.g. capture.output() and sink(). That's why I call it a "hack".

@wlandau-lilly
Copy link
Author

wlandau-lilly commented Oct 25, 2017

I did not think about compatibility with capture.output(), but now that you mention it, it makes sense. I guess I should stop using that outfile hack for drake::make(..., parallelism = "parLapply").

wlandau-lilly added a commit to ropensci/drake that referenced this issue Oct 25, 2017
We give up console output for parLapply parallelism,
but it was a hack anyway (futureverse/future#171).
The output could not be captured by capture.output()
@wlandau-lilly
Copy link
Author

From #141, I can see that this is not really future's problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants