UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

Similar documents
UNIVERSITI SAINS MALAYSIA. CST333 Distributed & Grid Computing [Perkomputeran Teragih & Grid]

UNIVERSITI SAINS MALAYSIA. CST332 Internet Protocols. Architecture & Routing [Protokol, Seni Bina & Penghalaan Internet]

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

UNIVERSITI SAINS MALAYSIA. CMT322/CMM323 Web Engineering & Technologies [Kejuruteraan & Teknologi Web]

UNIVERSITI SAINS MALAYSIA. CCS521 Advanced Distributed Systems Concepts and Design [Konsep dan Reka Bentuk Sistem Teragih Maju]

UNIVERSITI SAINS MALAYSIA. CPT211-CPM313 Programming Language Concepts & Paradigm [Konsep & Paradigma Bahasa Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CPT344 Computer Vision & Image Processing [Penglihatan Komputer & Pemprosesan Imej]

UNIVERSITI SAINS MALAYSIA. CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CPT113 Programming Methodology & Data Structures [Metodologi Pengaturcaraan & Struktur Data]

UNIVERSITI SAINS MALAYSIA. Peperiksaan Semester Pertama Sidang Akademik 2003/2004. September/Oktober 2003

MSS 317 Coding Theory [Teori Pengekodan]

UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

UNIVERSITI SAINS MALAYSIA

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication and Computer Networks [Rangkaian Komputer dan Komunikasi Data Lanjutan]

UNIVERSITI SAINS MALAYSIA. CMT422 Multimedia Information Systems & Management [Sistem & Pengurusan Maklumat Multimedia]

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication & Computer Networks [Rangkaian Komputer & Komunikasi Data Lanjutan]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

UNIVERSITI SAINS MALAYSIA. CST334 Network Monitoring & Security [Pengawasan & Keselamatan Rangkaian]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

EEE 428 SISTEM KOMPUTER

UNIVERSITI SAINS MALAYSIA. CMT324 Computer Graphics & Visual Computing [Grafik Komputer & Perkomputeran Visual]

CPT211/CPM313 Programming Language Concepts & Paradigms [Konsep & Paradigma Bahasa Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CST231/CSM331 Data Communications & Networks [Komunikasi Data & Rangkaian]

UNIVERSITI SAINS MALAYSIA. CMT224/CMM221 Multimedia Systems [Sistem Multimedia]

MSS 318 Discrete Mathematics [Matematik Diskret]

EEE 348 PENGANTAR REKABENTUK LITAR BERSEPADU

CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

...a- JEE ELEKTRONIK DIGIT II. UNlVERSlTl SAINS MALAYSIA. Peperiksaan Semester Kedua Sidang Akademik FebruarVMac 2003.

INSTRUCTION: This section consists of FOUR (4) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi EMPAT (4) soalan. Jawab SEMUA soalan.

CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

UNIVERSITI SAINS MALAYSIA. CPT111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CST234 Network Programming [Pengaturcaraan Rangkaian]

UNIVERSITI SAINS MALAYSIA. CST432 Microprocessors & Embedded Systems [Mikropemproses & Sistem Terbenam]

UNIVERSITI SAINS MALAYSIA. CPT103/ CPM211 Struktur Data & Paradigma Pengaturcaraan

ssk 2023 asas komunikasi dan rangkaian TOPIK 4.0 PENGALAMATAN RANGKAIAN Minggu 11

CST432 Microprocessors & Embedded Systems [Mikropemproses & Sistem Terbenam]

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

UNIVERSITI SAINS MALAYSIA. CPT103 Struktur Data & Paradigma Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CPT341 Software Design & Architecture [Reka Bentuk & Seni Bina Perisian]

EEE348 INTRODUCTION TO INTEGRATED CIRCUIT DESIGN (PENGANTAR REKABENTUK LITAR BERSEPADU)

MAT181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

PART A SULIT (EKT 221) BAHAGIAN A. Answer ALL questions. Question 1. a) Briefly explain the concept of Clock Gating.

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

Pengenalan Sistem Maklumat Dalam Pendidikan

UNIVERSITI SAINS MALAYSIA. CCS523 Computer Security & Cryptography [Keselamatan Komputer & Kriptografi]

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

INSTRUCTION: This section consists of TWO (2) short answer and structured essay questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

UNIVERSITI SAINS MALAYSIA. CPT103/CPM211 Struktur Data & Paradigma Pengaturcaraan

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CCS513 Computer Vision and Image Analysis [Penglihatan Komputer dan Analisis Imej]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

EEE 355 ROBOTIC & AUTOMATION [Robotik & Pengautomatan]

COMBINING TABLES. Akademi Audit Negara. CAATs ASAS ACL / 1

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

EEM 312 ROBOTIK & PENGLIHATAN MESIN

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MAT 181 Programming for Scientific Applications [Pengaturcaraan untuk Penggunaan Sains]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2)short answers and TWO (2) structured essays. Answer ALL questions.

