Rmpi: mclapply: In selectChildren (ac, 1): "Aborted system call" error in the list

The following minimal example ...

require(Rmpi) set.seed(1) foo <- parallel::mclapply(seq_len(10), function(l) lapply(1:10, function(x) mean(rnorm(10000, mean=x))), mc.cores=4) 

... generates warning messages like

 1: In selectChildren(ac, 1) : error 'Interrupted system call' in select 2: In selectChildren(ac, 1) : error 'Interrupted system call' in select 3: In selectChildren(ac, 1) : error 'Interrupted system call' in select 

How can they be avoided?

I use Rmpi and parallel mclapply in the package, so I ask. Please note that this was posted here , but I have not received a response (yet). In case that matters, I work with Ubuntu 12.10, Emacs 24 and R 2.15.2

+4
source share
1 answer

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.

+3
source

All Articles