Experimental html version of Parallel Programming in MPI, OpenMP, and PETSc by Victor Eijkhout. download the textbook at https:/
\[ \newcommand\inv{^{-1}}\newcommand\invt{^{-t}} \newcommand\bbP{\mathbb{P}} \newcommand\bbR{\mathbb{R}} \newcommand\defined{ \mathrel{\lower 5pt \hbox{${\equiv\atop\mathrm{\scriptstyle D}}$}}} \] Back to Table of Contents

51 SimGrid

Many readers of this book will have access to some sort of parallel machine so that they can run simulations, maybe even some realistic scaling studies. However, not many people will have access to more than one cluster type so that they can evaluate the influence of the interconnect . Even then, for didactic purposes one would often wish for interconnect types (fully connected, linear processor array) that are unlikely to be available.

In order to explore architectural issues pertaining to the network, we then resort to a simulation tool, SimGrid .



You write plain MPI files, but compile them with the SimGrid compiler smpicc .


SimGrid has its own version of mpirun : smpirun . You need to supply this with options:

  • -np 123456 for the number of (virtual) processors;
  • -hostfile simgridhostfile which lists the names of these processors. You can basically make these up, but are defined in:
  • -platform arch.xml which defines the connectivity between the processors.

For instance, with a hostfile of 8 hosts, a linearly connected network would be defined as:

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "">

<platform version="4">

<zone id="first zone" routing="Floyd">
  <!-- the resources -->
  <host id="host1" speed="1Mf"/>
  <host id="host2" speed="1Mf"/>
  <host id="host3" speed="1Mf"/>
  <host id="host4" speed="1Mf"/>
  <host id="host5" speed="1Mf"/>
  <host id="host6" speed="1Mf"/>
  <host id="host7" speed="1Mf"/>
  <host id="host8" speed="1Mf"/>
  <link id="link1" bandwidth="125MBps" latency="100us"/>
  <!-- the routing: specify how the hosts are interconnected -->
  <route src="host1" dst="host2"><link_ctn id="link1"/></route>
  <route src="host2" dst="host3"><link_ctn id="link1"/></route>
  <route src="host3" dst="host4"><link_ctn id="link1"/></route>
  <route src="host4" dst="host5"><link_ctn id="link1"/></route>
  <route src="host5" dst="host6"><link_ctn id="link1"/></route>
  <route src="host6" dst="host7"><link_ctn id="link1"/></route>
  <route src="host7" dst="host8"><link_ctn id="link1"/></route>


(such files can be generated with a short shell script).

The Floyd designation of the routing means that any route using the transitive closure of the paths given can be used. It is also possible to use routing="Full" which requires full specification of all pairs that can communicate.

Back to Table of Contents