Topic #0 Module: Installing SimGrid

This CourseWare was tested with SimGrid version 3.27 (small changes may be needed with later versions).


Two options

You need to have access to the smpicc (compiler for MPI code in C), smpicxx (compiler for MPI code in C++), and smpirun (tool to execute compiled MPI code) SimGrid executables to go through the CourseWare. To get access to these executables you have two options:

Easiest Option: Run SimGrid from a Docker container; or
Not-as-Easy Option: Install SimGrid yourself on a Linux machine/VM/Container.

Easiest Option: Using a Docker container

Provided you have Docker installed on your system, you can use the henricasanova/ics632_smpi container.

You can of course run this container and connect to it via a shell, like with any other Docker container, and do all your work within the container.

Alternately, you can run the smpicc and smpirun commands in the container but from your host. That is, on your host (in your shell/command-prompt), instead of typing smpicc or smpirun (which would require SimGrid to be installed on your host), instead you type the commands below.

On Linux or MacOS

smpicc is executed by running:
docker run --rm -it -v $(pwd):/home/smpi --user $(id -u):$(id -g) henricasanova/ics632_smpi smpicc
smpicxx is executed by running:
docker run --rm -it -v $(pwd):/home/smpi --user $(id -u):$(id -g) henricasanova/ics632_smpi smpicxx
smpirun is executed by running:
docker run --rm -it -v $(pwd):/home/smpi --user $(id -u):$(id -g) henricasanova/ics632_smpi smpirun

On MacOS: If you get exit code 137 for any of these commands, you may want to increase the memory allocated to Docker (e.g., through the Docker Dashboard preferences)

On Windows

smpicc is executed by running:
docker run --rm -it -v "%cd%:/home/smpi" henricasanova/ics632_smpi smpicc
smpicxx is executed by running:
docker run --rm -it -v "%cd%:/home/smpi" henricasanova/ics632_smpi smpicxx
smpirun is executed by running:
docker run --rm -it -v "%cd%:/home/smpi" henricasanova/ics632_smpi smpirun

Not-as-Easy Option: Installing SimGrid by hand

On a recent Debian/Ubuntu (virtual) machine, you can retrieve SimGrid directly from the package manager:

sudo apt update && apt upgrade -y
sudo apt install simgrid
Do not forget to check that you have installed a sufficiently recent version, e.g., by doing apt-cache show libsimgrid-dev. If the version you obtain is too old (see the top of this page), we recommend you manually install SimGrid following the instructions bellow.

For instructions regarding installation, please refer to the The SimGrid page. But just in case, here is a typical way to install SimGrid manually on a Linux system:

Install the dependencies: sudo apt install -y g++ libboost-all-dev cmake
Download the .tar.gz of the latest stable version of SimGrid
Extract the archive: tar -xvf simgrid-x.y.tar.gz
Go to the extracted directory: cd simgrid-x.y
Generate all makefiles: cmake -DCMAKE_INSTALL_PREFIX=/usr/local -Denable_smpi=on -Denable_documentation=off
(Assuming you want to install in /usr/local/)
Build (using 4 cores for compilation): make -j4
Run the tests (for the paranoid): make check
Install libraries and executables: sudo make install

Assuming your path includes /usr/local/bin (which it should), you now can invoke two new commands: smpicc and smpirun.

If you are not a superuser on your system (i.e., sudo access is denied), but the dependencies are installed, then you can install SimGrid in your home directory, say in a directory called local. Do do so, modify the cmake invocation above using -DCMAKE_INSTALL_PREFIX=$HOME/local. You can then do make install instead of sudo make install, and binaries will be available as ~/local/bin/smpicc and ~/local/bin/smpirun.