SlideShare a Scribd company logo
Python Project
Members: Young Song, Hung Lay, Caleb Jang
Problem
• A room has four walls and a fireplace. Temperature of wall is 20°C, and
temperature of fireplace is 100°C. Write a parallel program using Jacobi
iteration to compute the temperature inside the room and plot (preferably in
color) temperature contours at 10°C intervals using Xlib calls or similar
graphics calls as available on your system.
Approach
Approach
• Known: Fire: 100 C, Wall: 20 C
• Unknown: Air: ?
• Initial Air: 0 C
Initial Matrix
[20 20 100 20 20]
[20 0 0 0 20]
[20 0 0 0 20]
[20 0 0 0 20]
[20 20 20 20 20]
The temperature of air which is initially set 0
increases during iterations.
Sequential Code
• Using a fixed number of iterations
for (iteration = 0; iteration < limit; iteration++)
{ for (i = 1; i < n; i++)
for (j = 1; j < n; j++) g[i][j] = 0.25*(h[i-1][j]+h[i+1][j]+h[i][j-1]+h[i][j+1]);
for (i = 1; i < n; i++) /* update points */
for (j = 1; j < n; j++) h[i][j] = g[i][j];
}
Parallel Methods
Split the fixed amount of iterations into process using Partitioning.
Start =0
RNG = iterations/num of process
Process 1: Start to Start+RNG, then Start = Start+RNG
Process 2: Start to Start+RNG, then Start = Start+RNG
Process 3: Start to Start+RNG, then Start = Start+RNG
.
.
.
Code Result
Graphical Result for Ideal Result
Graph from real tables
20 20 20 20 100 100 20 20 20 20
20 22.3 26.05 34.63 58.90 58.90 34.63 26.05 22.3 20
20 23.14 27.27 33.56 42.08 42.08 33.56 27.27 23.14 20
20 22.98 26.35 30.25 33.78 33.78 30.25 26.35 22.98 20
20 22.42 24.90 27.30 29.02 29.02 27.30 24.90 22.42 20
20 21.8 23.53 25.04 25.98 25.98 25.04 23.53 21.8 20
20 21.24 22.40 23.34 23.88 23.88 23.34 22.40 21.24 20
20 20.77 21.47 22.02 22.34 22.34 22.02 21.47 20.77 20
20 20.37 20.70 20.95 21.20 21.20 20.95 20.70 20.37 20
20 20 20 20 20 20 20 20 20 20

More Related Content

PPTX
Python project2
PPT
Complexity analysis
PPTX
Sequential multiplication
PDF
Functions/Inequalities
PPTX
Pa1 flow chart
PDF
Vector processing example
DOC
algorithmdivs
PPTX
Sequential circuit multiplier
Python project2
Complexity analysis
Sequential multiplication
Functions/Inequalities
Pa1 flow chart
Vector processing example
algorithmdivs
Sequential circuit multiplier

What's hot (20)

PPTX
Radix Sort
PDF
Data Structure Radix Sort
PDF
Probability of finding a single qubit in a state
PPTX
Digital and logic designs presentation
PDF
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
PPTX
Random numbers c++ class 11 and 12
PPTX
Class D Audio Amplifier using PSpice
PDF
Lecture 1 python arithmetic (ewurc)
PPT
Graphing day 1 worked
PPTX
Lecture02
PPTX
Lecture 3 time complexity
PDF
Early Sizing Calculation
PPT
4.5 sec and csc worked 3rd
PPT
4.5 tan and cot.ppt worked
PPTX
Greedy
PPTX
Final presentation iot
PPT
Concept of c
PPT
Graphing day 2 worked
DOCX
Lab sheet 4 bti1022
PPT
4.7 inverse functions.ppt worked
Radix Sort
Data Structure Radix Sort
Probability of finding a single qubit in a state
Digital and logic designs presentation
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Random numbers c++ class 11 and 12
Class D Audio Amplifier using PSpice
Lecture 1 python arithmetic (ewurc)
Graphing day 1 worked
Lecture02
Lecture 3 time complexity
Early Sizing Calculation
4.5 sec and csc worked 3rd
4.5 tan and cot.ppt worked
Greedy
Final presentation iot
Concept of c
Graphing day 2 worked
Lab sheet 4 bti1022
4.7 inverse functions.ppt worked
Ad

Similar to Python project (20)

