doMPI: script hangs on closeCluster

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

doMPI: script hangs on closeCluster

Loris Bennett-2
Hi,

On Linux with R 3.5.1 and OpenMPI 2.1.0 I have built Rmpi and can run a
simple example just using Rmpi and printing out the rank of each worker.

However, when I try to use doMPI by running the following

  library(Rmpi)
  library(doMPI)
  cl <- startMPIcluster(count=2)
  registerDoMPI(cl)
  clusterSize(cl)
  closeCluster(cl)
  mpi.quit()

with

  mpirun -np 1 --mca mpi_warn_on_fork 0 R --no-save -f mwe.r

I get the following output

  > library("Rmpi")
  > library(doMPI)
  Loading required package: foreach
  Loading required package: iterators
  > cl <- startMPIcluster(count=2)
  2 slaves are spawned successfully. 0 failed.
  > registerDoMPI(cl)
  > clusterSize(cl)
  [1] 2
  > closeCluster(cl)

but the program hangs and I have to end it with Ctl-C.

Can anyone shed any light on what might be wrong?

Cheers,

Loris

--
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universit├Ąt Berlin         Email [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: doMPI: script hangs on closeCluster

Loris Bennett-2
Loris Bennett <[hidden email]> writes:

> Hi,
>
> On Linux with R 3.5.1 and OpenMPI 2.1.0 I have built Rmpi and can run a
> simple example just using Rmpi and printing out the rank of each worker.
>
> However, when I try to use doMPI by running the following
>
>   library(Rmpi)
>   library(doMPI)
>   cl <- startMPIcluster(count=2)
>   registerDoMPI(cl)
>   clusterSize(cl)
>   closeCluster(cl)
>   mpi.quit()
>
> with
>
>   mpirun -np 1 --mca mpi_warn_on_fork 0 R --no-save -f mwe.r
>
> I get the following output
>
>   > library("Rmpi")
>   > library(doMPI)
>   Loading required package: foreach
>   Loading required package: iterators
>   > cl <- startMPIcluster(count=2)
>   2 slaves are spawned successfully. 0 failed.
>   > registerDoMPI(cl)
>   > clusterSize(cl)
>   [1] 2
>   > closeCluster(cl)
>
> but the program hangs and I have to end it with Ctl-C.
>
> Can anyone shed any light on what might be wrong?

Having come across the following link:

  https://www.sharcnet.ca/help/index.php/Using_R_and_MPI

I rebuilt with OpenMPI 1.8.6 and the problem disappeared.

Cheers,

Loris

--
This signature is currently under construction.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.