parallel programming hw3 assignment

10
Parallel programming HW3 assignment

Upload: others

Post on 02-Oct-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Parallel programming HW3 assignment

Parallel programming

HW3 assignment

Page 2: Parallel programming HW3 assignment

2 / 10

What is a heat diffusion

● Heat diffusion/transfer– exchange of thermal energy between physical

systems– rate of heat transfer is dependent on the

temperatures of the systems

Page 3: Parallel programming HW3 assignment

3 / 10

Simplified model

● Discretization of the space into cells (i.e., matrix) with constant temperature● The new temperature in the given coordinates (i,j) is equal to the average of

old temperatures of all 9 spots in neighborhood

t [i−1][ j−1] t [i−1][ j ] t [i−1][ j+1]

t [i ] [ j−1] t [i ] [ j ] t [i ] [ j+1]

t [i+1] [ j−1] t [i+1] [ j ] t [i+1] [ j+1]

● Spots with permanent temperature (part of input)● Iterative algorithm: repeat the computation until the difference between two

consecutive iterations is negligible ∀ i , j :|t prev [ i ][ j ]−t old [ i ][ j ]|≤0.00001

For coordinates onborders, computethe average froma smallerneighborhood

Page 4: Parallel programming HW3 assignment

4 / 10

Example of evolution – 1

Page 5: Parallel programming HW3 assignment

5 / 10

Example of evolution – 2

Page 6: Parallel programming HW3 assignment

6 / 10

Example of evolution – 3

Page 7: Parallel programming HW3 assignment

7 / 10

Example of evolution – 4

Page 8: Parallel programming HW3 assignment

8 / 10

Example of evolution – 5

Page 9: Parallel programming HW3 assignment

9 / 10

HW3 assignment● Use the code skeleton

➔ reads test problems, measures runtime➔ The program outputs an image in Netbpm format

● Assignment:➔ implement the Simple 2D Heat Diffusion simulator➔ use MPI➔ upload your solution to UploadSystem

● Flags for g++ (used by UploadSystem)● -Ofast -std=c++17 -march=native

Page 10: Parallel programming HW3 assignment

10 / 10

Tricky issues

● Think about the partition of the input matrix among processes.● Use floats for temperature computation.● Initialize the cells having non-permanent temperature with 128