SlideShare ist ein Scribd-Unternehmen logo
1 von 10
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

Weitere ähnliche Inhalte

Was ist angesagt?

Data Structure Radix Sort
Data Structure Radix SortData Structure Radix Sort
Data Structure Radix SortBhavik Vashi
 
Probability of finding a single qubit in a state
Probability of finding a single qubit in a stateProbability of finding a single qubit in a state
Probability of finding a single qubit in a stateVijayananda Mohire
 
Digital and logic designs presentation
Digital and logic designs presentationDigital and logic designs presentation
Digital and logic designs presentationHaya Butt
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)Sylvain Hallé
 
Random numbers c++ class 11 and 12
Random numbers c++  class 11 and 12Random numbers c++  class 11 and 12
Random numbers c++ class 11 and 12SATHASIVAN H
 
Class D Audio Amplifier using PSpice
Class D Audio Amplifier using PSpiceClass D Audio Amplifier using PSpice
Class D Audio Amplifier using PSpiceTsuyoshi Horigome
 
Graphing day 1 worked
Graphing day 1 workedGraphing day 1 worked
Graphing day 1 workedJonna Ramsey
 
Lecture 3 time complexity
Lecture 3 time complexityLecture 3 time complexity
Lecture 3 time complexityAbirami A
 
Early Sizing Calculation
Early Sizing CalculationEarly Sizing Calculation
Early Sizing CalculationAmol Dudhate
 
4.5 sec and csc worked 3rd
4.5   sec and csc worked 3rd4.5   sec and csc worked 3rd
4.5 sec and csc worked 3rdJonna Ramsey
 
4.5 tan and cot.ppt worked
4.5   tan and cot.ppt worked4.5   tan and cot.ppt worked
4.5 tan and cot.ppt workedJonna Ramsey
 
Final presentation iot
Final presentation iotFinal presentation iot
Final presentation iotAbhiloki
 
Graphing day 2 worked
Graphing day 2 workedGraphing day 2 worked
Graphing day 2 workedJonna Ramsey
 
Lab sheet 4 bti1022
Lab sheet 4 bti1022Lab sheet 4 bti1022
Lab sheet 4 bti1022alish sha
 
4.7 inverse functions.ppt worked
4.7   inverse functions.ppt worked4.7   inverse functions.ppt worked
4.7 inverse functions.ppt workedJonna Ramsey
 

Was ist angesagt? (20)

Radix Sort
Radix SortRadix Sort
Radix Sort
 
Data Structure Radix Sort
Data Structure Radix SortData Structure Radix Sort
Data Structure Radix Sort
 
Probability of finding a single qubit in a state
Probability of finding a single qubit in a stateProbability of finding a single qubit in a state
Probability of finding a single qubit in a state
 
Digital and logic designs presentation
Digital and logic designs presentationDigital and logic designs presentation
Digital and logic designs presentation
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
 
Random numbers c++ class 11 and 12
Random numbers c++  class 11 and 12Random numbers c++  class 11 and 12
Random numbers c++ class 11 and 12
 
Class D Audio Amplifier using PSpice
Class D Audio Amplifier using PSpiceClass D Audio Amplifier using PSpice
Class D Audio Amplifier using PSpice
 
Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)
 
Graphing day 1 worked
Graphing day 1 workedGraphing day 1 worked
Graphing day 1 worked
 
Lecture02
Lecture02Lecture02
Lecture02
 
Lecture 3 time complexity
Lecture 3 time complexityLecture 3 time complexity
Lecture 3 time complexity
 
Early Sizing Calculation
Early Sizing CalculationEarly Sizing Calculation
Early Sizing Calculation
 
4.5 sec and csc worked 3rd
4.5   sec and csc worked 3rd4.5   sec and csc worked 3rd
4.5 sec and csc worked 3rd
 
4.5 tan and cot.ppt worked
4.5   tan and cot.ppt worked4.5   tan and cot.ppt worked
4.5 tan and cot.ppt worked
 
Greedy
GreedyGreedy
Greedy
 
