-
baptiste.coudray authoredbaptiste.coudray authored
MPI-Futhark: Distributed High-Performance Computing For People
Today, most computers are equipped with Graphics Processing Units (GPUs). They provide more and more computing cores and have become fundamental embedded high-performance computing tools. In this context, the number of applications taking advantage of these tools seems low at first glance. The problem is that the development tools are heterogeneous, complex, and strongly dependent on the GPU running the code. Futhark is an experimental, functional, and architecture agnostic language; that is why it seems relevant to study it. It allows generating code allowing a standard sequential execution (on a single-core processor), on GPU (with Compute Unified Device Architecture (CUDA) and Open Computing Language (OpenCL) backends), on several cores of the same processor (shared memory). To make it a tool that could be used on all high-performance platforms, it lacks support for distributed computing with Message Passing Interface (MPI). We create a library which perform the distribution of a cellular automaton on multiple compute nodes through MPI. The update of the cellular automaton is computed via the Futhark language using one of the four available backends (sequential, multicore, OpenCL, and CUDA). In order to validate our library, we implement a cellular automaton in one dimension (Simple Cellular Automaton (SCA)), in two dimensions (Game of Life) and three dimensions (Lattice-Boltzmann Method (LBM)). Finally, with the performance tests performed, we obtain an ideal speedup in one and two dimensions with the sequential and multicore backend. With the GPU backend, we obtain an ideal speedup only when the number of tasks equals the number of GPUs.
Build a project
In order to compile a project, you will need:
- Make
- CMake
- Futhark
- OpenMPI
- SDL2
- OpenCL/CUDA
When the tools are installed, you need to navigate into a project folder cd <folder>
and run the command make
.
Elementary
- Uncomment
#include "../elementary/elementary.h"
indispatch.h
- Run
make
, multiple programs will be availableelementary_seq
elementary_mc
elementary_opencl
elementary_cuda
- Execute tests with
mpirun -n <nb_tasks> <elementary_seq|mc|opencl|cuda> <height> <width>
Game of Life
- Uncomment
#include "../game_of_life/gol.h"
indispatch.h
- Run
make
, multiple programs will be availablegame_of_life_seq
game_of_life_mc
game_of_life_opencl
game_of_life_cuda
- Execute tests with
mpirun -n <nb_tasks> <game_of_life_seq|mc|opencl|cuda> <height> <width>
Lattice-Boltzmann Method
- Uncomment
#include "#include "../lattice_boltzmann/lbm.h"
indispatch.h
- Run
make
, multiple programs will be availablelattice_boltzmann_seq_bench
lattice_boltzmann_mc_bench
lattice_boltzmann_opencl_bench
lattice_boltzmann_cuda_bench
- Execute tests with
mpirun -n <nb_tasks> <lattice_boltzmann_seq|mc|opencl|cuda>_bench <nb_gpus> <height> <width> <depth>
Unit Tests
Some unit tests are available in order to test the functions written. The tests can be run with by :
- Uncomment
#include "envelope.h"
indispatch.h
- Run
make
- Execute tests with
mpirun --oversubscribe -n <1|2|3|4|6|8> futhark_mpi_tests