Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 28 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
28
Dung lượng
402,44 KB
Nội dung
Si nh Vi en Zo ne C om Parallel Paradigms & Programming Models SinhVienZone.com Thoai Nam https://fb.com/sinhvienzonevn om Outline programming paradigms Programmability Issues Parallel programming models – nh Vi en – Implicit parallelism Explicit parallel models Other programming models Si – Zo ne C Parallel https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -2- Parallel Programming Paradigms – Commonly-used algorithmic paradigms – – – – – – nh Vi en ne – Design a parallel program Structure the algorithm of a parallel program Deploy/run the program on a parallel computer system Zo – C om Parallel programming paradigms/models are the ways to Phase parallel Synchronous and asynchronous iteration Divide and conquer Pipeline Process farm Work pool Si https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -3- ne Zo – How much easy to use this system for developing and deploying parallel programs How much the system supports for various parallel algorithmic paradigms nh Vi en – C The programmability of a parallel programming models is Programmability is the combination of – – – Structuredness Generality Portability Si om Parallel Programmability Issues https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -4- A program is structured if it is comprised of structured constructs each of which has these properties – The structuredness mostly depends on – – The programming language The design of the program Si Zo – Is a single-entry, single-exit construct Different semantic entities are clearly identified Related operations are enclosed in one construct nh Vi en – ne C om Structuredness https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -5- – ne Zo – For any program Q in D, we can write a program P in C Both P & Q have the same semantics P performs as well as or better than Q nh Vi en – C A program class C is as general as or more general than program class D if: Si om Generality https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -6- Portability om A program is portable across a set of computer system if it can be transferred from one machine to another with little effort Portability largely depends on – Zo The language of the program The target machine’s architecture nh Vi en – Levels of portability Users must change the program’s algorithm Only have to change the source code Only have to recompile and relink the program Can use the executable directly Si ne C https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -7- Widely-accepted programming models are – C ne – Zo – Implicit parallelism Data-parallel model Message-passing model Shared-variable model ( Shared Address Space model) nh Vi en – Si om Parallel Programming Models https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -8- om Implicit Parallelism The compiler and the run-time support system automatically exploit the parallelism from the sequential-like program written by users Ways to implement implicit parallelism – nh Vi en – Parallelizing Compilers User directions Run-time parallelization Si – Zo ne C https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -9- A parallelizing (restructuring) compiler must C ne Zo – Performs dependence analysis on a sequential program’s source code Uses transformation techniques to convert sequential code into native parallel code nh Vi en – Dependence analysis is the identifying of – – Data dependence Control dependence Si om Parallelizing Compiler https://fb.com/sinhvienzonevn Khoa Khoa học Kỹ thuật Máy tính - Đại học Bách Khoa TP.HCM SinhVienZone.com -10- Users help the compiler in parallelizing by Zo User is responsible for ensuring that the code is correct after parallelization Example (Convex Exemplar C) nh Vi en C – Providing additional information to guide the parallelization process Inserting compiler directives (pragmas) in the source code ne – #pragma_CNX loop_parallel for (i=0; i