Why Master/Worker?
- Tons of small tasks need intercommunication among processors.
- Processors are not efficient equally, e.g. some may be slower than others.
- MPI systems allow to spawn workers.
More Information
A quick example implementing manager and workers can be found at the page LAM/MPI/Rmpi in the R_note web site. This page will describe the manager and workers computing in Rmpi. The manager and workers computing is a style of "Multiple Instruction Multiple Data" (MIMD) in parallel programming, while it can be written in the Single Program Multiple Data (SPMD) style where the manager is one of the workers.
Rmpi
By default, Rmpi
runs as the "manager and workers" framework
in an interaction mode of R.
This makes debugging extremely difficult.
However, it is possible to run as the "workers" framework
in an interaction mode of R.
In MPI computing,
the "workers" framework simplifies communications different than the
"manager" and "workers" framework.
In general, the "workers" framework make a perfect computing environment
in a command mode of R, as well as
Single Program Multiple Data (SPMD).
LAM/MPI
, MPICH
, MPICH2
or OpenMPI
is a MPI system requirement for the R
package
Rmpi
.
The LAM/MPI
is recommended for Unix-based system, but is not available on
Windows system.
The MPICH2
is recommended for Windows system.
The OpenMPI
needs some instructions to execute in the
Master/Worker
style in an interactive mode of R
.
All the MPI systems are supposed to execute smoothly in the
Single Program Multiple Data (SPMD) style
in a command mode of R
through
Rscript.
Some starting examples (Master/Worker) can be found in
- Section "LAM/MPI/Rmpi" of R_note
- Rmpi Tutorial
- Rmpi for R
More useful implementations can be found in the Cookbook.