מבוא לעיבוד מקבילי

51
יייי יייייי יייייי ייייי יי'4 12.11.2001

Upload: nika

Post on 19-Mar-2016

60 views

Category:

Documents


4 download

DESCRIPTION

מבוא לעיבוד מקבילי. הרצאה מס' 4 12.11.2001. נושאים. MPE Embarrassingly Parallel Computations Fractals Monte Carlo Non-Interacting and Interacting Particle Simulation (home work) Partitioning and Divide-and-Conquer Homework: Assignment #2. שעת קבלה. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: מבוא לעיבוד מקבילי

מבוא לעיבוד מקבילי

4הרצאה מס' 12.11.2001

Page 2: מבוא לעיבוד מקבילי

נושאים

• MPE• Embarrassingly Parallel Computations

– Fractals– Monte Carlo– Non-Interacting and Interacting Particle

Simulation (home work)• Partitioning and Divide-and-Conquer• Homework: Assignment #2

Page 3: מבוא לעיבוד מקבילי

שעת קבלה

ל- 11:00ימי שני, מיד לאחר השיעור, בין • בבניין הנדסת חשמל 126, בחדר 12:00

ומחשבים (ליד המזכירות).

Page 4: מבוא לעיבוד מקבילי

בוחן ביניים

7/12/2001יתקיים ביום שישי, ה- •השעה תרם נקבעה•משך הבוחן עד שעתיים•

Page 5: מבוא לעיבוד מקבילי

פרוייקט גמר

להציע נושאים לפרוייקטים• (שבוע הבא) תפורסם רשימת 5בהרצאה מס' •

נושאים תוך שבוע יש לסגור את בחירת הנושא•קבלת נושא מתוך הרשימה תהיה על בסיס "כל •

הקודם זוכה"

Page 6: מבוא לעיבוד מקבילי

פרוייקט גמר - המשך

בשני השיעורים האחרונים יוצגו בכיתה •הפרוייקטים על-ידי מבצעיהם.

.Power-Pointהנכם מתבקשים להכין מצגת ב- • דקות10משך המצגת כ- •הציון בפרויקט מורכב מהציון שינתן בעת הצגת •

הנושא והמוצר הסופי שיוגש עד לתאריך ה- 18/2/2002.

Page 8: מבוא לעיבוד מקבילי

MPE – Multi-Processing Environment

• A set of graphics routines located in a library called MPE.

• Interface to X windows.

• Any program that uses MPE will have to include “mpe.h”

• Compilation:mpicc fn.c -o fn -lmpe -lX11 -lm

Page 9: מבוא לעיבוד מקבילי

MPE – Useful routines – 1/2MPE_Open_graphics - create a graphics window MPE_Close_graphics - destroy a graphics window MPE_Draw_point - draw a point in a window MPE_Draw_points - draw a series of points in a window. (moderately faster than a series of MPI_Draw_point calls) MPE_Draw_line - draw a line in a window MPE_Fill_rectangle - draw a rectangle in a window MPE_Update - flush the buffer for a window

Page 10: מבוא לעיבוד מקבילי

MPE – Useful routines – 2/2

MPE_Get_mouse_press - wait until the user presses a mouse button and return the press point. MPE_Get_mouse_status (in mouse_status.c) - get information about the mouse state MPE_Drag_square (in mouse_status.c) - let the user select a square on the screen MPE_Make_color_array - create a nice spectrum of colors

Page 11: מבוא לעיבוד מקבילי

MPE Logging RoutinesMPE_Init_log must be called by all processes to initialize MPE logging data structures .

MPE_Finish_log collects the log data from all the processes, merges it, and aligns the timestamps with respect to the times at which MPE_Init_log and MPE_Finish_log were called.

Then, the process with rank 0 in MPI_Comm_world writes the log into the file whose name is given as an argument to MPE_Finish_log.

Page 12: מבוא לעיבוד מקבילי

MPE Logging – An Example

.

if (myid == 0) {

MPE_Describe_state(1, 2, "Broadcast", "red:vlines3"); MPE_Describe_state(3, 4, "Compute", "blue:gray3"); MPE_Describe_state(5, 6, "Reduce", "green:light_gray"); MPE_Describe_state(7, 8, "Sync", "yellow:gray"); } .

/usr/local/mpich/examples/basic/cpilog.c

Page 13: מבוא לעיבוד מקבילי

MPE Logging – An Example

MPI_Barrier(MPI_COMM_WORLD) ;

MPE_Start_log ;()

MPE_Log_event(1, 0, "start broadcast");

MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);

MPE_Log_event(2, 0, "end broadcast") ;

בהמשך התכנית…

בסוף התכנית:

MPE_Stop_log(); MPE_Finish_log("cpilog.log"); MPI_Finalize();

Page 14: מבוא לעיבוד מקבילי

Error Messages

SIGABRT - Abnormal termination of the program (such as a call to abort). SIGFPE - An erroneous arithmetic operation, such as a divide-by-zero or an operation resulting in overflow SIGILL - Detection of an illegal instruction SIGINT - Receipt of an interactive attention signal SIGSEGV - An invalid access to storage SIGTERM - A termination request sent to the program

Page 15: מבוא לעיבוד מקבילי

הבנה נוספת של מודי התקשורת

השקפים הבאים הם מתוך:4http://www.rug.nl/hpc/people/arnold/MPI

Page 16: מבוא לעיבוד מקבילי

Send/Recv

Page 17: מבוא לעיבוד מקבילי
Page 18: מבוא לעיבוד מקבילי
Page 19: מבוא לעיבוד מקבילי

תקשורת קולקטיבית

Page 20: מבוא לעיבוד מקבילי

Barry Wilkinson and Michael Allen Transparencies (Figures and Text)

:PDFקבצי

http://www.cs.uncc.edu/~abw/parallel/par_prog/

resources/transnew.html

Page 21: מבוא לעיבוד מקבילי

Embarrassingly ParallelComputations

Chapter 3 from:Parallel Programming: Techniques and Applications using Networked Workstations and Parallel ComputersBarry Wilkinson and Michael Allen Prentice Hall, 1999.There is a link in the course web site to the book web site.

Page 22: מבוא לעיבוד מקבילי

Embarrassingly ParallelComputations

Go to PDF presentation

Page 23: מבוא לעיבוד מקבילי

תרגיל:Monte Carlo Calculation of

מטרות התרגיל:

ים שוניםCommunicator.שימוש ב- 1

Client/Server. דוגמא ל- 2

. המחשת נושא ה-3

Embarrassingly Parallel Computations

Reference: “Using MPI”, W. Gropp, Ewing Lusk, Anthony SkjellumChapter 3.monte.cקובץ המקור:

Page 24: מבוא לעיבוד מקבילי

MPI_GROUP_EXCL

The MPI_GROUP_EXCL routine creates a new group from an existing group and specifies member processes (by exclusion).

Page 25: מבוא לעיבוד מקבילי

Top 500

• Updated list (November 10th, 2001)• SC2001 Conference• www.top500.org

Page 26: מבוא לעיבוד מקבילי

Installation Type

Count Share Rmax [GF/s] Rpeak [GF/s] Processors

Industry 261 52.2% 38155.44 57191 41140

Research 112 22.4% 57738.71 85150 78802

Academic 84 16.8% 29159.18 40706 27936

Classified 29 5.8% 6625.14 10308 9316

Vendor 12 2.4% 3045.94 4408 4112

Government 2 0.4% 253.10 372 368

Total 500 100% 134977.51 198135 161674

Page 27: מבוא לעיבוד מקבילי

Count Share Rmax [GF/s] Rpeak [GF/s] Processors

N/A 242 48.4% 75005.67 107946 92337

Telecomm 56 11.2% 7494.04 10958 7646

Finance 33 6.6% 5016.94 7193 5810

Weather 26 5.2% 11627.00 16130 11656

Automotive 18 3.6% 2290.10 3885 2668

Database 16 3.2% 2794.60 4031 2674

Transportation 16 3.2% 2195.96 3442 2110

Electronics 13 2.6% 1550.70 2243 1452

Geophysics 13 2.6% 2354.70 3864 2774

Aerospace 13 2.6% 3840.40 5275 4775

Energy 10 2% 12222.90 20447 17416

WWW 9 1.8% 1873.14 2909 2912

Infor. Service 6 1.2% 740.40 1057 480

Chemistry 6 1.2% 1020.10 1698 1996

In.Pr. Service 6 1.2% 876.80 1307 768

Manufacturing 6 1.2% 937.56 1356 982

Mechanics 5 1% 1092.70 1578 1418

Pharmaceutics 2 0.4% 701.00 1008 672

Benchmarking 2 0.4% 690.60 875 536

Defense 1 0.2% 553.00 792 528

Software 1 0.2% 99.20 141 64

Total 500 100% 134977.51 198135 161674

Installation Area

Page 28: מבוא לעיבוד מקבילי

Computer FamilyCount Share Rmax [GF/s] Rpeak [GF/s] Processors

HP SPP 153 30.6% 19867.90 29325 13432

IBM SP 151 30.2% 48294.01 74345 58886

SGI Origin 39 7.8% 10288.00 15025 22748

T3E/T3D 39 7.8% 14083.17 21015 22378

