The SKIRT project
advanced radiative transfer for astrophysics
Enable multi-processing for SKIRT (Unix or macOS)
Note
The SKIRT command line program can always run multiple execution threads within a single process. The information below is relevant only if you want to run multiple parallel processes, possibly on multiple compute nodes.

To enable the multi-processing capabilities of the SKIRT command line program, the host operating system must provide an implementation of the standard Message Passing Interface (MPI), and the SKIRT code must be (re)built with the corresponding build option enabled.

This topic contains the following sections:

Install an MPI implementation

MPI Version

The SKIRT code requires an MPI implementation that supports standard MPI v2.1 or later.

Systems using modules

Large multi-node computing systems will have one or more MPI implementations installed by the system administrator. Use the "module" system to load the MPI implementation and version that matches the compiler used for building the SKIRT code. For example:

module load cmake
module load intel_comp/2019-update2
module load intel_mpi/2019-update2

MacOS

For testing purposes, it might be useful to run SKIRT in multi-processing mode on a laptop or desktop computer. OpenMPI (not to be confused with OpenMP) is a freely available MPI implementation that is a good choice in this case. Follow the instructions below to install OpenMPI.

Download the source code

  • Navigate to the OpenMPI webpage.
  • Download the 'tar.gz' file for the latest stable version.
  • When the download has finished, click on the resulting 'tar' file and it should automatically be unpacked.

Compile and install the source code

  • Open a Terminal window and navigate to the newly created folder (replace x.x.x with the appropriate version number) with the command:
    cd ~/Downloads/openmpi-x.x.x
    
  • Then, enter:
    ./configure --prefix=/usr/local
    
  • You will see lots of output. If this procedure has finished, enter:
    make all
    
  • Again, many lines of output will appear. Finally, enter:
    sudo make install
    
    If you are prompted for your password, enter it.
  • After again lots of output, check the installation by executing the following commands:
    which mpicxx
    which mpirun
    
  • If either of these commands does NOT show any output, something is wrong.

Other Unix systems including Ubuntu

OpenMPI (not to be confused with OpenMP) is a freely available MPI implementation that is a good choice for supporting multi-processing on small networks, standalone servers and even desktop computers. Follow the instructions below to install OpenMPI on Ubuntu; the procedure for other Unix systems is likely very similar.

Open a Terminal window and enter the command:

sudo apt-get install libopenmpi-dev

This requires root access to modify files in the system directories. The "sudo" command takes care of this assuming that the corresponding privileges are enabled for your account. Enter your password (not the root password!) when asked. Also, you will be prompted with the question "Do you want to continue? [Y/n]". Respond affirmative unless you see a good reason not to.

Once the above has completed successfully, verify the installation by entering the following command:

mpirun --version

Enable the MPI build option

Once you have verified that the host system provides an MPI implementation, you need to enable the BUILD_WITH_MPI build option and rebuild the SKIRT code: