DS 642: Applications of Parallel Computing Lecture 6 PDF

Summary

This document is a lecture on parallel computing, specifically covering topics of synchronization and thread management using OpenMP. The NJIT course DS 642 is referenced in the title.

Full Transcript

DS 642: Applications of Parallel Computing Lecture 6 http://www.cs.njit.edu/~bader DS642 1 Synchronization High level synchronization included in the common core (the full OpenMP specification has MANY more): critical barrier Synchronization is used to impose order constraints and to protect access...

DS 642: Applications of Parallel Computing Lecture 6 http://www.cs.njit.edu/~bader DS642 1 Synchronization High level synchronization included in the common core (the full OpenMP specification has MANY more): critical barrier Synchronization is used to impose order constraints and to protect access to shared data 2 Synchronization: critical Mutual exclusion: Only one thread at a time can enter a critical region. float res; #pragma omp parallel { float B; int i, id, nthrds; id = omp_get_thread_num(); Threads wait their turn – only one at a time calls consume() nthrds = omp_get_num_threads(); for(i=id;i

Use Quizgecko on...
Browser
Browser