Overall, MPI parallelization is a powerful tool for improving the efficiency and accuracy of heat conduction simulations, and it has numerous applications in various fields of engineering and science. Here, we are presenting the parallelized solution of the two-dimensional heat conduction equation on a square plate. We leverage collective communications and certain MPI functions to achieve convergence to the analytical solution. Metrics of scalability are widely used to illustrate the ability of both hardware and software to deliver greater compute with more hardware. Thus, we will also perform a weak and a strong scaling analysis of our program.
For the numerical solution, we time-match:
to a steady-state solution on a uniform mesh, with the following finite difference approximation:
As for the analytical solution, this is given by the Fourier series:
which is asymptotically correct.
Surface Plot | Contour Plot |
---|---|
Speedup | Time |
---|---|
mpicc -O2 -std=c99 -o main.exe main.c functions.c -lm
mpiexec -n main.exe