Pengguna akan diberikan Username dan Password oleh Administrator untuk login sebagai admin/conference Manager bagi conference yang akan diadakan.

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

Lab 4 : Sorting Techniques

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

PANDUAN PENGGUNA (PENTADBIR SYSTEM/SYSTEM ADMINISTRATOR) (INFOTECH, BPPF DAN POLIS

UNIVERSITI SAINS MALAYSIA EEE 355 ROBOT DAN PENGAUTOMATAN

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

Panduan Guru Maker UNO/ Arduino

UNIVERSITI SAINS MALAYSIA. CMT322/CMM323 Web Engineering & Technologies [Kejuruteraan & Teknologi Web]

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CIT502 Pengaturcaraan dan Kejuruteraan Perisian Berorientasi Objek

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

HARDWARE/SOFTWARE SYSTEM-ON-CHIP CO-VERIFICATION PLATFORM BASED ON LOGIC-BASED ENVIRONMENT FOR APPLICATION PROGRAMMING INTERFACING TEO HONG YAP

UNIVERSITI SAINS MALAYSIA. CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CCS514 - Envisioning Information [Pemelihatan Maklumat]

IMPLEMENTATION OF UNMANNED AERIAL VEHICLE MOVING OBJECT DETECTION ALGORITHM ON INTEL ATOM EMBEDDED SYSTEM

Semasa buku ini ditulis XAMPP mengandungi empat versi:

UNIVERSITI SAINS MALAYSIA. CCS523 Computer Security & Cryptography [Keselamatan Komputer & Kriptografi]

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

CST234 Network Programming [Pengaturcaraan Rangkaian]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

PANDUAN PENGGUNA (PENSYARAH)

UNIVERSITI SAINS MALAYSIA. CST334 Network Monitoring & Security [Pengawasan & Keselamatan Rangkaian]

INSTRUCTION: This section consists of TEN (10) structured questions. Answer ALL questions.

PANDUAN PENGGUNA (SUPPLIER) e-purchase ORDER FOR SERVICES

ISOGEOMETRIC ANALYSIS OF PLANE STRESS STRUCTURE CHUM ZHI XIAN

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

Jawab semua soalan. Nyatakan nilai digit bagi digit yang bergaris. State the digit value of the underlined digit.

TEKNOLOGI, GADJET & KEIBUBAPAAN

Panduan Menggunakan Autoresponder FreeAutobot.com

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2)structured questions.answer ALL questions.

PEPERIKSAAN PERCUBAAN SIJIL PELAJARAN MALAYSIA /1

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

Transcription:

UNIVERSITI SAINS MALAYSIA First Semester Examination 2011/2012 Academic Session January 2012 CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih] Duration : 2 hours [Masa : 2 jam] INSTRUCTIONS TO CANDIDATE: [ARAHAN KEPADA CALON:] Please ensure that this examination paper contains FOUR questions in EIGHT printed pages before you begin the examination. [Sila pastikan bahawa kertas peperiksaan ini mengandungi EMPAT soalan di dalam LAPAN muka surat yang bercetak sebelum anda memulakan peperiksaan ini.] Answer ALL questions. Please write your answers according to the sequence of the questions. [Jawab SEMUA soalan. Sila tulis jawapan anda mengikut turutan soalan.] You may answer the questions either in English or in Bahasa Malaysia. [Anda dibenarkan menjawab soalan sama ada dalam bahasa Inggeris atau bahasa Malaysia.] In the event of any discrepancies, the English version shall be used. [Sekiranya terdapat sebarang percanggahan pada soalan peperiksaan, versi bahasa Inggeris hendaklah diguna pakai.]...2/-

