I see this problem with my Rmpi โโinstallation, which was built using Open MPI 1.4.3. I assume you are also using Open MPI as you are using Ubuntu. Loading Rmpi โโcalls MPI_Init, calling the SIGCHLD signal, not ignored. I believe the result will be that SIGCHLD will now be sent when the child processes fork for mclapply exit, which unexpectedly aborts select system calls in mclapply . If this does not cause any real errors, you can prevent warning messages from appearing by calling mclapply inside suppressWarnings .
There's a discussion of this issue on the Open MPI Users mailing list, which suggests that the issue was fixed at some point in the Open MPI 1.6 series, so the best solution to this problem might be updating your MPI installation if you haven't already.
Update
I tried your example using Open MPI 1.6.5 and 1.7.3, but the problem persists. I decided to use the inline package to implement a function that resets the SIGCHLD signal to default processing. Using this, I was able to run your example without any warnings:
library(Rmpi) library(inline) includes <- "#include <signal.h>" code <- "signal(SIGCHLD, SIG_DFL);" ignchld <- cfunction(body=code, includes=includes, convention=".C") ignchld() foo <- parallel::mclapply(seq_len(10), function(l) lapply(1:10, function(x) mean(rnorm(10000, mean=x))), mc.cores=4)
Of course, it is possible that turning off the signal will cause some problems for Rmpi. In this case, you can change the code to save and restore the SIGCHLD handler, but I do not know if it is necessary.
source share