Coder Social home page Coder Social logo

heat-2d-mpi-hpc-project's Introduction

hpc-project

C++ parallel solver for the 2D heat equation, with Dirichlet boundary conditions, using the Finite Differences Method.

The code was validated with test cases, and parallelized using the MPI library.

Installation, compilation and execution

You can get the sources from github by typing in your terminal :

git clone https://github.com/gabriel-suau/heat-2d-mpi-hpc-project.git mpi_heat_2D

To compile the parallel code in release mode, you can type the following commands :

cd mpi_heat_2D/parallel
make release

This command will produce an executable called main. To execute the program with the parameters written in parameters.txt, you can use either mpiexec or mpirun. For example, to execute the program with 4 MPI processes (assuming your machine has the required number of cores), you can type :

mpirun -n 4 ./main parameters.txt

or

mpiexec -n 4 ./main parameters.txt

Outputs

The outputs of the computation are written in the directory resultsDir specified in parameters.txt. Each MPI process writes its own results files. These files can directly be plotted using gnuplot. The results file names are in the form :

solution_scenario_%SCENARIO%_%MPIRANK%_%SAVEITERATION%.dat

For example, let's say you simulated the scenario n°1 with 4 MPI processes. To visualise the whole solution at the time iteration n°10, you can type

gnuplot
splot for [i=0:3] "solution_scenario_1_".i."_10.dat"

Here is a more complex example. Let's say you simulated the scenario n°3 with 4 MPI processes and you have $300\times 4$ result files, each one corresponding to a part of the solution at a certain time $t$ computed by one proc. If you want to visualise an animated heatmap of this solution with gnuplot, you can type something like

gnuplot
set palette defined (1 "blue", 2 "white", 3 "red")
do for [i=1:300] {plot for [j=0:3] "solution_scenario_3_".j."_".i.".dat" with image; pause 0.02} 

Documentation

A documentation for the parallel code can be automatically generated with Doxygen. Just type :

doxygen doxygen.cfg

This command will produce a doc/ directory containing an HTML documentation in the html/ directory and a PDF documentation in the latex directory. To read the HTML documentation using firefox, just type the following command (assuming you are in the root directory)

firefox doc/html/index.html

Credits

All developpers are students at ENSEIRB-MATMECA, a french engineering school located in Talence.

  • Geoffrey Lebaud
  • Rémi Pégouret
  • Gabriel Suau

License

This project is distributed under the GNU-GPLv3 license. A copy of the whole license is included in the repository.

Check-list

  • Make a working sequential version of the code (time integration : Explicit Euler, Implicit Euler)
  • Parallelize the linear solver (Conjugate Gradient)
  • Automatize the strong scalability tests with a Bash script

heat-2d-mpi-hpc-project's People

Contributors

gabriel-suau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.