Question

New to R, I need to use the spatstat package to run some point pattern analyses.

Since my data are quite large and spatstat only uses one core out of the four cores available, I was wondering if I could speed things up multithreading the process.

I found this paper, which presents a package that transformed spatstat's functions for use in a parallel environment. According to the paper, I first need to install Rmpi.

The first time, I had a problem with a missing msmpi.dll. After installing a windows package, I was able to load Rmpi into R.

At this point, I think there is something wrong somewhere, because it doesn't seem that Rmpi works correctly:

> library(Rmpi)
> mpi.spawn.Rslaves(nslaves=4)
Erreur dans mpi.comm.spawn(slave = system.file("Rslaves64.cmd", package = "Rmpi"),  : 
Other MPI error, error stack:
MPI_Comm_spawn(106)..........: MPI_Comm_spawn(cmd="C:/Users/ddeltenre/Documents/R/win-    
library/3.0/Rmpi/Rslaves64.cmd", argv=0x000000000EC70C90, maxprocs=4, MPI_INFO_NULL,  
root=0, MPI_COMM_SELF, intercomm=0x000000000F44A878, errors=0x000000000E729AA8) failed
MPID_Comm_spawn_multiple(314): Function not implemented

My questions are thus the following:

  1. The most important, even if I manage to make Rmpi work, does it mean that parspatstat will Work, or would it be easier to do all that stuff on a Linux install?

  2. Is Rmpi really designed to allow multicore processing?

  3. Is it possible to use Rmpi on windows 7 x64?

  4. Before installing the windows package, I followed this tutorial (www.stats.uwo.ca/faculty/yu/Rmpi/windows.htm), thinking that was the way to go. Though I removed MPICH (I didn't solve the issue), can it have an effect on Rmpi's behavior?

Many thanks for your help

Was it helpful?

Solution

It appears that MPICH2 is the MPI distribution recommended for Windows, so I would also recommend that you use it. It may not be easy to get everything installed and working, but it will be much easier to get help from others if you use the recommended distribution.

I expect that you could get "parspatstat" working on Windows using MPICH2/Rmpi and that it will allow you to use multiple cores, but it may be hard. If you have a choice, I would definitely recommend using Linux, especially a Debian-based distribution, which has excellent support for Rmpi.

Although MPI is primarily geared towards use on multiple machines, such as clusters, most implementations have support for running on multicore machines. Still, it may be worth testing "parspatstat" on a Linux machine before you spend a long time trying to get it working on Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top