NOW 29 5.8% 8799.07 15227 14637

Sun UltraHPC 24 4.8% 3050.16 4265 5352

Fujitsu VPP 16 3.2% 5469.60 5932 1052

NEC Vector 15 3% 3726.40 3936 668

Hitachi SR8xxx 14 2.8% 8092.40 9750 1892

Compaq AlphaServer 13 2.6% 9917.10 14079 7825

IBM S80s 2 0.4% 306.80 723 804

pp2 2 0.4% 220.00 475 256

prim 1 0.2% 115.70 217 64

Hitachi SR2xxx 1 0.2% 368.20 614 2048

intel Paragon 1 0.2% 2379.00 3207 9632

Total 500 100% 134977.51 198135 161674

Page 29: מבוא לעיבוד מקבילי

Count Share Rmax [GF/s] Rpeak [GF/s] ProcessorsUSA 230 46% 77848.11 120172 109681

Germany 59 11.8% 12054.08 18067 14734Japan 57 11.4% 18383.52 22957 11896

UK 34 6.8% 7236.12 9987 7038France 23 4.6% 3892.40 5225 3565Korea 17 3.4% 2478.60 3509 1740Italy 11 2.2% 1348.43 1884 1278

Canada 11 2.2% 1622.40 2168 1681Netherlands 10 2% 1835.00 2503 2190

Sweden 5 1% 897.34 1395 1480Australia 4 0.8% 1206.51 1573 800Finland 4 0.8% 809.40 1161 924Taiwan 4 0.8% 634.90 825 385Austria 3 0.6% 311.20 447 268

Venezuela 3 0.6% 299.00 423 192Saudi Middle East 2 0.4% 772.00 1080 720

Norway 2 0.4% 240.20 317 284Switzerland 2 0.4% 238.90 320 256

China 2 0.4% 199.10 282 128Spain 2 0.4% 231.20 333 192Brazil 2 0.4% 392.50 564 256

Denmark 2 0.4% 230.00 333 222Mexico 2 0.4% 218.00 294 256Belgium 2 0.4% 295.40 423 192

Singapore 1 0.2% 99.20 141 64Luxembourg 1 0.2% 137.10 204 256Puerto Rico 1 0.2% 99.90 141 64

New Zealand 1 0.2% 115.90 168 140Portugal 1 0.2% 301.00 444 296

Hong Kong 1 0.2% 441.00 636 424Russian Federation 1 0.2% 109.10 159 72

Total 500 100% 134977.51 198135 161674

Countries

Page 30: מבוא לעיבוד מקבילי

Continents

Count Share Rmax [GF/s] Rpeak [GF/s] Processors

USA/Canada 241 48.2% 79470.51 122340 111362

Europe 162 32.4% 30166.87 43202 33247

Japan 57 11.4% 18383.52 22957 11896

South-East Asia 25 5% 3852.80 5393 2741

South America 8 1.6% 1009.40 1422 768

Australia 5 1% 1322.41 1741 940

Middle East 2 0.4% 772.00 1080 720

Total 500 100% 134977.51 198135 161674

Page 31: מבוא לעיבוד מקבילי

ASCI White is again #1 with unchanged performance of 7.2 TF/s on the Linpack

•Three systems are new in the TOP10: •The number of systems exceeding the 1 TFflop/s mark on the Linpack up to 16 •30 systems have peak performance above 1 TFlop/s including two self-made clusters:

•CPlant at Sanida at #30 and •Titan at NCSA at #31

•1.29 Tflop/s is the entry point for the Top 10 •5 of the TOP10 systems are from IBM, 2 from Compaq, and one from Intel, Hitachi, and SGI. •8 of the TOP10 systems are installed in the US, and one in Japan and Germany each.

Highlights from the Top 10

Page 32: מבוא לעיבוד מקבילי

•The new entry level of 94.3 GF/s would have been enough to be listed on position 295 in the last TOP500 just 6 month ago

•Total accumulated performance is 134.4 TFlop/s compared to 108.8 TFlop/s 6 month ago

•Entry level is now 94.3 GF/s compared to 67.8 GF/s 6 month ago In June 1993 no system exceeded this limit. From the Nov 1993 list only the "Numerical Wind Tunnel" at NAL in Japan exceeded this limit. This system is actually still on the list with improved hardware and performance at position 130.

•The entry point for the top100 moved from 241 GF/s to 300 GF/s.

•The first Itanium cluster is at the NCSA at #39 with 678 GF/s.

•The first Windows2000 cluster is at the Cornell Theory Center at #320 with 121 GF/s.

General highlights from the Top 500

Page 33: מבוא לעיבוד מקבילי

Partitioning and Divide-and-Conquer

