Skip to content

This project consists on a computational simulation that finds the thermal equilibrium point on a rectangular plate to which constant heat is applied at its edge. The simulation is optimized through concurrency using POSIX threads as well as OpenMP and OpenMPI on C/C++ code

Notifications You must be signed in to change notification settings

andresquesadag/heatSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrent Heat Simulation

Heat distribution simulation on a plate using data parallelism

This project consists on a computational simulation that finds the thermal equilibrium point on a rectangular plate to which constant heat is applied at its edge. The plate is divided into a matrix of square cells, where each cell stores a temperature that can change over time. The simulation is based on a physical model that uses the temperature of neighbouring cells to estimate the new temperature of each cell in the next state.

The task is to continue the simulation until the thermal equilibrium point is reached, which is achieved when the heat has settled in the plate. To determine this, a parameter called Epsilon is used to represent the minimum significant temperature change in the plate. In each state, all internal cells of the plate are updated and a check is made to see if any cell has experienced a temperature change below Epsilon(ε). If equilibrium has not been reached, the simulation continues with the next state; otherwise, it stops and the results are reported. Binary files are used for data input and output, and data parallelism can be applied to improve simulation efficiency. The project includes two versions: a concurrent version using OpenMP (v1) and a distributed version using Open MPI (v2).

The primary goal of the concurrent version (v1) of this project is to optimize the heat distribution simulation using OpenMP. The emphasis is on assuring the accuracy of computations and generating precise outcomes. This solution using OpenMP is set to optimize by "adding" concurrenct to an initial serial version, so the performance change needs to be measured to take the real impact of the optimization taking into consideration the speedup and efficiency improvement in between the above-mentioned versions.

For the distributed version (v2) of the project, the objective is to utilize both OpenMP and MPI to achieve concurrency at both the thread and process levels. This version involves examining the existing v1 solution and determining how to integrate MPI technology with the previously developed OpenMP solution. A balanced use of tasks among processes should be included in the design. Performance measurements will be taken to compare the new solution to earlier versions and to compare both technologies implications at the time of being combined into the solution for this problem.


Design

Diagrams

here

Pseudo-code

here


Performance Analysis and Comparative Evaluation

In this section, a comprehensive performance analysis and comparative evaluation of the three versions developed in the project is presented. The execution times of each version are measured, and their computational performance is assessed. Graphical representations of the performance data are provided to visually depict the differences and trends among the versions. A detailed discussion is undertaken to interpret the findings, emphasizing the strengths, weaknesses, and trade-offs of each version. Report in here


User manual

Overview

The project aims to simulate heat distribution through a plate using parallel computing. It involves developing serial and concurrent versions using OpenMP, and later integrating MPI for distributed computing.

How to run?

Compile

make

When it's compiled, then run the program

./bin/proyecto02 [job] [thread_count] [job_directory] [output_directory]

with MPI

mpiexec -np [process_count] ./bin/proyecto02 [job] [thread_count] [job_directory] [output_directory]

Arguments

  • [job] must be included as it is not an optional argument, it contains an "input" that gives the plate and the simulation it "caracteristics".

  • [thread_count] is set to indicate how many threads will work concurrently on the simulation. It's an optional argument, but take into consideration that by default the threads count will be equal to the amount of CPUs on your device.

  • [job_directory] the folder where the 'job' file is. This argument is not optional.

  • [output_directory] the folder where the program must save reports. This argument is not optional.

  • Examples:

    ./bin/proyecto02 job001.txt 16 jobs/job001 output
    ./bin/proyecto02 job001.txt jobs/job001 output
    mpiexec  -np 3 ./bin/proyecto02 job001.txt 8 jobs/job001 output

Execution example

input

mpiexec  -np 3 ./bin/proyecto02 job001.txt 8 jobs/job001 output

result

plate001-2.tsv

5 4
10 10 10 10
8 4.51092 4.72855 8
6 2.27868 2.58797 6
4 1.2192 1.43683 4
2 0 0 2

job001.tsv

plate001.bin 1200 127 1000 2 2 0000/00/00 00:40:00
plate001.bin 1200 127 1000 1.5 3 0000/00/00 01:00:00
plate001.bin 1200 127 1000 1 4 0000/00/00 01:20:00
plate001.bin 1200 127 1000 0.1 11 0000/00/00 03:40:00
plate002.bin 60 0.08 450 0.075 1 0000/00/00 00:01:00
plate002.bin 60 0.08 450 7.5e-06 2904458 0005/06/09 23:38:00

Authors

About

This project consists on a computational simulation that finds the thermal equilibrium point on a rectangular plate to which constant heat is applied at its edge. The simulation is optimized through concurrency using POSIX threads as well as OpenMP and OpenMPI on C/C++ code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published