- 2-1. A parallel laboratory has only 4 processors available. Students are given the task of finding the maximum of the following 16 values 78, 34, 67, 21, 123, 87, 243, 9, 17, 74, 98, 21, 87, 23, 450, 76 using these processors. (a) What is the most suitable decomposition method for the problem? Why? (d) Explain how this problem may be solved as a parallel program using an appropriate parallel algorithm model. Accompany your answer with appropriate illustration. If the laboratory received another 4 new processors, how would you decompose the task to be run on all 8 processors? If 70% of the sequential code for finding maximum is suitable for parallelization, what is the speed up for a parallel version of this code using 8 processors? Calculate using Amdahl s and Gustafson-Barsis s law. (e) Discuss why you got two different values in Question 1(d) above. Give two (2) reasons. 2. (a) Explain cache coherence problem and state its two (2) main solutions. Chip Multi-processor (CMP), Cluster and Symmetric multiprocessor (SMP) are parallel machines. Explain each of them based on Flynn s taxonomy, parallel programming model, granularity and system architecture. (12/100) What does the following align and distribution mechanism in High Performance Fortran (HPF) do? You may explain by using an example. (i) (ii) (iii)!hpf$ ALIGN!HPF$ DISTRIBUTE (BLOCK)!HPF$ DISTRIBUTE (CYCLIC)...3/-

- 3-3. (a) OpenMP is based on the fork/join parallelism which is the standard view of shared- memory model. Explain how the fork/join parallelism works. Given the code below, answer the following questions: #pragma omp parallel private (t,x,y,local_count) local_count=0; Random^rand=gcnew Random(); t=omp_get_num_threads(); #pragma omp parallel for for (int i=tid; i<samples; i+=t) x=rand->next(0,1000)*0.0001; y=rand->next(0,1000)*0.0001; if(x*x+y*y<=1.0) local_count++; #pragma omp critical count+=local_count; (i) (ii) (iii) What is the role played by the clause #pragma omp parallel for? What are the local variables in each thread and in which clause they are defined? The code given has a critical section denoted by the #pragma omp critical. What does critical section means and why it is needed in this code? (12/100) Give the parallel version of the following code using OpenMP: float array_sum (float a[], int n) int i; float sum=0.0; for (i=0; i<n; i++) sum+=a[i]; return (sum);...4/-

- 4-4. (a) The following plot describes the parallel performance for the 250 x 250 game-oflife grid. The line with diamond shapes indicates a perfect case for parallelisation. However, the performance shown by three main parallel programming model (i.e. OpenMP, MPI and HPF) do not reach the perfect case. Define perfect (linear) case and give two reasons why there are gaps between the perfect case and the other parallel programming models. Given the following table on the timings (in seconds) for the game-of-life with gridsizes of 250 X 250, discuss the timing of each programming model related to their theoretical concept. You should also consider the trend observed from the table in relation to the number of processors, etc. Number of processors 1 2 3 4 Programming Model OpenMP 79.6 41.9 29.1 21.4 MPI 93.2 49.9 35.6 29.9...5/-