Final presentation iot
Final presentation iotFinal presentation iot
Final presentation iot
 
Concept of c
Concept of cConcept of c
Concept of c
 
Graphing day 2 worked
Graphing day 2 workedGraphing day 2 worked
Graphing day 2 worked
 
Lab sheet 4 bti1022
Lab sheet 4 bti1022Lab sheet 4 bti1022
Lab sheet 4 bti1022
 
4.7 inverse functions.ppt worked
4.7   inverse functions.ppt worked4.7   inverse functions.ppt worked
4.7 inverse functions.ppt worked
 

Ähnlich wie Python project

The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 21 of 88
The Ring programming language version 1.3 book - Part 21 of 88The Ring programming language version 1.3 book - Part 21 of 88
The Ring programming language version 1.3 book - Part 21 of 88Mahmoud Samir Fayed
 
03_NumberSystems.pdf
03_NumberSystems.pdf03_NumberSystems.pdf
03_NumberSystems.pdfvijayapraba1
 
The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202Mahmoud Samir Fayed
 
Class 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsClass 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsDavid Evans
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfUmarMustafa13
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
Lecture - Linear Programming.pdf
Lecture - Linear Programming.pdfLecture - Linear Programming.pdf
Lecture - Linear Programming.pdflucky141651
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical ComputingNaveed Rehman
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manualAhmed Alshomi
 
PMHMathematicaSample
PMHMathematicaSamplePMHMathematicaSample
PMHMathematicaSamplePeter Hammel
 
Technical Meeting Tisigram 2015 HIMAKOM POLBAN
Technical Meeting Tisigram 2015 HIMAKOM POLBANTechnical Meeting Tisigram 2015 HIMAKOM POLBAN
Technical Meeting Tisigram 2015 HIMAKOM POLBANMuhammad Saiful Islam
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representationPooja Tripathi
 
The Ring programming language version 1.7 book - Part 40 of 196
The Ring programming language version 1.7 book - Part 40 of 196The Ring programming language version 1.7 book - Part 40 of 196
The Ring programming language version 1.7 book - Part 40 of 196Mahmoud Samir Fayed
 

Ähnlich wie Python project (20)

The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196
 
The Ring programming language version 1.3 book - Part 21 of 88
The Ring programming language version 1.3 book - Part 21 of 88The Ring programming language version 1.3 book - Part 21 of 88
The Ring programming language version 1.3 book - Part 21 of 88
 
Lenier Equation
Lenier EquationLenier Equation
Lenier Equation
 
03_NumberSystems.pdf
03_NumberSystems.pdf03_NumberSystems.pdf
03_NumberSystems.pdf
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
algorithmdivs
algorithmdivsalgorithmdivs
algorithmdivs
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
 
The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202The Ring programming language version 1.8 book - Part 84 of 202
The Ring programming language version 1.8 book - Part 84 of 202
 
Class 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and PoliticsClass 30: Sex, Religion, and Politics
Class 30: Sex, Religion, and Politics
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Lecture - Linear Programming.pdf
Lecture - Linear Programming.pdfLecture - Linear Programming.pdf
Lecture - Linear Programming.pdf
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manual
 
PMHMathematicaSample
PMHMathematicaSamplePMHMathematicaSample
PMHMathematicaSample
 
Technical Meeting Tisigram 2015 HIMAKOM POLBAN
Technical Meeting Tisigram 2015 HIMAKOM POLBANTechnical Meeting Tisigram 2015 HIMAKOM POLBAN
Technical Meeting Tisigram 2015 HIMAKOM POLBAN
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representation
 
Java Day-7
Java Day-7Java Day-7
Java Day-7
 
The Ring programming language version 1.7 book - Part 40 of 196
The Ring programming language version 1.7 book - Part 40 of 196The Ring programming language version 1.7 book - Part 40 of 196
The Ring programming language version 1.7 book - Part 40 of 196
 
ScalaMeter 2012
ScalaMeter 2012ScalaMeter 2012
ScalaMeter 2012
 

Kürzlich hochgeladen

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

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