PDF
TR-CIS-0420-09 BobZigon
PDF
PT-4054, "OpenCL™ Accelerated Compute Libraries" by John Melonakos
PPTX
Python Tidbits
PDF
Numba: Array-oriented Python Compiler for NumPy
PDF
Implementation of Computational Algorithms using Parallel Programming
PDF
All Pair Shortest Path Algorithm – Parallel Implementation and Analysis
PDF
NAS EP Algorithm
DOCX
Low power cost rns comparison via partitioning the dynamic range
PDF
III MCS python lab (1).pdf
PDF
Modeling and Verification of Cyber Physical Systems
PDF
Write Python for Speed
PPTX
Daa unit 5
PDF
Big Science, Big Data: Simon Metson at Eduserv Symposium 2012
PDF
Python Performance 101
DOCX
Instructions Write a program that displays a table of Celsius temperat.docx
PDF
Benchmarking the Parallel 1D Heat Equation Solver in Chapel, Charm++, C++, HP...
PDF
AI_Lab_File()[1]sachin_final (1).pdf
PDF
4tocontest
PDF
Final Thesis
PDF
Python Manuel-R2021.pdf
TR-CIS-0420-09 BobZigon
PT-4054, "OpenCL™ Accelerated Compute Libraries" by John Melonakos
Python Tidbits
Numba: Array-oriented Python Compiler for NumPy
Implementation of Computational Algorithms using Parallel Programming
All Pair Shortest Path Algorithm – Parallel Implementation and Analysis
NAS EP Algorithm
Low power cost rns comparison via partitioning the dynamic range
III MCS python lab (1).pdf
Modeling and Verification of Cyber Physical Systems
Write Python for Speed
Daa unit 5
Big Science, Big Data: Simon Metson at Eduserv Symposium 2012
Python Performance 101
Instructions Write a program that displays a table of Celsius temperat.docx
Benchmarking the Parallel 1D Heat Equation Solver in Chapel, Charm++, C++, HP...
AI_Lab_File()[1]sachin_final (1).pdf
4tocontest
Final Thesis
Python Manuel-R2021.pdf
Ad

Recently uploaded (20)

PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administraation Chapter 3
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Introduction to Artificial Intelligence
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Nekopoi APK 2025 free lastest update
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
System and Network Administration Chapter 2
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
L1 - Introduction to python Backend.pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
history of c programming in notes for students .pptx
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
2025 Textile ERP Trends: SAP, Odoo & Oracle
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Introduction to Artificial Intelligence
Which alternative to Crystal Reports is best for small or large businesses.pdf
Odoo POS Development Services by CandidRoot Solutions
How to Choose the Right IT Partner for Your Business in Malaysia
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Nekopoi APK 2025 free lastest update
wealthsignaloriginal-com-DS-text-... (1).pdf
System and Network Administration Chapter 2
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
L1 - Introduction to python Backend.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design

Python project

  • 1. Python Project Members: Young Song, Hung Lay, Caleb Jang
  • 2. Problem • A room has four walls and a fireplace. Temperature of wall is 20°C, and temperature of fireplace is 100°C. Write a parallel program using Jacobi iteration to compute the temperature inside the room and plot (preferably in color) temperature contours at 10°C intervals using Xlib calls or similar graphics calls as available on your system.
  • 4. Approach • Known: Fire: 100 C, Wall: 20 C • Unknown: Air: ? • Initial Air: 0 C
  • 5. Initial Matrix [20 20 100 20 20] [20 0 0 0 20] [20 0 0 0 20] [20 0 0 0 20] [20 20 20 20 20] The temperature of air which is initially set 0 increases during iterations.
  • 6. Sequential Code • Using a fixed number of iterations for (iteration = 0; iteration < limit; iteration++) { for (i = 1; i < n; i++) for (j = 1; j < n; j++) g[i][j] = 0.25*(h[i-1][j]+h[i+1][j]+h[i][j-1]+h[i][j+1]); for (i = 1; i < n; i++) /* update points */ for (j = 1; j < n; j++) h[i][j] = g[i][j]; }
  • 7. Parallel Methods Split the fixed amount of iterations into process using Partitioning. Start =0 RNG = iterations/num of process Process 1: Start to Start+RNG, then Start = Start+RNG Process 2: Start to Start+RNG, then Start = Start+RNG Process 3: Start to Start+RNG, then Start = Start+RNG . . .
  • 9. Graphical Result for Ideal Result
  • 10. Graph from real tables 20 20 20 20 100 100 20 20 20 20 20 22.3 26.05 34.63 58.90 58.90 34.63 26.05 22.3 20 20 23.14 27.27 33.56 42.08 42.08 33.56 27.27 23.14 20 20 22.98 26.35 30.25 33.78 33.78 30.25 26.35 22.98 20 20 22.42 24.90 27.30 29.02 29.02 27.30 24.90 22.42 20 20 21.8 23.53 25.04 25.98 25.98 25.04 23.53 21.8 20 20 21.24 22.40 23.34 23.88 23.88 23.34 22.40 21.24 20 20 20.77 21.47 22.02 22.34 22.34 22.02 21.47 20.77 20 20 20.37 20.70 20.95 21.20 21.20 20.95 20.70 20.37 20 20 20 20 20 20 20 20 20 20 20