Go to PDF presentation

Page 34: מבוא לעיבוד מקבילי

2תרגיל בית מס'

(הרצאה 26.11.2001יש להגישו עד לתאריך ה- •) – תוך שבועיים.6מס'

בציון הסופי.15%משקלו כ- •

Page 35: מבוא לעיבוד מקבילי

2תרגיל בית מס'

מטרה:• יחד עם תכנית MPEתרגול הסביבה הגראפית •

MPIמקבילית :תרגול•

Embarrassingly Parallel Computation תרגול סימולציה של תנועת חלקיקים•

Page 36: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

סימולציה של חלקיקים נושא התרגיל:• חלקים3התרגיל מורכב מ-•

Page 37: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

MPE – עבודה גראפית בסביבת 1חלק הנמצאת ב-pmandelהרץ את התכנית

/usr/local/mpich/mpe/contrib/mandel/pmandel-Xדרוש לעבוד בסביבה גראפית. כלומר לעבוד עם

windows. והסתכל בקבצי המקור כדי ללמוד Readmeקרא את ה-

הבסיסיות.שחק עם קלטים שונים MPEאת פקודות ה- על התמונה עם העכברzoomובצע

Page 38: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

Page 39: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

– סימולציה של חלקיקים בקופסה2חלק •החלקיקים נעים בקופסה ומוחזרים מהקירות•בשלב זה אין אינטראקציה בין החלקיקים•סימולציה של פוטונים בין מראות•התנגשות אלסטית עם המראות•צייר את כדורים כאשר כל כדור נשלט על-ידי מעבד •

אחר כדי לצייר את הפתרון ע"ג MPEהשתמש בגרפיקה של •

Xחלון

Page 40: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

הבעיה דו-ממדית•~)5השתמש במספר מועט של חלקיקים (•צבע כל חלקיק בצבע שונה•

Page 41: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

Page 42: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

: הוספת אינטראקציה בין החלקיקים.3חלק •סימולציה של כדורי ביליארד•ההתנגשויות אלסטיות•תנאים מקלים: לכל החלקיקים אותה מסה •

ואותה מהירות (בערכה המוחלט)

Page 43: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס' הבהרות נוספות לגבי התרגיל

Page 44: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

צבע שונה לכל כדור•הפעם יש תקשורת בין המעבדים•חלוקת המרחב למעבדים נקודה למחשבה:•

לעומת הקצאת מעבדים לחלקיקים מסוימים

Page 45: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

מערכת המעבדה

מערכת מרכז המסה

פיזור אלסטי של חלקיקים בעלי מסות שוות וגודל מהירות שווה

Page 46: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס' במערכת מרכז המסה

לחלקיקים מהירות בכיוון y בלבד. לאחר ההתנגשות

הם הופכים כיוון

Page 47: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס'

1001

cossinsincos

)()(

cossinsincos

)(

sincos

sincos

1

2

22

1

11

C

RR

R

vv

v

vv

v

CMCM

CMCM

CMCM

CMCM

נסמן:

V.מהירות החלקיק

R מטריצת סיבוב ממערכת המעבדה למערכת מרכז המסה –

CM.

R-1 הסיבוב חזרה למערכת המעבדה.

C פעולת ההתנגשות במערכת CM.

Page 48: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס' כדי לתאר את וקטור המהירות לאחר

ההתנגשות יש להפעיל על וקטור המהירות שלפני ההתנגשות את שלוש

הטרנספורמציות בזו אחר זו:

v(after) = R-1 C R v(before)

Page 49: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס' מסובבת ביחס למעבדה?CMמהי הזווית בה

)(21

:Therefore

)(21cos

)(21sin

)cos()cos()sin()sin()tan(

)cos()cos(21)cos(

)sin()sin(21)sin(

:axes Yand X along onConservati MomentumFrom

21

21

21

21

21

,

,

21,

21,

CM

CMx

CMyCM

CMCMx

CMCMy

vv

v

v

Page 50: מבוא לעיבוד מקבילי

- המשך2תרגיל בית מס' כאשר ,R-1 C Rמי שיעשה את החישוב

המסות שוות וגודל המהירויות שווה, יגלה כי משמעות הפיזור האלסטי היא החלפה בין

הזויות של זוג החלקיקים המתנגשים!!!

נקודות בונוס (ציון מגן) למי שיכתוב תכנית 5מחשב לפיזור אלסטי כללי עבור מסות שונות

ומהירויות שונות!

Page 51: מבוא לעיבוד מקבילי

בשיעור הבא…

רשימת הפרוייקטים• & Wilkinson ב- 5 (פרק Pipelineחישובים ב- •

Allen(•Virtual Topologies -ב MPI