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

Problems collecting child processes when using the multicore backend alongside mclapply() #99

Closed
wlandau opened this issue Aug 22, 2018 · 2 comments
Labels

Comments

@wlandau
Copy link
Contributor

wlandau commented Aug 22, 2018

I see warnings like "In selectChildren(ac[!fin], -1): cannot wait for child 16782 as it does not exist" when I invoke mclapply() before cleaning up the workers. In drake, I was hoping to be able to use mclapply() while clustermq workers are still up, but it is not such a loss. Does it have something to do with the way clustermq needs to change the SIGCHLD handler?

options(clustermq.scheduler = "multicore")
w <- clustermq::workers(8)
out <- clustermq::Q(1:2, fun = function(x) x * 2, workers = w)
parallel::mclapply(1:2, sqrt, mc.cores = 2)
w$cleanup() # Warnings go away if I clean up before calling mclapply().
@mschubert
Copy link
Owner

This seems to be independent of clustermq:

p = parallel::mcparallel({ Sys.sleep(1) })
# parallel::mccollect(p) # uncomment and warnings go away
parallel::mclapply(1:2, sqrt, mc.cores = 2)
# Warning messages:
# 1: In selectChildren(ac[!fin], -1) :
#   cannot wait for child 18305 as it does not exist
#   (repeats a couple of times...)

Related: HenrikBengtsson/future#218 (comment), #92

As far as I can tell, this may be a bug in R which was introduced in 3.5.0 (where CI also started reporting these warnings with no changes to clustermq). They do not affect function, so you should be safe to suppress them; or wait for the supposed fix to be merged.

@wlandau
Copy link
Contributor Author

wlandau commented Sep 14, 2018

Glad the bug was already discovered elsewhere. I am noticing those same warnings in R 3.5.1, so perhaps I need to wait a couple more versions.

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

No branches or pull requests

2 participants