Advanced MPI -- Spawn & RMA


   Back to course contents

An advantage of the MPI approach to parallel computing is the possibility it offers to create versatile programming structures corresponding to the physical requirements. This section deals with advanced MPI routines to spawn processes and perform one sided communication.

Ref: Documentation in MPI Forum


   Back to top of page

Download

Download demonstration codes: Advanced_MPI.tar

Expand via: tar -xvf Advanced_MPI.tar


   Back to top of page

Spawning Processes

MPI-2 allows an MPI program to spawn other programs and establish communication between the spawning program and the spawned programs. This capability reassembles the mode of operation in the Parallel Virtual Machine (PVM) running mode. It is ideal for a client-server paradigm.

The sub-directory spawn contains manager.c and launched_code.c. The code manager.c spawns launched_code.c. The function MPI_Comm_spawn() spawns the processes. MPI_Get_parent() finds the parent of a spawned process.

The syntax of the compilation and the running of the code is described in an enclosed README file. Note that only one instance of the manager.c code can be launched via mpiexec.


 
  Back to top of page

Shakespeare

The codes in the sub-directory Shakespeare demonstrate a client-server code in which the master (client) manager.c spawns search_text_daemon.c, the slave (server). The README file gives some details about the compilation and running of the codes.

The codes implement a rudimentary word search and statistical analysis of Shakespeare's plays. The latter are listed as .html files in sub-directory plays. Each spawned code searches a different play (file).

search_text.c is a serial code that implements this word analysis for a single play at a time.


   Back to top of page

Remote Memory Access

Remote Memory Access (RMA) is implemented in MPI-2. This allows one-sided communication in which a process is allowed direct access to a chunk of memory of another process under the MPI_COMM_WORLD. This process can then "get" information from or "put" information into the memory chunk of the other process.

The concepts (exemplified by the MPI calls) are:

The codes rma_1.c and rma_2.c in the sub-directory RemoteMemoryAccess illustrate the use of Remote Memory Access.


 
  Back to top of page