KERTAS SOALAN DALAM VERSI BAHASA MALAYSIA - 5-1. Sebuah makmal komputer selari mempunyai hanya 4 buah pemproses. Para pelajar diberi tugasan untuk mencari maksimum daripada 14 nilai berikut 78, 34, 67, 21, 123, 87, 243, 9, 17, 74, 98, 21, 87, 23, 450, 76 menggunakan pemproses yang sedia ada. (a) Apakah kaedah pembahagian yang paling sesuai untuk masalah ini? Kenapa? Terangkan bagaimana masalah ini boleh diselesaikan sebagai program selari menggunakan model algoritma selari yang sepatutnya. Jika makmal tersebut menerima 4 lagi pemproses baru, bagaimanakah anda akan membahagikan tugas ini untuk dilaksanakan menggunakan 8 pemproses? (d) Jika hanya 70% daripada kod jujukan untuk mencari maksimum ini sesuai untuk dipinda kepada kod selari, apakah tahap speed-up masa larian yang boleh dicapai jika ia dilaksanakan menggunakan 8 pemproses? Buat pengiraan menggunakan hukum Amdahl dan Gustafson-Barsis. (e) Bincang kenapa anda mendapat dua jawapan yang berbeza bagi Soalan 1(d) di atas. Berikan dua (2) sebab. 2. (a) Terangkan masalah cache-coherence dan nyatakan dua (2) cara menyelesaikannya. Chip multi-processor (CMP), Kluster dan Symmetric Multi-processor (SMP) adalah mesin-mesin selari. Terangkan setiap satu berdasarkan taksonomi Flynn, model pengaturcaraan selari, granulariti dan reka bentuk sistem. (12/100)...6/-

- 6 - Apakah yang dilakukan oleh mekanisme Align dan Distribution dalam High Performance Fotran (HPF) berikut. Anda boleh jelaskan dengan menggunakan contoh. (i) (ii) (iii)!hpf$ ALIGN!HPF$ DISTRIBUTE (BLOCK)!HPF$ DISTRIBUTE (CYCLIC) 3. (a) OpenMP adalah berdasarkan perselarian fork/join iaitu pandangan piawai dalam model memori kongsi. Terangkan bagaimana perselarian fork/join ini berfungsi. Diberi atur cara seperti di bawah, jawab soalan-soalan berikut: #pragma omp parallel private (t,x,y,local_count) local_count=0; Random^rand=gcnew Random(); t=omp_get_num_threads(); #pragma omp parallel for for (int i=tid; i<samples; i+=t) x=rand->next(0,1000)*0.0001; y=rand->next(0,1000)*0.0001; if(x*x+y*y<=1.0) local_count++; #pragma omp critical count+=local_count; (i) (ii) (iii) Apakah peranan yang dimainkan oleh klausa #pragma omp parallel for? Apakah pemboleh ubah tempatan bagi setiap bebenang dan di dalam klausa yang manakah mereka diisytiharkan? Atur cara yang diberikan di atas mempunyai bahagian kritikal yang ditandakan oleh klausa #pragma omp critical, apakah yang dimaksudkan dengan bahagian kritikal dan kenapa ia diperlukan dalam atur cara tersebut? (12/100)...7/-

- 7 - Berikan versi selari bagi atur cara berikut menggunakan OpenMP: float array_sum (float a[], int n) int i; float sum=0.0; for (i=0; i<n; i++) sum+=a[i]; return (sum); 4. (a) Plot berikut menunjukkan prestasi selari untuk grid 250 X 250 game-of-life. Garisan dengan bentuk berlian menggambarkan kes sempurna bagi perselarian. Namun demikian, prestasi yang ditunjukkan oleh tiga model pengaturcaraan selari yang utama (iaitu OpenMP, MPI and HPF) tidak mencapai tahap kes sempurna (linear). Definisikan kes sempurna dan bincang kenapa wujud jurang antara kes sempurna dengan kes model pengaturcaraan selari yang lain....8/-

- 8 - Diberikan jadual di bawah yang memaparkan jangkamasa (dalam saat) untuk larian game-of-life menggunakan grid 250 X 250, bincang jangkamasa larian untuk setiap model pengaturcaraan dengan mengaitkannya kepada konsep teori masing-masing. Anda juga patut mempertimbangkan corak yang diperhatikan daripada jadual dari segi bilangan pemproses dan lain-lain. Bilangan Pemproses 1 2 3 4 Model Pengaturcaraan OpenMP 79.6 41.9 29.1 21.4 MPI 93.2 49.9 35.6 29.9 - ooooooo -